App extension typescript support
See original GitHub issueIt would be nice if quasar would support app extensions written in typescript.
At least the following should be considered:
- Make
quasar create my-ext --kit app-extension
ask the user if he wants to write his AE in typescript, and if so, scaffold all required typescript tools and code into the AE. - If typescript is used, JS should still be supported. For this the code should probably be transpiled. For files in the
templates
folder there should probably be a way to transpile them to JS after rendering them (a better but more complicated approach than https://github.com/quasarframework/quasar/pull/7297). - Since quasar handles the install/index/prompts API files, there should be a way to determine if they are written in typescript and handled accordingly.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:29 (29 by maintainers)
Top Results From Across the Web
quasar/quasar-app-extension-typescript
Start using @quasar/quasar-app-extension-typescript in your project ... TypeScript support docs https://quasar.dev/quasar-cli/supporting-ts ...
Read more >quasar/quasar-app-extension-typescript - npm package
An important project maintenance signal to consider for @quasar/quasar-app-extension-typescript is that it hasn't seen any new versions released to npm in the ...
Read more >Creating a Chrome extension with React and TypeScript
Creating a React application with Create React App (CRA). Creating a React application with TypeScript support is easy using CRA. npx create- ...
Read more >Creating Chrome Extensions With TypeScript | by Enis Erbek
Support for modern JavaScript features; Advanced type system; Developer tooling support. With the help of TypeScript, your application can suddenly be type-safe ...
Read more >quasar/quasar-app-extension-typescript examples
Learn how to use @quasar/quasar-app-extension-typescript by viewing and forking @quasar/quasar-app-extension-typescript example apps on CodeSandbox.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright, thanks. I’ll migrate things to the
ui
kit, but the problem withapp-extension
(boot and render files) written in TS stays the same. They are also tightly coupled with the Quasar project itself (e.g. the AE might need axios which is imported from a boot file), which are non-existent when developing the AE. In JS I worked around it by just assuming it is available after installing, but typescript does not like assumptions. I’ve noticed Vue’sprovide
andinject
functions which might help, but I haven’t looked into it yet.So:
ui
folderI think with the correct Rollup config and plugins it will only require some minor changes to Quasar’s AE handling to support Typescript for app extensions.
The main problem is that for some reason the official rollup Typescript plugin does not work, but rollup-plugin-typescript2 does. However, rollup-plugin-typescript2 only compiles to
esnext
which is not supported by Webpack 4 (atleast optional chaining operators aren’t) so Quasar will not build.Once v2 is stable I’ll try to get everything to work and create a PR.
Edit: Actually, Quasar can also import the source .ts files directly so changing
main
in package.json to the src folder instead of dist seems to work for an app extension.