Skip to content

update Ref type import#1616

Closed
jeff-fe wants to merge 1 commit into
vuejs:mainfrom
jeff-fe:patch-2
Closed

update Ref type import#1616
jeff-fe wants to merge 1 commit into
vuejs:mainfrom
jeff-fe:patch-2

Conversation

@jeff-fe

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

Copy link
Copy Markdown

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

netlify Bot commented Mar 12, 2022

Copy link
Copy Markdown

✔️ 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

@dammy001 dammy001 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@skirtles-code

Copy link
Copy Markdown
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

jeff-fe commented Apr 12, 2022

Copy link
Copy Markdown
Author

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