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

feat: still polyfill when early module loads stop import maps #201

Merged
merged 4 commits into from
Sep 28, 2021

Conversation

guybedford
Copy link
Owner

This is a way of working around the issue in WICG/import-maps#248.

Instead of simply having the application not work in polyfill mode when there is eg a browser extension on the page injecting a module script before the import map, this will do a detection to see if there are any module scripts before the import maps, and if so kick into the polyfill mode automatically.

In addition this adds a new hook option onpolyfill that can be used to check when the polyfill is engaging. When passed via the JSON <script type="esms-options">{ ... }</script> the string value is taken to be the global function name of the hook to call.

@guybedford guybedford merged commit 59c072d into main Sep 28, 2021
@guybedford guybedford deleted the early-module-load branch September 28, 2021 14:59
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.

1 participant