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

Should TypeScript be part of the devDependencies? #115

Open
iliocatallo opened this issue Jan 17, 2023 · 4 comments
Open

Should TypeScript be part of the devDependencies? #115

iliocatallo opened this issue Jan 17, 2023 · 4 comments

Comments

@iliocatallo
Copy link

iliocatallo commented Jan 17, 2023

Hi,

I usually instruct VSCode to use the TypeScript installation in node_modules/, but I just noticed that – when asked to bootstrap a new component, npm init stencil generates a package.json that does not list typescript as a dev dependency. Is this intentional?

Thank you,
Ilio.

@rwaskiewicz
Copy link
Member

Hi @iliocatallo 👋

Great question! This is intentional - @stencil/core contains a recent version of the TypeScript compiler. The reason for this is there is a high need for the APIs of the TypeScript compiler to match what Stencil expects to be using. As a result, a separate installation of TypeScript isn't required. For more information, please see https://stenciljs.com/docs/support-policy#typescript-support. Thanks!

@iliocatallo
Copy link
Author

iliocatallo commented Jan 17, 2023

Hi @rwaskiewicz!

Thank you for the explanation. Question: would it make sense to require typescript (at the exact required version) as a peer dependency of @stencil/core?

If not instructed otherwise, VSCode defaults to its own version of TypeScript, which could in principle be different from the version that @stencil/core internally uses.

Ciao!
Ilio.

@rwaskiewicz
Copy link
Member

Question: would it make sense to require typescript (at the exact required version) as a peer dependency of @stencil/core?

Potentially in the future, it may! However at the moment such a change would require some pretty significant changes to Stencil.

If not instructed otherwise, VSCode defaults to its own version of TypeScript, which could in principle be different from the version that @stencil/core internally uses.

That's a valid point. I wonder if there's some way Stencil can tell VSCode what version of TypeScript it contains 🤔 If not, it's something we could probably add to our documentation.

@mfsbo
Copy link

mfsbo commented Jan 26, 2023

microsoft/vscode#42243 (comment) this might be relevant to choosing typescript version via Settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants