gernzy / gernzy

Gernzy ecommerce platform in development
0 stars 5 forks source link

[JavaScript] Move all core and package js to typescript files (.ts), with a view to refactoring the jquery client to AlpineJS #103

Open lukesiedle opened 4 years ago

lukesiedle commented 4 years ago

@AlexeiaW so one way we can reduce potential bugs in our app is to move to a superset of JS called TypeScript (which also has excellent vscode support).

Everything will become more strongly typed this way, and we can catch smaller issues that may not necessarily be caught by unit tests.

Moving to typescript will require importing types for any third party libs we're using. To move to Typescript, probably the easiest route will be using ts-loader in Webpack, but let's investigate the options here.

As a sidenote, it's likely we'll move the "simple jquery client" into alpine js rather, which does the job better and will be more embraced by the Laravel community. This can be a separate task but we may want to do this refactor first otherwise we'll be wasting time redoing some of the jQuery work in Typescript. That said, a lot of the JavaScript is just service based so would be reusable for alpine.

https://github.com/alpinejs/alpine