Skip to content

(feat) support preserveValueImports introduced in TS 4.5 #434

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

Merged

Conversation

dummdidumm
Copy link
Member

This new flag keeps imports as is, essentially functioning the same as the import transformer.

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR relates to an outstanding issue, so please reference it in your PR, or create an explanatory one for discussion. In many cases features are absent for a reason.
  • This message body should clearly illustrate what problems it solves. If there are related issues, remember to reference them.
  • Ideally, include a test that fails without this PR but passes with it. PRs will only be merged once they pass CI. (Remember to npm run lint!)

Tests

  • Run the tests with npm test or yarn test

This new flag keeps imports as is, essentially functioning the same as the import transformer.
@kaisermann kaisermann self-requested a review November 18, 2021 11:26
@kaisermann
Copy link
Member

@dummdidumm LGTM, but I'm a bit out of context and busy with moving to another country, sorry for taking some days to check this! This is possible due to TS 4.5, right?

@dummdidumm
Copy link
Member Author

Correct. TS 4.5 introduced the new setting preserveValueImports along with DX to neatly separate types and values. You can read more on that here: https://devblogs.microsoft.com/typescript/announcing-typescript-4-5/#preserve-value-imports

@kaisermann kaisermann merged commit 480ee29 into sveltejs:main Dec 13, 2021
@@ -87,7 +87,7 @@
"sugarss": "^2.0.0",
"svelte": "^3.42.0",
"ts-jest": "^25.1.0",
"typescript": "^4.4.2"
"typescript": "^4.5.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question: (when) have we removed the support for v3? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never, these are the dev dependencies, not the peer dependencies.

kaisermann added a commit that referenced this pull request Dec 13, 2021
* (feat) support preserveValueImports introduced in TS 4.5

This new flag keeps imports as is, essentially functioning the same as the import transformer.

* Update test/transformers/typescript.test.ts

Co-authored-by: Simon Holthausen <[email protected]>
Co-authored-by: Christian Kaisermann <[email protected]>
@dummdidumm dummdidumm deleted the support-preservevalueimports-flag branch December 13, 2021 09:52
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

Successfully merging this pull request may close these issues.

3 participants