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

fix(app-vite&app-webpack): fix types feature flags #17429

Merged

Conversation

yusufkandemir
Copy link
Member

@yusufkandemir yusufkandemir commented Aug 9, 2024

What kind of change does this PR introduce?

  • Bugfix
  • 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)
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)

Other information:
#17301 changes moduleResolution from node to bundler. That broke the feature flags system. Here is an example common error:

Property store does not exist on type BootFileParams<any>

It's because even though TS normally doesn't enforce the file extension inside the app code and imports from node_modules when using bundler, it does enforce it for wildcard package.json > exports entries. So, quasar/dist/types/feature-flag no longer works and must be changed to quasar/dist/types/feature-flag.d.ts instead.

Does not have to be backported to current stable releases of app-vite and app-webpack, as long as #17301 is not backported either.

This change will only apply to feature flags generated after the release of this. So, existing projects will only benefit from it when they add Pinia or build modes, OR delete the feature flag files and run quasar dev/quasar build to re-generate them. New projects will work fine. So, we should add a notice to @quasar/app-vite-v2.0.0-beta.16 and @quasar/app-webpack-v4.0.0-beta.17 to notify them. We better also post an announcement about it. I recommend informing the users to delete the files, and then regenerate them by running quasar dev/quasar build, instead of letting them update them individually. This will be easier to tell and less error-prone.

Using rimraf through npx(or pnpx, yarn dlx, bunx)

$ npx rimraf -g ./**/*-flag.d.ts
$ quasar build # or dev

Unix-like (Linux, macOS):

$ rm ./**/*-flag.d.ts
$ quasar build # or dev

Windows (CMD):

> del /s *-flag.d.ts
> quasar build &:: or dev

Windows (PowerShell):

> Remove-Item -Recurse -Filter *-flag.d.ts
> quasar build # or dev

@IlCallo IlCallo merged commit d2ec87d into quasarframework:dev Aug 12, 2024
49 checks passed
@IlCallo IlCallo deleted the fix-broken-types-feature-flags branch August 12, 2024 08:37
@rstoenescu
Copy link
Member

Thanks for the detailed explanation!

yusufkandemir added a commit to yusufkandemir/quasar that referenced this pull request Aug 19, 2024
yusufkandemir added a commit to yusufkandemir/quasar that referenced this pull request Aug 19, 2024
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.

3 participants