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 implementation #2230

Merged
merged 1 commit into from Aug 10, 2020
Merged

import.meta.resolve implementation #2230

merged 1 commit into from Aug 10, 2020

Conversation

guybedford
Copy link
Member

This implements an import.meta.resolve function on the SystemJS context in core allowing contextual resolution for native ES modules converted into the SystemJS format.

This is as landed in ES Module Shims here - guybedford/es-module-shims#89.

By default the implementation is async to support an async resolver function. In future if this is ever made sync that will be an easier hence starting with an async hook makes the most sense. This also matches the implementation under --experimental-import-meta-resolve in Node.js.

@github-actions
Copy link

github-actions bot commented Aug 8, 2020

core

File by file impact

File Transform Diff master import-meta-resolve Event
dist/s.js none +149 21,553 21,702 changed
gzip +16 6,117 6,133
brotli +9 5,278 5,287
dist/s.min.js none +76 6,559 6,635 changed
gzip +14 2,638 2,652
brotli +19 2,359 2,378
dist/system-node.cjs none +141 200,985 201,126 changed
gzip +16 51,345 51,361
brotli +32 43,451 43,483
dist/system.js none +149 31,999 32,148 changed
gzip +18 8,631 8,649
brotli +8 7,479 7,487
dist/system.min.js none +76 10,584 10,660 changed
gzip +13 4,084 4,097
brotli +15 3,651 3,666
extras

File by file impact

Pull request have no impact on extras files.

Generated by github pull request filesize impact

Copy link
Collaborator

@joeldenning joeldenning left a comment

Choose a reason for hiding this comment

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

Looks good! Perhaps we should update the docs for this, too, to mention that it's available?

https://github.com/systemjs/systemjs/blob/master/docs/system-register.md#format-definition

@guybedford guybedford merged commit a0dd823 into master Aug 10, 2020
@guybedford guybedford deleted the import-meta-resolve branch August 10, 2020 18:56
@guybedford
Copy link
Member Author

guybedford commented Aug 10, 2020

Released in 6.5.0.

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.

None yet

2 participants