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

support import assertion #2432

Open
wenerme opened this issue Oct 4, 2022 · 4 comments
Open

support import assertion #2432

wenerme opened this issue Oct 4, 2022 · 4 comments

Comments

@wenerme
Copy link
Collaborator

wenerme commented Oct 4, 2022

Description of Proposed Feature

Same sematic of

import 'a'
import 'b' assert {type: 'css'}
import 'c'

await import('d', {assert:{type:'xyz'}})

In what way would you use it?

import

System.register(
  ["a", 'b', "c"],
  () => void 0,
  [,{ assert: { type: "css" } } ,]
);

import()

System.import('d',{assert:{type:'xyz'}})

@guybedford
Copy link
Member

Would be great - Babel and TypeScript could also be updated to support this output when transpiling. I wonder how we would integrate it into the imports of the System.register format?

@wenerme
Copy link
Collaborator Author

wenerme commented Oct 5, 2022

What do you mean integrate it into the imports of the System.register format ? Dose #2433 solve the problem ?

@guybedford
Copy link
Member

I guess the guidance needs to be put together for transpilers and tools primarily? Ie things like - should import assertions always be output? What format should they be output as? etc. You can PR https://github.com/systemjs/systemjs/blob/main/docs/system-register.md to update this guidance.

@ExE-Boss
Copy link

ExE-Boss commented May 1, 2023

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