@module-federation/data-prefetch 0.0.0-next-20241205085800 → 0.0.0-next-20241212065455

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,12 +1,13 @@
1
1
  # @module-federation/data-prefetch
2
2
 
3
- ## 0.0.0-next-20241205085800
3
+ ## 0.0.0-next-20241212065455
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - Updated dependencies [330b36c]
8
- - @module-federation/runtime@0.0.0-next-20241205085800
9
- - @module-federation/sdk@0.0.0-next-20241205085800
7
+ - 1c820f7: fix(data-prefetch): the prefetch exports type is promise or function
8
+ - Updated dependencies [fa7a0bd]
9
+ - @module-federation/runtime@0.0.0-next-20241212065455
10
+ - @module-federation/sdk@0.0.0-next-20241212065455
10
11
 
11
12
  ## 0.8.1
12
13
 
@@ -47,7 +47,7 @@ class MFDataPrefetch {
47
47
  }
48
48
  const { name } = this._options;
49
49
  const exportsPromiseFn = (_globalThis___FEDERATION_____PREFETCH_____PREFETCH_EXPORTS__ = globalThis.__FEDERATION__.__PREFETCH__.__PREFETCH_EXPORTS__) == null ? void 0 : _globalThis___FEDERATION_____PREFETCH_____PREFETCH_EXPORTS__[name];
50
- const exportsPromise = typeof exportsPromiseFn === 'function' ? exportsPromiseFn() : Promise.resolve({});
50
+ const exportsPromise = typeof exportsPromiseFn === 'function' ? exportsPromiseFn() : exportsPromiseFn;
51
51
  const resolve = exportsPromise.then((exports = {})=>{
52
52
  // Match prefetch based on the function name suffix so that other capabilities can be expanded later.
53
53
  // Not all functions should be directly identified as prefetch functions
@@ -45,7 +45,7 @@ class MFDataPrefetch {
45
45
  }
46
46
  const { name } = this._options;
47
47
  const exportsPromiseFn = (_globalThis___FEDERATION_____PREFETCH_____PREFETCH_EXPORTS__ = globalThis.__FEDERATION__.__PREFETCH__.__PREFETCH_EXPORTS__) == null ? void 0 : _globalThis___FEDERATION_____PREFETCH_____PREFETCH_EXPORTS__[name];
48
- const exportsPromise = typeof exportsPromiseFn === 'function' ? exportsPromiseFn() : Promise.resolve({});
48
+ const exportsPromise = typeof exportsPromiseFn === 'function' ? exportsPromiseFn() : exportsPromiseFn;
49
49
  const resolve = exportsPromise.then((exports = {})=>{
50
50
  // Match prefetch based on the function name suffix so that other capabilities can be expanded later.
51
51
  // Not all functions should be directly identified as prefetch functions
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.0.0-next-20241205085800",
4
+ "version": "0.0.0-next-20241212065455",
5
5
  "author": "nieyan <nyqykk@foxmail.com>",
6
6
  "homepage": "https://github.com/module-federation/core",
7
7
  "license": "MIT",
@@ -78,8 +78,8 @@
78
78
  },
79
79
  "dependencies": {
80
80
  "fs-extra": "9.1.0",
81
- "@module-federation/runtime": "0.0.0-next-20241205085800",
82
- "@module-federation/sdk": "0.0.0-next-20241205085800"
81
+ "@module-federation/runtime": "0.0.0-next-20241212065455",
82
+ "@module-federation/sdk": "0.0.0-next-20241212065455"
83
83
  },
84
84
  "scripts": {
85
85
  "test": "jest"
package/src/prefetch.ts CHANGED
@@ -99,7 +99,7 @@ export class MFDataPrefetch {
99
99
  const exportsPromise =
100
100
  typeof exportsPromiseFn === 'function'
101
101
  ? exportsPromiseFn()
102
- : Promise.resolve({});
102
+ : exportsPromiseFn;
103
103
  const resolve = exportsPromise.then(
104
104
  (exports: Record<string, Record<string, any>> = {}) => {
105
105
  // Match prefetch based on the function name suffix so that other capabilities can be expanded later.