-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Respect the default setting of the useDefineForClassFields tsconfig option #1354
Comments
The TypeScript language now works like this as of TypeScript 4.3.1, so esbuild has been changed to match. The issue microsoft/TypeScript#34787 has some additional context. I'm not sure why the TypeScript team decided to release this as a silent breaking change without an announcement. But the documentation for LitElement is now incorrect. The default value is Anyway specifying If you are using an old version of TypeScript you can either add |
Oh, I see. |
As of TypeScript 4.3.1+, [one must specify `useDefineForClassFields: false` explicitly](evanw/esbuild#1354 (comment)) when targeting ESNext, because [TC39 now uses the same syntax](https://www.typescriptlang.org/tsconfig#useDefineForClassFields) and these would conflict otherwise. Updating this configuration allows the Storybook configuration to continue working. Pharos itself never broke because it is currently targeting `es2019`. Chromatic didn't catch this because it targets `firefox65` because Chromatic has a really crusty old Firefox. Womp.
* fix(storybook): add useDefineForClassFields false As of TypeScript 4.3.1+, [one must specify `useDefineForClassFields: false` explicitly](evanw/esbuild#1354 (comment)) when targeting ESNext, because [TC39 now uses the same syntax](https://www.typescriptlang.org/tsconfig#useDefineForClassFields) and these would conflict otherwise. Updating this configuration allows the Storybook configuration to continue working. Pharos itself never broke because it is currently targeting `es2019`. Chromatic didn't catch this because it targets `firefox65` because Chromatic has a really crusty old Firefox. Womp. * fix(pharos): add useDefineForClassFields to main package
* fix(storybook): add useDefineForClassFields false As of TypeScript 4.3.1+, [one must specify `useDefineForClassFields: false` explicitly](evanw/esbuild#1354 (comment)) when targeting ESNext, because [TC39 now uses the same syntax](https://www.typescriptlang.org/tsconfig#useDefineForClassFields) and these would conflict otherwise. Updating this configuration allows the Storybook configuration to continue working. Pharos itself never broke because it is currently targeting `es2019`. Chromatic didn't catch this because it targets `firefox65` because Chromatic has a really crusty old Firefox. Womp. * fix(pharos): add useDefineForClassFields to main package
Sometime between 0.11.20 and 0.12.6 esbuild stopped transpiling public class fields into assignments inside the constructor when the
target
tsconfig setting is set toesnext
anduseDefineForClassFields
is not present. This breaks LitElement decorators that make properties reactive, as described here. It's mentioned there thatuseDefineForClassFields
is set tofalse
by default. Maybe the default value should be respected when transpiling typescript files?The text was updated successfully, but these errors were encountered: