component-interop

Component Interop

npm

The goal is interoperable web-components which can share resources even if they come from different component libraries by different authors.

This zero-dependency, tiny (17kb) library is component-agnostic - any web component can use it.

Component Interop

Check out the demo!

Visit the documentation!

Tests

npm test             # node unit suite (jsdom + vm) + JSON-LD manifest validation
npm run test:browsers   # real-browser regression test in Chromium, Firefox & WebKit (needs Playwright)
npm run test:jsonld     # JSON-LD only: expand + toRDF every manifest in safe mode

The browser test guards the import-map timing: ci must inject its importmap synchronously, before any module load, or the browser rejects it. Of the three engines only Firefox is strict enough to fail on a regression (Chromium and WebKit are lenient), so it’s the tripwire — but all three run to prove the loader works everywhere. It needs Playwright + its browser binaries (a dev-only dependency — the library itself stays zero-dependency):

npm i -D playwright && npx playwright install

If Playwright isn’t installed, the tests skip rather than fail.

Transparency

Portions created using Claude Opus 4.8.

License

MIT © Jeff Zucker, 2026