Git Product home page Git Product logo

ld-forum's Introduction

ld-forum

ld for Luke Downing This is the build a forum project taught by Luke Downing on Laracasts.

Notes

Validating integers with datasets, PHP has a bug where booleans and floats pass as integers so the numeric validator is best to use. See the Datasets file (topic_id) GH Issue With Link to PHP Docs

Typescript

WIP converting to typescript.

Important files: tsconfig.json vite.config.ts, @types/index, js/ziggy files, js/d.ts files, package.json

Laravel routes now shared with inertia through ziggy. Need to import route from ziggy-js when using route in vue files now. Also have to import axios from axios now. Maybe just to make TS happy.

A lot has been converted but still more to go.

All tests pass at this point (manual visual tests, pest tests, typecheck, and vite build)

Places/people I got assistance from so far:

laravel.io Alberto Rosas

laracasts discussions patrick_j and erbelion

ziggy-js repo readme

And of course the Laravel and Vue docs

Things need finishing

Things need refactoring

UPDATE

Everything that can be TS is now TS

Things still need some refactoring but all is working.

This first iteration of the conversion has been a practice in making red squigglies go away so the code would compile.

A big part of refactoring will be revisiting every place where I put a ? and actually handling the null/undefined possibility so I can remove the ? Every case is different and needs to be examined further.

testing-library

Going to work on testing dom and accessibility with testing-library and vitest. Branch wip-testing Also practicing branch, ci, merging, backups, related topics with this.

inertiajs/inertia#513

try this later

import { config, shallowMount } from '@vue/test-utils';
import ExampleComponent from '@/Components/ExampleComponent';

config.global.mocks = { $t: () => '' };

jest.mock('@inertiajs/inertia-vue3', () => ({
  __esModule: true,
  ...jest.requireActual('@inertiajs/inertia-vue3'), // Keep the rest of Inertia untouched!
  useForm: () => ({ /** Return what you need **/ /** Don't forget to mock post, put, ... methods **/ }),
  usePage: () => ({
    props: {
      value: {
        someSharedData: 'something',
      },
    },
  }),
}));

test('Render ExampleComponent without crashing', () => {
  const wrapper = shallowMount(ExampleComponent, {
    props: {
      otherPageProps: {},
    },
  });
  expect(wrapper.text()).toContain('Hi! I am ExampleComponent.');
});

ld-forum's People

Contributors

isimmons avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.