-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Polyfill enabling #172
Polyfill enabling #172
Conversation
d4bf840
to
2bea74b
Compare
@guybedford would it be possible/make sense to add "dynamic-import-maps" as a "polyfillEnable" option as well since it is in the spec even though implemented in browsers? <script>
window.esmsInitOptions = { polyfillEnable: ['dynamic-import-maps'] }
</script>
<script src="web_modules/import-map.json" type="importmap"></script>
<script async src="web_modules/es-module-shims.js" type="module"></script>
<script type="module">
import myModule from "bare-specifier-from-autogenerated-import-map";
</script> |
@dmnsgn |
Thanks, makes sense! I hoped there was more interest for it but I have struggled finding the native issues (no mention on chromestatus.com or https://webkit.org/status) so not sure where to push 😅 |
The spec issue is here -
WICG/import-maps#235
…On Sat, Apr 2, 2022 at 17:45 Damien Seguin ***@***.***> wrote:
Thanks, makes sense! I hoped there was more interest for it but I have
struggled finding the native issues (no mention on chromestatus.com
<https://chromestatus.com/features> or https://webkit.org/status) so not
sure where to push 😅
—
Reply to this email directly, view it on GitHub
<#172 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAESFSVFPN2KNFTVBDOFG53VDBTRDANCNFSM5DRFXZDQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I wasn't quite happy with the
skip-shim
concept in #171 - it creates too much unnecessary overhead for users.Instead the approach taken in this PR is to disable CSS modules and JSON modules automatic polyfilling, and instead require those to be explicitly opted-in to. To avoid compatibility issues we then throw whenever these are loaded in unsupported browsers to avoid the spotty compat issues that would make compat testing harder.
This way we maintain the baseline native import maps target without degradation and users who want newer features can explicitly indicate that.
Next year, we can switch these on for the baseline by default, and in this way gradually adjust the target via the release schedule of the project itself to ensure optimal native performance for users.
The option is:
to use these newer features in polyfill mode, which I think is much clearer for users from an intuition and intent perspective as well.