Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(create-quasar): add TS AE template #17168

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from

Conversation

yusufkandemir
Copy link
Member

@yusufkandemir yusufkandemir commented May 6, 2024

What kind of change does this PR introduce?

  • Feature

Does this PR introduce a breaking change?

  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch (or v[X] branch)

Other information:
Contains fixes for app-vite&app-webpack types of AE API files, e.g. IndexAPI

Adds a TS AE template, highlights:

  • TypeScript setup, of course
  • ESLint v9 using flat config format, with a good configuration (ESLint v9 will be backported to all other relevant templates later)
  • Vue SFC (.vue files) support (will be backported to the JS template later) (thanks @danielroe for tips)
  • Monorepo structure with app-vite and app-webpack playground apps

There is a limitation with the SFC support. When using <script setup lang="ts">, it won't work in JS app-webpack apps. This is because mkdist skips processing it and there is no TypeScript support in JS app-webpack, so it fails. If unjs/mkdist#210 gets released, then this limitation will become "when using <script setup lang="ts"> AND type-only macros, e.g. defineProps<QBtnProps>().
Alternatively, to completely eliminate the limitation, we could add TS processing support to app-webpack when using JS. We may do this in the core, or via a snippet in AE index API. app-vite JS works fine due to how Vite is configured to handle TS automatically.
For now, I just left some comments explaining the limitations.

What to do next:

I haven't added the UI kit due to complexity, limitations, time constraints, etc. It can be plugged into the template in the form of another workspace entry in the monorepo later. As the AE can now also ship SFC files and act as a library that can expose methods and such, the importance of the UI kit is reduced. The only purpose of the UI kit is to support other flavors, e.g. Vite plugin, Vue CLI plugin, and UMD. UMD will be problematic regarding SFC support as AEs will ship transpiled .vue files and there is no build system to integrate those. We may need to build SFCs into .js and ship it that way for UMD, but we would need to figure out the limitations to do that.

We may also want to offer the non-monorepo version of the TS AE kit as people might want to create AEs into their existing monorepos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant