@module-federation/data-prefetch 0.6.15 → 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,28 @@
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
+
16
+ ## 0.6.16
17
+
18
+ ### Patch Changes
19
+
20
+ - 024df60: disable hoistTransitiveImports for better tree shake
21
+ - Updated dependencies [f779188]
22
+ - Updated dependencies [024df60]
23
+ - @module-federation/sdk@0.6.16
24
+ - @module-federation/runtime@0.6.16
25
+
3
26
  ## 0.6.15
4
27
 
5
28
  ### Patch Changes
package/dist/cli.cjs.js CHANGED
@@ -6,7 +6,6 @@ var sdk = require('@module-federation/sdk');
6
6
  var normalizeWebpackPath = require('@module-federation/sdk/normalize-webpack-path');
7
7
  var runtimeUtils = require('./runtime-utils.cjs.js');
8
8
  var constant = require('./constant.cjs.js');
9
- require('@module-federation/runtime');
10
9
 
11
10
  const TEMP_DIR = '.mf';
12
11
 
@@ -53,7 +52,7 @@ class PrefetchPlugin {
53
52
  if (!Array.isArray(runtimePlugins)) {
54
53
  this.options.runtimePlugins = [];
55
54
  }
56
- const runtimePath = path.resolve(__dirname, './plugin.esm.js');
55
+ const runtimePath = path.resolve(__dirname, './plugin.esm.mjs');
57
56
  if (!((_this_options_runtimePlugins = this.options.runtimePlugins) == null ? void 0 : _this_options_runtimePlugins.includes(runtimePath))) {
58
57
  this.options.runtimePlugins.push(runtimePath);
59
58
  }
@@ -2,9 +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';
7
- import '@module-federation/runtime';
5
+ import { b as getPrefetchId } from './runtime-utils.esm.mjs';
6
+ import { S as SHARED_STRATEGY } from './constant.esm.mjs';
8
7
 
9
8
  const TEMP_DIR = '.mf';
10
9
 
@@ -51,7 +50,7 @@ class PrefetchPlugin {
51
50
  if (!Array.isArray(runtimePlugins)) {
52
51
  this.options.runtimePlugins = [];
53
52
  }
54
- const runtimePath = path.resolve(__dirname, './plugin.esm.js');
53
+ const runtimePath = path.resolve(__dirname, './plugin.esm.mjs');
55
54
  if (!((_this_options_runtimePlugins = this.options.runtimePlugins) == null ? void 0 : _this_options_runtimePlugins.includes(runtimePath))) {
56
55
  this.options.runtimePlugins.push(runtimePath);
57
56
  }
package/dist/index.cjs.js CHANGED
@@ -2,11 +2,6 @@
2
2
 
3
3
  var prefetch = require('./prefetch.cjs.js');
4
4
  var plugin = require('./plugin.cjs.js');
5
- require('@module-federation/runtime');
6
- require('@module-federation/sdk');
7
- require('./runtime-utils.cjs.js');
8
- require('./index.cjs2.js');
9
- require('./constant.cjs.js');
10
5
 
11
6
 
12
7
 
@@ -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.15",
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
  }
@@ -7,7 +7,6 @@ var runtimeUtils = require('./runtime-utils.cjs.js');
7
7
  var prefetch = require('./prefetch.cjs.js');
8
8
  var index = require('./index.cjs2.js');
9
9
  var constant = require('./constant.cjs.js');
10
- require('@module-federation/runtime');
11
10
 
12
11
  const loadingArray = [];
13
12
  let sharedFlag = constant.SHARED_STRATEGY;
@@ -1,9 +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';
6
- import '@module-federation/runtime';
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';
7
6
 
8
7
  const loadingArray = [];
9
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__;
package/dist/react.cjs.js CHANGED
@@ -6,8 +6,6 @@ var index = require('./index.cjs2.js');
6
6
  var prefetch = require('./prefetch.cjs.js');
7
7
  var universal = require('./universal.cjs.js');
8
8
  var runtimeUtils = require('./runtime-utils.cjs.js');
9
- require('@module-federation/sdk');
10
- require('@module-federation/runtime');
11
9
 
12
10
  const useFirstMounted = ()=>{
13
11
  const ref = react.useRef(true);
@@ -1,11 +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';
7
- import '@module-federation/sdk';
8
- import '@module-federation/runtime';
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';
9
7
 
10
8
  const useFirstMounted = ()=>{
11
9
  const ref = useRef(true);
@@ -2,8 +2,6 @@
2
2
 
3
3
  var prefetch$1 = require('./prefetch.cjs.js');
4
4
  var runtimeUtils = require('./runtime-utils.cjs.js');
5
- require('@module-federation/runtime');
6
- require('@module-federation/sdk');
7
5
 
8
6
  function prefetch(options) {
9
7
  const { id, functionId = 'default' } = options;
@@ -1,7 +1,5 @@
1
- import { M as MFDataPrefetch } from './prefetch.esm.js';
2
- import { g as getScope } from './runtime-utils.esm.js';
3
- import '@module-federation/runtime';
4
- import '@module-federation/sdk';
1
+ import { M as MFDataPrefetch } from './prefetch.esm.mjs';
2
+ import { g as getScope } from './runtime-utils.esm.mjs';
5
3
 
6
4
  function prefetch(options) {
7
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.15",
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.15",
82
- "@module-federation/sdk": "0.6.15"
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
@@ -28,6 +28,15 @@ module.exports = (rollupConfig, _projectOptions) => {
28
28
  return 'polyfills';
29
29
  }
30
30
  },
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,
31
40
  }));
32
41
  } else {
33
42
  rollupConfig.output = {
@@ -37,6 +46,15 @@ module.exports = (rollupConfig, _projectOptions) => {
37
46
  return 'polyfills';
38
47
  }
39
48
  },
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,
40
58
  };
41
59
  }
42
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,7 +0,0 @@
1
- export { M as MFDataPrefetch } from './prefetch.esm.js';
2
- export { prefetchPlugin } from './plugin.esm.js';
3
- import '@module-federation/runtime';
4
- import '@module-federation/sdk';
5
- import './runtime-utils.esm.js';
6
- import './index.esm2.js';
7
- import './constant.esm.js';
File without changes
File without changes
File without changes
File without changes