@module-federation/data-prefetch 0.6.16 → 0.7.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @module-federation/data-prefetch
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 206b56d: disable hoistTransitiveImports for better tree shake
8
+ - Updated dependencies [752537b]
9
+ - Updated dependencies [54bfd1c]
10
+ - Updated dependencies [879ad87]
11
+ - Updated dependencies [4eb09e7]
12
+ - Updated dependencies [206b56d]
13
+ - @module-federation/runtime@0.7.0
14
+ - @module-federation/sdk@0.7.0
15
+
3
16
  ## 0.6.16
4
17
 
5
18
  ### Patch Changes
package/dist/cli.cjs.js CHANGED
@@ -52,7 +52,7 @@ class PrefetchPlugin {
52
52
  if (!Array.isArray(runtimePlugins)) {
53
53
  this.options.runtimePlugins = [];
54
54
  }
55
- const runtimePath = path.resolve(__dirname, './plugin.esm.js');
55
+ const runtimePath = path.resolve(__dirname, './plugin.esm.mjs');
56
56
  if (!((_this_options_runtimePlugins = this.options.runtimePlugins) == null ? void 0 : _this_options_runtimePlugins.includes(runtimePath))) {
57
57
  this.options.runtimePlugins.push(runtimePath);
58
58
  }
@@ -2,8 +2,8 @@ import path from 'path';
2
2
  import fs from 'fs-extra';
3
3
  import { encodeName, MFPrefetchCommon } from '@module-federation/sdk';
4
4
  import { normalizeWebpackPath } from '@module-federation/sdk/normalize-webpack-path';
5
- import { b as getPrefetchId } from './runtime-utils.esm.js';
6
- import { S as SHARED_STRATEGY } from './constant.esm.js';
5
+ import { b as getPrefetchId } from './runtime-utils.esm.mjs';
6
+ import { S as SHARED_STRATEGY } from './constant.esm.mjs';
7
7
 
8
8
  const TEMP_DIR = '.mf';
9
9
 
@@ -50,7 +50,7 @@ class PrefetchPlugin {
50
50
  if (!Array.isArray(runtimePlugins)) {
51
51
  this.options.runtimePlugins = [];
52
52
  }
53
- const runtimePath = path.resolve(__dirname, './plugin.esm.js');
53
+ const runtimePath = path.resolve(__dirname, './plugin.esm.mjs');
54
54
  if (!((_this_options_runtimePlugins = this.options.runtimePlugins) == null ? void 0 : _this_options_runtimePlugins.includes(runtimePath))) {
55
55
  this.options.runtimePlugins.push(runtimePath);
56
56
  }
@@ -0,0 +1,2 @@
1
+ export { M as MFDataPrefetch } from './prefetch.esm.mjs';
2
+ export { prefetchPlugin } from './plugin.esm.mjs';
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@module-federation/data-prefetch",
3
3
  "description": "Module Federation Data Prefetch",
4
- "version": "0.6.16",
4
+ "version": "0.7.0",
5
5
  "author": "nieyan <nyqykk@foxmail.com>",
6
6
  "homepage": "https://github.com/module-federation/core",
7
7
  "license": "MIT",
@@ -13,27 +13,27 @@
13
13
  },
14
14
  "exports": {
15
15
  ".": {
16
- "import": "./dist/index.esm.js",
16
+ "import": "./dist/index.esm.mjs",
17
17
  "require": "./dist/index.cjs",
18
18
  "types": "./dist/index.cjs.d.ts"
19
19
  },
20
20
  "./react": {
21
- "import": "./dist/react.esm.js",
21
+ "import": "./dist/react.esm.mjs",
22
22
  "require": "./dist/react.cjs.js",
23
23
  "types": "./dist/react.cjs.d.ts"
24
24
  },
25
25
  "./cli": {
26
- "import": "./dist/cli.esm.js",
26
+ "import": "./dist/cli.esm.mjs",
27
27
  "require": "./dist/cli.cjs.js",
28
28
  "types": "./dist/cli.cjs.d.ts"
29
29
  },
30
30
  "./babel-plugin": {
31
- "import": "./dist/babel.esm.js",
31
+ "import": "./dist/babel.esm.mjs",
32
32
  "require": "./dist/babel.cjs.js",
33
33
  "types": "./dist/babel.cjs.d.ts"
34
34
  },
35
35
  "./universal": {
36
- "import": "./dist/universal.esm.js",
36
+ "import": "./dist/universal.esm.mjs",
37
37
  "require": "./dist/universal.cjs.js",
38
38
  "types": "./dist/universal.cjs.d.ts"
39
39
  }
@@ -1,8 +1,8 @@
1
1
  import { getResourceUrl } from '@module-federation/sdk';
2
- import { a as getSignalFromManifest } from './runtime-utils.esm.js';
3
- import { M as MFDataPrefetch } from './prefetch.esm.js';
4
- import { l as logger } from './index.esm2.js';
5
- import { S as SHARED_STRATEGY } from './constant.esm.js';
2
+ import { a as getSignalFromManifest } from './runtime-utils.esm.mjs';
3
+ import { M as MFDataPrefetch } from './prefetch.esm.mjs';
4
+ import { l as logger } from './index.esm2.mjs';
5
+ import { S as SHARED_STRATEGY } from './constant.esm.mjs';
6
6
 
7
7
  const loadingArray = [];
8
8
  let sharedFlag = SHARED_STRATEGY;
@@ -1,6 +1,6 @@
1
1
  import { getRemoteInfo, getRemoteEntry } from '@module-federation/runtime';
2
2
  import { loadScript } from '@module-federation/sdk';
3
- import { b as getPrefetchId, c as compatGetPrefetchId } from './runtime-utils.esm.js';
3
+ import { b as getPrefetchId, c as compatGetPrefetchId } from './runtime-utils.esm.mjs';
4
4
 
5
5
  var // @ts-ignore init global variable for test
6
6
  _globalThis, _globalThis___FEDERATION__;
@@ -1,9 +1,9 @@
1
- import { _ as _extends } from './polyfills.esm.js';
1
+ import { _ as _extends } from './polyfills.esm.mjs';
2
2
  import { useRef, useEffect, useState } from 'react';
3
- import { l as logger } from './index.esm2.js';
4
- import { M as MFDataPrefetch } from './prefetch.esm.js';
5
- import { prefetch } from './universal.esm.js';
6
- import { g as getScope } from './runtime-utils.esm.js';
3
+ import { l as logger } from './index.esm2.mjs';
4
+ import { M as MFDataPrefetch } from './prefetch.esm.mjs';
5
+ import { prefetch } from './universal.esm.mjs';
6
+ import { g as getScope } from './runtime-utils.esm.mjs';
7
7
 
8
8
  const useFirstMounted = ()=>{
9
9
  const ref = useRef(true);
@@ -1,5 +1,5 @@
1
- import { M as MFDataPrefetch } from './prefetch.esm.js';
2
- import { g as getScope } from './runtime-utils.esm.js';
1
+ import { M as MFDataPrefetch } from './prefetch.esm.mjs';
2
+ import { g as getScope } from './runtime-utils.esm.mjs';
3
3
 
4
4
  function prefetch(options) {
5
5
  const { id, functionId = 'default' } = options;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@module-federation/data-prefetch",
3
3
  "description": "Module Federation Data Prefetch",
4
- "version": "0.6.16",
4
+ "version": "0.7.0",
5
5
  "author": "nieyan <nyqykk@foxmail.com>",
6
6
  "homepage": "https://github.com/module-federation/core",
7
7
  "license": "MIT",
@@ -10,27 +10,27 @@
10
10
  },
11
11
  "exports": {
12
12
  ".": {
13
- "import": "./dist/index.esm.js",
13
+ "import": "./dist/index.esm.mjs",
14
14
  "require": "./dist/index.cjs",
15
15
  "types": "./dist/index.cjs.d.ts"
16
16
  },
17
17
  "./react": {
18
- "import": "./dist/react.esm.js",
18
+ "import": "./dist/react.esm.mjs",
19
19
  "require": "./dist/react.cjs.js",
20
20
  "types": "./dist/react.cjs.d.ts"
21
21
  },
22
22
  "./cli": {
23
- "import": "./dist/cli.esm.js",
23
+ "import": "./dist/cli.esm.mjs",
24
24
  "require": "./dist/cli.cjs.js",
25
25
  "types": "./dist/cli.cjs.d.ts"
26
26
  },
27
27
  "./babel-plugin": {
28
- "import": "./dist/babel.esm.js",
28
+ "import": "./dist/babel.esm.mjs",
29
29
  "require": "./dist/babel.cjs.js",
30
30
  "types": "./dist/babel.cjs.d.ts"
31
31
  },
32
32
  "./universal": {
33
- "import": "./dist/universal.esm.js",
33
+ "import": "./dist/universal.esm.mjs",
34
34
  "require": "./dist/universal.cjs.js",
35
35
  "types": "./dist/universal.cjs.d.ts"
36
36
  }
@@ -55,7 +55,7 @@
55
55
  }
56
56
  },
57
57
  "main": "dist/index.cjs",
58
- "module": "dist/index.esm.js",
58
+ "module": "dist/index.esm.mjs",
59
59
  "peerDependencies": {
60
60
  "react": ">=16.9.0",
61
61
  "react-dom": ">=16.9.0"
@@ -78,8 +78,8 @@
78
78
  },
79
79
  "dependencies": {
80
80
  "fs-extra": "9.1.0",
81
- "@module-federation/runtime": "0.6.16",
82
- "@module-federation/sdk": "0.6.16"
81
+ "@module-federation/runtime": "0.7.0",
82
+ "@module-federation/sdk": "0.7.0"
83
83
  },
84
84
  "scripts": {
85
85
  "test": "jest"
package/rollup.config.js CHANGED
@@ -29,6 +29,14 @@ module.exports = (rollupConfig, _projectOptions) => {
29
29
  }
30
30
  },
31
31
  hoistTransitiveImports: false,
32
+ entryFileNames:
33
+ c.format === 'esm'
34
+ ? c.entryFileNames.replace('.js', '.mjs')
35
+ : c.entryFileNames,
36
+ chunkFileNames:
37
+ c.format === 'esm'
38
+ ? c.chunkFileNames.replace('.js', '.mjs')
39
+ : c.chunkFileNames,
32
40
  }));
