-
Notifications
You must be signed in to change notification settings - Fork 48
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
Conditionally use LWC type definitions #602
Comments
Hi, @wjhsf. Thanks for directing me to this issue. You mentioned the following in your message that brought me here:
In addition to the static type definitions, presumably the TypeScript transpiler also needs the dynamically-generated, project-specific ones, e.g., those that help fulfill imports for Right now those are generated by the VS Code Extensions into Is there also a plan to have the CLI deployment commands -- or something else -- generate those stubs before trying to run the TypeScript transpiler which itself would occur before trying to deploy the resulting LWC component with its I'm just trying to wrap my head around where this is going. I've already implemented the editor aspects of LWC TypeScript support in Illuminated Cloud, but these issues with deployment of those components based on what I've described above has resulted in me backing out those changes until this aspect reaches a higher level of maturity. Please let me know if this isn't the right place to have that discussion and/or monitor progress on that work. |
I'm not familiar with this area, but theoretically we could generate those types into a directory that could be committed. Assuming there aren't any data privacy concerns with the generated types, or anything like that.
Our goal is to have the TypeScript developer experience be as seamless as it is for JavaScript projects. Part of that is having as much feature parity as we can between the VS Code extension and the CLI. I haven't looked into generating stubs for custom objects at all, but it seems feasible that it could eventually be included in the CLI.
To get more details on the roadmap, and to provide feedback for things you'd like to see, please reach out to Clay Martin. |
The language server currently copies type definitions from an old version of LWC. This was originally added to facilitate autocompletion in JavaScript projects. However, in modern VS Code, if a project has
lwc
in itsnode_modules
, then autocompletion is provided out of the box. Any project that has unit tests for components will necessarily have a local copy oflwc
, so copying the type definitions is unnecessary.Additionally, for TypeScript projects, there are significant incompatibilities between the bundled version (v2.37.3) and the latest version (v8.0.0). For a project using the latest version, a user with the VS Code extension installed will need to have
experimentalDecorators: true
in their tsconfig.json, while a user with a different IDE will need to haveexperimentalDecorators: false
. Since that is not possible, and to remove the need for the language server to keep up with LWC versions, the default behavior should change to using the locally installed version of LWC from a user's project.The text was updated successfully, but these errors were encountered: