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

feature/issue 1268 import map and attribute polyfill configuration #1269

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Aug 24, 2024

Related Issue

resolves #1268

Summary of Changes

  1. Add opt-in polyfill configuration for import maps (and set to off by default)
  2. Add opt-in polyfill configuration for import attributes (and set to off by default)
  3. Document new polyfill configurations
  4. Minor cleanup

Screenshot 2024-08-24 at 1 24 27 PM
Screenshot 2024-08-24 at 1 24 42 PM

TODO

  1. what about special content type handling needed for serve now, will this work on netlify / vercel???
    • tap into query params?
    • oh, should just not externalize these instead (this was just the "old way" right?)
  2. testing
    • polyfill configuration options
    • import maps (develop + serve test cases)
    • import attributes (develop + serve test cases)
  3. add acorn-import-attributes as a dependency
  4. why were we hardcoding text/css in rollup.config.js, think we can remove make this dynamic to the type
  5. clean up uses of Sec-Fetch-Dest since I don't think it actually does anything
  6. Documentation
    • config option
    • Call out browser support
  7. Test against impacted upstream projects (website, analog studios)
  8. clean up demo code / greenwood.config.js

Follow Up Issues

  1. Since imports maps are now in Safari >= 16.4, let's close move import maps shim to polyfills plugin #1114 and instead make an issue moving this behavior to the polyfills plugin
  2. discussion on dropping support for import attributes polyfill / status tracking (and back-link within docs) - Browser support for CSS / JSON Module scripts (including Import Attributes) #1275
  3. comment about these developments in Isomorphic (Reflected) Import Attributes Support #1216
  4. Support bundling a <link> tag within a shadow root? - `<link>` tags in Shadow DOM #1276

@@ -28,6 +31,40 @@ class StandardJavaScriptResource extends ResourceInterface {
}
});
}

async shouldPreIntercept(url) {
return url.protocol === 'file:' && this.extensions.includes(url.pathname.split('.').pop());

This comment was marked as resolved.

@thescientist13 thescientist13 force-pushed the feature/issue-1268-import-map-and-attribute-polyfill-configuration branch from d28920a to 5516b76 Compare September 4, 2024 13:24
@thescientist13 thescientist13 merged commit 16c2a99 into release/0.30.0 Sep 5, 2024
7 of 8 checks passed
@thescientist13 thescientist13 deleted the feature/issue-1268-import-map-and-attribute-polyfill-configuration branch September 5, 2024 17:37
thescientist13 added a commit that referenced this pull request Nov 2, 2024
…1269)

* import map polyfill config flag

* import attributes polyfill config option

* import attributes demo

* develop test cases for import maps and attributes for development

* import attributes polyfill config serve test cases

* polyfills configuration error test cases

* bundle polyfilled import attributes for the browser

* polyfills configuration docs and import attributes call outs

* misc refactoring

* add acorn-import-attributes as a CLI dependency

* refine pre-intercepting logic to include all JS resource types

* remove demo code

* more robust bundling and serve test case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking CLI documentation Greenwood specific docs feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

polyfill configurations for import maps and attributes
1 participant