Skip to content

update Ref type import #1616

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

Closed
wants to merge 1 commit into from
Closed

update Ref type import #1616

wants to merge 1 commit into from

Conversation

jeff-fe
Copy link

@jeff-fe jeff-fe commented Mar 12, 2022

In TypeScript 4.5+, This practice appears error message(TS1444: 'Ref' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.). We should change Type import mode.

image

Reference linking: https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta

In TypeScript 4.5+, This practice appears  error message(`TS1444: 'Ref' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.`). We should change Type import mode.
Reference linking: https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta
@netlify
Copy link

netlify bot commented Mar 12, 2022

✔️ Deploy Preview for vuejs ready!

🔨 Explore the source changes: 288d55a

🔍 Inspect the deploy log: https://app.netlify.com/sites/vuejs/deploys/622c994f6f8e3700080955e6

😎 Browse the preview: https://deploy-preview-1616--vuejs.netlify.app

Copy link
Contributor

@dammy001 dammy001 left a comment

Choose a reason for hiding this comment

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

@skirtles-code
Copy link
Contributor

Thanks for the PR. Sorry for the delay. I don't use TS myself, so I didn't really feel qualified to review it, and when I reached out for help it turned out there were various other complications.

The syntax currently used in the docs is valid, but it isn't compatible with the default settings used by npm init vue, giving the warning mentioned above. Whether Vite needs to use those settings is up for discussion, but as it doesn't seem likely it'll change in the near future we do need to address this in the docs.

There are two different ways this could be addressed using the type modifier. The one shown in this PR would be my preferred option, but it doesn't currently work with the SFC Playground.

To ensure compatibility with both Vite and the Playground, I've opened PR #1656 to apply the alternative fix.

I've updated some of the other examples in that PR too, as there are a handful of other cases where types are being imported.

@jeff-fe
Copy link
Author

jeff-fe commented Apr 12, 2022

Thanks for the PR. Sorry for the delay. I don't use TS myself, so I didn't really feel qualified to review it, and when I reached out for help it turned out there were various other complications.

The syntax currently used in the docs is valid, but it isn't compatible with the default settings used by npm init vue, giving the warning mentioned above. Whether Vite needs to use those settings is up for discussion, but as it doesn't seem likely it'll change in the near future we do need to address this in the docs.

There are two different ways this could be addressed using the type modifier. The one shown in this PR would be my preferred option, but it doesn't currently work with the SFC Playground.

To ensure compatibility with both Vite and the Playground, I've opened PR #1656 to apply the alternative fix.

I've updated some of the other examples in that PR too, as there are a handful of other cases where types are being imported.

Thank you very much

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