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

expose addImportMap #2429

Merged
merged 3 commits into from Sep 27, 2022
Merged

expose addImportMap #2429

merged 3 commits into from Sep 27, 2022

Conversation

wenerme
Copy link
Collaborator

@wenerme wenerme commented Sep 23, 2022

fix #2428

@github-actions
Copy link

github-actions bot commented Sep 23, 2022


Error: Error while trying to generate a snapshot for applyImportMap merge into main.

Error: Command failed: git fetch --no-tags --prune origin refs/pull/2429/merge
fatal: couldn't find remote ref refs/pull/2429/merge

    at ChildProcess.exithandler (node:child_process:400:12)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1093:16)
    at Socket. (node:internal/child_process:451:11)
    at Socket.emit (node:events:513:28)
    at Pipe. (node:net:757:14)

Generated by file size impact during size-impact#3136268560

@wenerme
Copy link
Collaborator Author

wenerme commented Sep 23, 2022

I don't get the test error, can't find any error messages, running in local seems fine.

@guybedford
Copy link
Member

The tests seem to be failing here, can you look into it?

@wenerme
Copy link
Collaborator Author

wenerme commented Sep 25, 2022

@guybedford Sorry, but I have no idea why test failed, it's like firefox failed or something, can you have a look ?

@guybedford
Copy link
Member

@wenerme for local testing, run chomp test:browser. In the Firefox window I'm seeing this error:

image

@wenerme
Copy link
Collaborator Author

wenerme commented Sep 27, 2022

Running browser test in macos

CI_BROWSER=/Applications/Firefox.app/Contents/MacOS/firefox chomp test

Copy link
Member

@guybedford guybedford left a comment

Choose a reason for hiding this comment

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

This is looking good, we just need to add some documentation on the method as well to the SystemJS API documentation.

Also, in terms of the API name, how about addImportMap instead of applyImportMap? That would also match the corresponding methods in the ES module shims project (https://github.com/guybedford/es-module-shims#reading-current-import-map-state)

@wenerme wenerme changed the title expose applyImportMap expose addImportMap Sep 27, 2022
@wenerme
Copy link
Collaborator Author

wenerme commented Sep 27, 2022

add more precisely, renamed to addImportMap, add some doc about addImportMap

Copy link
Member

@guybedford guybedford left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for working on this.

Note in es module shims we explicitly avoid overrides when doing this per https://github.com/guybedford/es-module-shims#overriding-import-map-entries, with overrides explicily enabled via configuration. Worth noting but perhaps SystemJS doesn't need this as much.

docs/import-maps.md Outdated Show resolved Hide resolved
docs/api.md Outdated Show resolved Hide resolved
docs/import-maps.md Outdated Show resolved Hide resolved
docs/import-maps.md Outdated Show resolved Hide resolved
@guybedford guybedford merged commit 1e41039 into systemjs:main Sep 27, 2022
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.

expose applyImportMap for system.js
2 participants