33
41
  } else {
34
42
  rollupConfig.output = {
@@ -39,6 +47,14 @@ module.exports = (rollupConfig, _projectOptions) => {
39
47
  }
40
48
  },
41
49
  hoistTransitiveImports: false,
50
+ entryFileNames:
51
+ rollupConfig.output.format === 'esm'
52
+ ? rollupConfig.output.entryFileNames.replace('.js', '.mjs')
53
+ : rollupConfig.output.entryFileNames,
54
+ chunkFileNames:
55
+ rollupConfig.output.format === 'esm'
56
+ ? rollupConfig.output.chunkFileNames.replace('.js', '.mjs')
57
+ : rollupConfig.output.chunkFileNames,
42
58
  };
43
59
  }
44
60
 
package/src/cli/index.ts CHANGED
@@ -48,7 +48,7 @@ export class PrefetchPlugin implements WebpackPluginInstance {
48
48
  this.options.runtimePlugins = [];
49
49
  }
50
50
 
51
- const runtimePath = path.resolve(__dirname, './plugin.esm.js');
51
+ const runtimePath = path.resolve(__dirname, './plugin.esm.mjs');
52
52
  if (!this.options.runtimePlugins?.includes(runtimePath)) {
53
53
  this.options.runtimePlugins!.push(runtimePath);
54
54
  }
package/dist/index.esm.js DELETED
@@ -1,2 +0,0 @@
1
- export { M as MFDataPrefetch } from './prefetch.esm.js';
2
- export { prefetchPlugin } from './plugin.esm.js';
File without changes
File without changes
File without changes
File without changes