question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App extension typescript support

See original GitHub issue

It 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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:29 (29 by maintainers)

github_iconTop GitHub Comments

1reaction
stefanvanherwijnencommented, Jul 23, 2020

Alright, thanks. I’ll migrate things to the ui kit, but the problem with app-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’s provide and inject functions which might help, but I haven’t looked into it yet.

So:

  • Move all UI components to the ui folder
  • Find a way to integrate TS boot and render files into Quasar with backwards compatibility.
0reactions
stefanvanherwijnencommented, Apr 6, 2021

I 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found