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

import.meta.resolve() #2

Closed
marcoscaceres opened this issue Jun 29, 2022 · 6 comments
Closed

import.meta.resolve() #2

marcoscaceres opened this issue Jun 29, 2022 · 6 comments
Labels
from: Google Proposed, edited, or co-edited by Google. position: support topic: html Spec relates to HTML (Hypertext Markup Language) topic: javascript Spec relates to the JavaScript programming language topic: loading venue: WHATWG HTML Workstream

Comments

@marcoscaceres
Copy link
Contributor

marcoscaceres commented Jun 29, 2022

Request for position on an emerging web specification

  • WebKittens who can provide input:

Information about the spec

Design reviews and vendor positions

  • TAG Design Review:
  • Mozilla standards-positions issue:

Bugs tracking this feature

Anything else we need to know

On WebKit-dev, @domenic proposed:

We're proposing a small additional function to add to the HTML Standard, named import.meta.resolve(). See the PR 1 and a mini-explainer 2. Gecko folks have reviewed the PR and contributed to the discussion, but any thoughts from WebKit would be very welcome.

We're hoping to ship in Chrome within the next few weeks, and I imagine web developers would love it if you were to also implement. We have a basic implementation and web platform tests you may find useful 3.

Thanks,
Domenic

@othermaciej othermaciej added topic: html Spec relates to HTML (Hypertext Markup Language) topic: javascript Spec relates to the JavaScript programming language topic: loading labels Jun 29, 2022
@Constellation
Copy link
Member

Constellation commented Jun 29, 2022

This looks reasonable. Our internal implementation starts with async resolve function, and eventually we converted it into sync resolve function too.

@marcoscaceres marcoscaceres changed the title Request for position on import.meta.resolve() import.meta.resolve() Jun 30, 2022
@domenic
Copy link

domenic commented Jun 30, 2022

Thanks @marcoscaceres and @Constellation!

I've merged the HTML spec PR, so there is now a spec at https://html.spec.whatwg.org/#hostgetimportmetaproperties . Tests are at web-platform-tests/wpt#34188 and I filed a WebKit bug at https://bugs.webkit.org/show_bug.cgi?id=242163 . Let me know if there's anything else I can help with.

@marcoscaceres
Copy link
Contributor Author

Thanks @domenic! That's great. And thanks also for filling the WebKit bug. 🙏

@litherum
Copy link

The sync version seems fairly easily polyfill-able. That’s not to say that it’s useless to add to browsers; it just seems like it wouldn’t be high priority.

Regarding the async version:

it might be useful for the function to account for concerns like HTTP redirects

This is certainly more powerful than the sync version, but 1. Is probably not what authors actually want, and 2. Seems complicated enough that I don’t know how it would actually work.

@othermaciej othermaciej added the from: Google Proposed, edited, or co-edited by Google. label Sep 25, 2022
@Constellation
Copy link
Member

WebKit/WebKit@78c6d6d Landed into WebKit.

@hober
Copy link
Member

hober commented Mar 23, 2023

Closing as we've identified our position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from: Google Proposed, edited, or co-edited by Google. position: support topic: html Spec relates to HTML (Hypertext Markup Language) topic: javascript Spec relates to the JavaScript programming language topic: loading venue: WHATWG HTML Workstream
Development

No branches or pull requests

6 participants