Siteimprove / alfa

:wheelchair: Suite of open and standards-based tools for performing reliable accessibility conformance testing at scale
MIT License
102 stars 11 forks source link

Update to ESM module and node module resolution #1636

Closed Jym77 closed 1 week ago

Jym77 commented 1 week ago

With Alfa now being distributed as ESM, consumers using it must also be ESM or use dynamic import() in async code.

Part of #1621

Also delete the deprecated alfa-media package.

Imports now need to include full name (including extension), and relative to where the generated file will be. This can get a bit puzzling at first (since src/foo.ts must import * from "./bar.js" even though bar.js does not exist, and will ultimately live at dist/bar.js which is indeed . relative to where foo.ts will be built…) This is due to TS not touching import strings at all. They seem to have good reason for this (due to how some bundlers work)… IDE should be able to help when creating the imports, though…

changeset-bot[bot] commented 1 week ago

🦋 Changeset detected

Latest commit: 4ae13e0bf1e32d72acee1595d9f3320afaad7666

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR