es-module-shims 2.4.1 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -4,11 +4,37 @@ interface ESMSInitOptions {
4
4
  */
5
5
  shimMode?: boolean;
6
6
 
7
+ /**
8
+ * Enable hot reloading
9
+ */
10
+ hotReload?: boolean;
11
+
12
+ /**
13
+ * Set the hot reload refresh interval in ms
14
+ */
15
+ hotReloadInterval?: number;
16
+
7
17
  /**
8
18
  * Enable polyfill features.
9
- * Currently supports ['css-modules', 'json-modules', 'wasm-modules', 'source-phase']
19
+ *
20
+ * Currently supports:
21
+ * - 'wasm-modules': Both 'wasm-module-sources' and 'wasm-module-instances'
22
+ * - 'wasm-module-sources': Support for Wasm source phase imports (import source mod from './mod.wasm')
23
+ * - 'wasm-module-instances': Support for Wasm instance phase imports (import * as mod from './mod.wasm')
24
+ * - 'import-defer': Support for import defer syntax (import defer * as ns from './foo.js')
25
+ */
26
+ polyfillEnable?: Array<'wasm-modules' | 'wasm-module-instances' | 'wasm-module-sources' | 'import-defer'>;
27
+
28
+ /**
29
+ * Version
30
+ *
31
+ * Useful when there are multiple instances of ES Module Shims for whatever reason
32
+ * interacting in an application.
33
+ *
34
+ * When set, ES Module Shims will early exit if its own version is not the expected version.
35
+ * Note that this feature is only supported from version 2.4.0 upwards.
10
36
  */
11
- polyfillEnable?: Array<'css-modules' | 'json-modules' | 'wasm-modules' | 'source-phase'>
37
+ version?: string;
12
38
 
13
39
  /**
14
40
  * #### Enforce Integrity
@@ -210,6 +236,8 @@ declare namespace importShim {
210
236
  const resolve: (id: string, parentURL?: string) => string;
211
237
  const addImportMap: (importMap: Partial<ImportMap>) => void;
212
238
  const getImportMap: () => ImportMap;
239
+ const hotReload: ((url: string) => boolean) | undefined;
240
+ const version: string;
213
241
  }
214
242
 
215
243
  interface Window {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-module-shims",
3
- "version": "2.4.1",
3
+ "version": "2.5.1",
4
4
  "description": "Shims for the latest ES module features",
5
5
  "main": "dist/es-module-shims.js",
6
6
  "exports": {
@@ -31,7 +31,7 @@
31
31
  "license": "MIT",
32
32
  "devDependencies": {
33
33
  "@rollup/plugin-replace": "^2.4.2",
34
- "amaro": "0.5.2",
34
+ "amaro": "0.5.3",
35
35
  "es-module-lexer": "1.7.0",
36
36
  "kleur": "^4.1.4",
37
37
  "mime-types": "^2.1.33",