Skip to content

Commit

Permalink
Add a section on community polyfills and tooling
Browse files Browse the repository at this point in the history
Closes #60. Closes #108. We'll discuss in #146 instead!

Co-Authored-By: Guy Bedford <[email protected]>
  • Loading branch information
domenic and guybedford authored Jul 3, 2019
1 parent 080c4a1 commit 8adb739
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ _Or, how to control the behavior of JavaScript imports_
- [Further implementation staging](#further-implementation-staging)
- [`import:` URL loads and origins](#import-url-loads-and-origins)
- [`import:` URL interaction with other loading infrastructure](#import-url-interaction-with-other-loading-infrastructure)
- [Community polyfills and tooling](#community-polyfills-and-tooling)
- [Acknowledgments](#acknowledgments)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -873,6 +874,20 @@ Several implementer questions come up around how `import:` URLs are envisioned t

The high-level summary is that any fetch of an `import:` URL should be thought of as sugar for a series of if-then-else statements that in turn fetch the mapped-to URLs. For example, each fetch will pass through the service worker, until one succeeds.

## Community polyfills and tooling

Several members of the community have been working on polyfills and tooling related to import maps. Here are the ones we know about:

* [@import-maps/generate](https://www.npmjs.com/package/@import-maps/generate) generates an import map from your `yarn.lock`.
* [@jsenv/node-module-import-map](https://www.npmjs.com/package/@jsenv/node-module-import-map) generates an import map from your `package.json` and `node_modules/` directories.
* [importly](https://www.npmjs.com/package/importly) generates an import map from a config file.
* [Built-in Module Demo (with Rollup)](https://glitch.com/edit/#!/rollup-built-in-modules) contains code for a [Rollup](https://rollupjs.org/) plugin that generates an import map, focused on built-in module polyfills.
* [SystemJS](https://github.com/systemjs/systemjs) provides a polyfill-like workflow for using import maps in older browsers with the System module format and `<script type="system-importmap">`.
* [es-module-shims](https://github.com/guybedford/es-module-shims) provides an import maps polyfill for browsers with basic ES modules support.
* [Deno](https://github.com/denoland/deno) is a JavaScript/TypeScript runtime with [built-in support for import maps](https://deno.land/manual.html#importmaps).

Feel free to send a pull request with more! Also, you can use [#146](https://github.com/WICG/import-maps/issues/146) in the issue tracker for discussion about this space.

## Acknowledgments

This document originated out of a day-long sprint involving [@domenic](https://github.com/domenic), [@hiroshige-g](https://github.com/hiroshige-g), [@justinfagnani](https://github.com/justinfagnani), [@MylesBorins](https://github.com/MylesBorins), and [@nyaxt](https://github.com/nyaxt). Since then, [@guybedford](https://github.com/guybedford) has been instrumental in prototyping and driving forward discussion on this proposal.
Expand Down

0 comments on commit 8adb739

Please sign in to comment.