tc39 / proposal-import-attributes

Proposal for syntax to import ES modules with assertions
https://tc39.es/proposal-import-attributes/
Apache License 2.0
569 stars 32 forks source link

how to use this feature in browser without polyfil? #148

Closed dante01yoon closed 6 months ago

dante01yoon commented 8 months ago

Greetings. I want to test this proposal in browser. Is there any way I can test this without polyfill?

nikelborm commented 8 months ago

Is there a polyfill??? I thought there is no way to change syntax with just polyfills. It should be some preprocessing step done with webpack or other bundlers

dante01yoon commented 8 months ago

Yeah I mean polyfill or any transforming like babel

nicolo-ribaudo commented 8 months ago

You can test it in Safari 17.2, or in Chrome with the --harmony-import-attributes flag.

juner commented 6 months ago

Chrome 123 (canary) allows you to use it without the flag!

https://chromestatus.com/feature/5205869105250304

ljharb commented 6 months ago

@dante01yoon you can't use this feature without native syntax support, unless you're using a bundler such that you're not actually using native ESM in a browser.