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

also in Script, or just Module? #3

Open
ljharb opened this issue Nov 14, 2018 · 7 comments
Open

also in Script, or just Module? #3

ljharb opened this issue Nov 14, 2018 · 7 comments

Comments

@ljharb
Copy link
Member

ljharb commented Nov 14, 2018

import() works in both Scripts and Modules. Should asset work in Scripts, for the same reasons?

@sebmarkbage
Copy link
Collaborator

Good question. I think there is an interesting overlap with import maps. Particularly “import:” URLs or something like it. The larger story around how URLs will work in the larger web platform can be informative of how it could work in scripts.

@bmeck
Copy link
Member

bmeck commented Nov 16, 2018

if this syntax works in a way that requires IO/async ops to perform resolution before starting code evaluation I don't think this would work for Scripts since they are expected for run synchronously.

@ljharb
Copy link
Member Author

ljharb commented Nov 16, 2018

I would assume the synchronous form is not available in Scripts, but the asynchronous one should work, just like import() does.

@bmeck
Copy link
Member

bmeck commented Nov 16, 2018

@ljharb is this mostly about consistency? If the location operations are not timed specifically we can still produce the reference synchronously.

@ljharb
Copy link
Member Author

ljharb commented Nov 16, 2018

Yes, I think a lack of consistency will be confusing, including in terms of thinking about the phases in ESM.

@bmeck
Copy link
Member

bmeck commented Nov 19, 2018

including in terms of thinking about the phases in ESM.

Can you explain how these values are directly tied in part to the phases of ESM?

@ljharb
Copy link
Member Author

ljharb commented Nov 19, 2018

With static forms, i expect that all imports are fully resolved and valid before any actual code evaluates. import ‘nonexistent’ throws before anything is evaluated; I’d expect asset from ‘nonexistent’ to do the same.

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