-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
feat(compiler-sfc): support import attributes and using
syntax in TS
#8786
Conversation
Size ReportBundles
Usages
|
with
syntax
with
syntaxusing
syntax in TS
4df84ee
to
d1e8944
Compare
plugins.push(['typescript', { dts }]) | ||
plugins.push(['typescript', { dts }], 'explicitResourceManagement') | ||
if (!plugins.includes('importAssertions')) { | ||
plugins.push(['importAttributes', { deprecatedAssertSyntax: true }]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why support the deprecated syntax here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently in [email protected] only support import assert
syntax (deprecatedAssertSyntax
). In [email protected] it support both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should only support the latest version.
Also, the includes
check should also check importAttributes
? This way the user can override the default by specifying importAttributes
with their own options, if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest version of TypeScript is 5.2, and 5.3 will be released on 2023-11-14, which is less than one month (and the beta version is already released). Vue 3.4 stable could be likely later than it.
upgrade babel and add `importAttributes` for parser plugin. TypeScript already supports this syntax [proposal](https://github.com/tc39/proposal-import-attributes)
a86adda
to
efddf96
Compare
Made a few adjustments in efddf96:
|
upgrade babel, add
importAttributes
andexplicitResourceManagement
for parser plugins.TypeScript 5.2 already supports these syntaxes.
relate microsoft/TypeScript#53656
Example