-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
fix(create-vite): update template-lit-ts tsconfig (fix #12854) #12855
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Is this still valid with TS 5? Same for |
Hi, I think this options must be keep since esbuild is not a full spec typescript compiler. By other hand, Lit docs really recommend this options to be setted. Why? Currently, lit uses old decorators style since it uses typescript 4.7. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this if it's what the lit docs recommend.
I personally feels bad to ship empty templates with legacy/deprecated options turn on. If decorators are not a required part of the framework, I would advice people to not start using this legacy runtime behaviour that will never be shipped to engines. Is this legacy requirement tracked as an issue on the framework side? |
Lit does plan to implement the new decorators eventually but we require decorator metadata to be implemented microsoft/TypeScript#53461 for feature parity with our existing decorators. While technically decorators are not a required part of the framework, most Lit projects using TS will be using decorators as they are prevalent in the official docs and examples as well. I do understand the hesitation of including legacy/deprecated settings for templates. However, per the TS 5.0 blog
I believe it's valid to include this flag for projects that have relied on this feature for so long. And these flag requirements are documented in the Lit docs as mentioned above. As it is, https://vite.new/lit-ts leads to a non-functioning project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update and the pointer.
For more context on my initial pushback, I think we have a great chance in the ecosystem to have access to fast transpiler like esbuild and I think we should try to stay away from TS features that are more than syntax transformation to be able to use these new transpilers.
Description
Fixes #12854
Updates tsconfig settings to be compatible with Lit projects.
Context for settings: https://lit.dev/docs/components/decorators/#decorators-typescript
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).Submitted with StackBlitz Codeflow.