Closed mindon closed 2 months ago
I believe this was because esbuild 0.18.0 adds support for vanilla JavaScript decorators (different from the "experimental" one invented by TypeScript). You just need to add the tsconfig "experimentalDecorators": true
to enable the old behavior.
On the other hand, lit/decorators
seems do support the new behavior: https://lit.dev/docs/components/decorators/#decorator-versions. You just have to add the accessor
modifier to enable that.
I believe this was because esbuild 0.18.0 adds support for vanilla JavaScript decorators (different from the "experimental" one invented by TypeScript). You just need to add the tsconfig
"experimentalDecorators": true
to enable the old behavior.On the other hand,
lit/decorators
seems do support the new behavior: https://lit.dev/docs/components/decorators/#decorator-versions. You just have to add theaccessor
modifier to enable that.
"experimentalDecorators" is true, add the accessor
modifier to make it works!
but here https://lit.dev/docs/components/properties/#accessors-custom it says
If your class does not define accessors for a property, Lit will generate them, even if a superclass has defined the property or accessors.
I'm closing this issue as this seems like expected behavior. As described in the release notes, getting the old decorator behavior from version 0.17.19 now requires "experimentalDecorators": true
with version 0.18.0 and above.
here's a ts example, which works fine with esbuild v0.17.19, but not any more with later esbuild v0.18.0 to v0.23.1
the bundle js throw error Error: Unsupported decorator location: field