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

Revert tsconfig.json change to avoid needing a manual upgrade step in projects #9144

Closed
Haprog opened this issue Oct 8, 2020 · 2 comments
Closed
Assignees
Labels
hilla Issues related to Hilla

Comments

@Haprog
Copy link
Contributor

Haprog commented Oct 8, 2020

Since #9109 the feature/offline branch uses TS in the service worker and needs to have "lib": ["webworker"] in tsconfig.json to avoid randomly failing webpack build. However we have no mechanism (at least currently) to do any updates to existing tsconfig.json in the project so we need to at least make sure to include this information in release notes as upgrade instructions, otherwise when upgrading to this version the webpack build will start failing randomly if you don't make this update to tsconfig.

@Haprog Haprog added the hilla Issues related to Hilla label Oct 8, 2020
@vlukashov
Copy link

Adding "lib": ["webworker"] to the root tsconfig.json file would silence the TS compiler in cases if the developer uses some of the Service Worker APIs in the main application code where they are not available. This is not ideal.

A different approach would be adding /// <reference lib="webworker" /> to the top of the generated sw.ts file (as suggested in microsoft/TypeScript#11781), or moving the sw.ts file into a separate folder with its own tsconfig.json (as suggested in https://stackoverflow.com/questions/56356655/structuring-a-typescript-project-with-workers).

@Haprog
Copy link
Contributor Author

Haprog commented Oct 8, 2020

@vlukashov That sounds like a better solution. Thanks for the insights! I guess we can still use this issue to fix it (revert changes to tsconfig and add the lib reference comment to sw.ts if that makes it work).

@Haprog Haprog self-assigned this Oct 9, 2020
@Haprog Haprog changed the title [offline] Document required tsconfig.json change when upgrading a project Revert tsconfig.json change to avoid needing a manual upgrade step in projects Oct 9, 2020
Haprog added a commit that referenced this issue Oct 9, 2020
Revert adding lib section to tsconfig.json to avoid needing a manual upgrade step in projects.

Fixes #9144
haijian-vaadin pushed a commit that referenced this issue Oct 12, 2020
…9153)

Revert adding lib section to tsconfig.json to avoid needing a manual upgrade step in projects.

Fixes #9144
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hilla Issues related to Hilla
Projects
None yet
Development

No branches or pull requests

3 participants