@module-federation/data-prefetch 2.0.0 → 2.0.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.
Files changed (103) hide show
  1. package/dist/babel.cjs +95 -0
  2. package/dist/babel.d.ts +1 -2
  3. package/dist/babel.js +5 -0
  4. package/dist/cli/babel.cjs +115 -0
  5. package/dist/cli/babel.js +52 -0
  6. package/dist/cli/index.cjs +217 -0
  7. package/dist/{cli.esm.js → cli/index.js} +78 -73
  8. package/dist/cli.cjs +95 -0
  9. package/dist/cli.d.ts +1 -1
  10. package/dist/cli.js +5 -0
  11. package/dist/common/constant.cjs +51 -0
  12. package/dist/common/constant.js +5 -0
  13. package/dist/common/index.cjs +95 -0
  14. package/dist/common/index.js +5 -0
  15. package/dist/common/node-utils.cjs +100 -0
  16. package/dist/common/node-utils.js +35 -0
  17. package/dist/common/runtime-utils.cjs +84 -0
  18. package/dist/common/runtime-utils.js +29 -0
  19. package/dist/constant.cjs +51 -0
  20. package/dist/constant.js +5 -0
  21. package/dist/index.cjs +106 -0
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.js +7 -0
  24. package/dist/logger/index.cjs +60 -0
  25. package/dist/logger/index.js +10 -0
  26. package/dist/plugin.cjs +234 -0
  27. package/dist/plugin.d.ts +3 -2
  28. package/dist/plugin.js +173 -0
  29. package/dist/prefetch.cjs +197 -0
  30. package/dist/prefetch.js +149 -0
  31. package/dist/react/hooks.cjs +144 -0
  32. package/dist/{react.esm.js → react/hooks.js} +42 -30
  33. package/dist/react/index.cjs +95 -0
  34. package/dist/react/index.js +5 -0
  35. package/dist/react/utils.cjs +65 -0
  36. package/dist/react/utils.js +15 -0
  37. package/dist/react.cjs +95 -0
  38. package/dist/react.d.ts +1 -1
  39. package/dist/react.js +5 -0
  40. package/dist/universal/index.cjs +81 -0
  41. package/dist/{universal.esm.js → universal/index.js} +14 -10
  42. package/dist/universal.cjs +95 -0
  43. package/dist/universal.d.ts +1 -1
  44. package/dist/universal.js +5 -0
  45. package/package.json +47 -21
  46. package/dist/babel.cjs.cjs +0 -54
  47. package/dist/babel.cjs.cjs.map +0 -1
  48. package/dist/babel.cjs.d.ts +0 -2
  49. package/dist/babel.esm.js +0 -52
  50. package/dist/babel.esm.js.map +0 -1
  51. package/dist/cli.cjs.cjs +0 -156
  52. package/dist/cli.cjs.cjs.map +0 -1
  53. package/dist/cli.cjs.d.ts +0 -1
  54. package/dist/cli.esm.js.map +0 -1
  55. package/dist/constant.cjs.cjs +0 -6
  56. package/dist/constant.cjs.cjs.map +0 -1
  57. package/dist/constant.esm.js +0 -4
  58. package/dist/constant.esm.js.map +0 -1
  59. package/dist/index.cjs.cjs +0 -10
  60. package/dist/index.cjs.cjs.map +0 -1
  61. package/dist/index.cjs.d.ts +0 -1
  62. package/dist/index.cjs2.cjs +0 -8
  63. package/dist/index.cjs2.cjs.map +0 -1
  64. package/dist/index.esm.js +0 -3
  65. package/dist/index.esm.js.map +0 -1
  66. package/dist/index.esm2.js +0 -6
  67. package/dist/index.esm2.js.map +0 -1
  68. package/dist/plugin.cjs.cjs +0 -158
  69. package/dist/plugin.cjs.cjs.map +0 -1
  70. package/dist/plugin.cjs.d.ts +0 -2
  71. package/dist/plugin.esm.js +0 -153
  72. package/dist/plugin.esm.js.map +0 -1
  73. package/dist/prefetch.cjs.cjs +0 -182
  74. package/dist/prefetch.cjs.cjs.map +0 -1
  75. package/dist/prefetch.esm.js +0 -179
  76. package/dist/prefetch.esm.js.map +0 -1
  77. package/dist/react.cjs.cjs +0 -76
  78. package/dist/react.cjs.cjs.map +0 -1
  79. package/dist/react.cjs.d.ts +0 -1
  80. package/dist/react.esm.js.map +0 -1
  81. package/dist/runtime-utils.cjs.cjs +0 -29
  82. package/dist/runtime-utils.cjs.cjs.map +0 -1
  83. package/dist/runtime-utils.esm.js +0 -24
  84. package/dist/runtime-utils.esm.js.map +0 -1
  85. package/dist/src/index.d.ts +0 -2
  86. package/dist/src/plugin.d.ts +0 -3
  87. package/dist/universal.cjs.cjs +0 -30
  88. package/dist/universal.cjs.cjs.map +0 -1
  89. package/dist/universal.cjs.d.ts +0 -1
  90. package/dist/universal.esm.js.map +0 -1
  91. /package/dist/{src/cli → cli}/babel.d.ts +0 -0
  92. /package/dist/{src/cli → cli}/index.d.ts +0 -0
  93. /package/dist/{src/common → common}/constant.d.ts +0 -0
  94. /package/dist/{src/common → common}/index.d.ts +0 -0
  95. /package/dist/{src/common → common}/node-utils.d.ts +0 -0
  96. /package/dist/{src/common → common}/runtime-utils.d.ts +0 -0
  97. /package/dist/{src/constant.d.ts → constant.d.ts} +0 -0
  98. /package/dist/{src/logger → logger}/index.d.ts +0 -0
  99. /package/dist/{src/prefetch.d.ts → prefetch.d.ts} +0 -0
  100. /package/dist/{src/react → react}/hooks.d.ts +0 -0
  101. /package/dist/{src/react → react}/index.d.ts +0 -0
  102. /package/dist/{src/react → react}/utils.d.ts +0 -0
  103. /package/dist/{src/universal → universal}/index.d.ts +0 -0
@@ -1,18 +1,30 @@
1
- import { useRef, useEffect, useState } from 'react';
2
- import { l as logger } from './index.esm2.js';
3
- import { M as MFDataPrefetch } from './prefetch.esm.js';
4
- import { prefetch } from './universal.esm.js';
5
- import { g as getScope } from './runtime-utils.esm.js';
1
+ import { useEffect, useState } from "react";
2
+ import logger from "../logger/index.js";
3
+ import { MFDataPrefetch } from "../prefetch.js";
4
+ import { prefetch } from "../universal.js";
5
+ import { getScope } from "../common/runtime-utils.js";
6
+ import { useFirstMounted } from "./utils.js";
7
+
8
+ ;// CONCATENATED MODULE: external "react"
9
+
10
+ ;// CONCATENATED MODULE: external "../logger/index.js"
11
+
12
+ ;// CONCATENATED MODULE: external "../prefetch.js"
13
+
14
+ ;// CONCATENATED MODULE: external "../universal.js"
15
+
16
+ ;// CONCATENATED MODULE: external "../common/runtime-utils.js"
17
+
18
+ ;// CONCATENATED MODULE: external "./utils.js"
19
+
20
+ ;// CONCATENATED MODULE: ./src/react/hooks.ts
6
21
 
7
- const useFirstMounted = () => {
8
- const ref = useRef(true);
9
- useEffect(() => {
10
- ref.current = false;
11
- }, []);
12
- return ref.current;
13
- };
14
22
 
15
- const usePrefetch = (options) => {
23
+
24
+
25
+
26
+
27
+ const usePrefetch = (options)=>{
16
28
  const isFirstMounted = useFirstMounted();
17
29
  if (isFirstMounted) {
18
30
  const startTiming = performance.now();
@@ -21,33 +33,33 @@ const usePrefetch = (options) => {
21
33
  const { id, functionId, deferId } = options;
22
34
  const prefetchInfo = {
23
35
  id,
24
- functionId,
36
+ functionId
25
37
  };
26
38
  const mfScope = getScope();
27
39
  let state;
28
40
  const prefetchResult = prefetch(options);
29
41
  if (deferId) {
30
42
  if (prefetchResult instanceof Promise) {
31
- state = prefetchResult.then((deferredData) => deferredData.data[deferId]);
32
- }
33
- else {
43
+ state = prefetchResult.then((deferredData)=>deferredData.data[deferId]);
44
+ } else {
34
45
  state = prefetchResult.data[deferId];
35
46
  }
36
- }
37
- else {
47
+ } else {
38
48
  state = prefetchResult;
39
49
  }
40
50
  const [prefetchState, setPrefetchState] = useState(state);
41
51
  const prefetchInstance = MFDataPrefetch.getInstance(mfScope);
42
- useEffect(() => {
52
+ useEffect(()=>{
43
53
  const useEffectTiming = performance.now();
44
54
  logger.info(`3. Start Execute UseEffect: ${options.id} - ${options.functionId || 'default'} - ${useEffectTiming}`);
45
- return () => {
55
+ return ()=>{
46
56
  prefetchInstance === null || prefetchInstance === void 0 ? void 0 : prefetchInstance.markOutdate(prefetchInfo, true);
47
57
  };
48
58
  }, []);
49
- const refreshExecutor = (refetchParams) => {
50
- const refetchOptions = Object.assign({}, options);
59
+ const refreshExecutor = (refetchParams)=>{
60
+ const refetchOptions = {
61
+ ...options
62
+ };
51
63
  if (refetchParams) {
52
64
  refetchOptions.refetchParams = refetchParams;
53
65
  }
@@ -56,19 +68,19 @@ const usePrefetch = (options) => {
56
68
  let newState;
57
69
  if (deferId) {
58
70
  if (newVal instanceof Promise) {
59
- newState = newVal.then((deferredData) => deferredData.data[deferId]);
60
- }
61
- else {
71
+ newState = newVal.then((deferredData)=>deferredData.data[deferId]);
72
+ } else {
62
73
  newState = newVal.data[deferId];
63
74
  }
64
- }
65
- else {
75
+ } else {
66
76
  newState = newVal;
67
77
  }
68
78
  setPrefetchState(newState);
69
79
  };
70
- return [prefetchState, refreshExecutor];
80
+ return [
81
+ prefetchState,
82
+ refreshExecutor
83
+ ];
71
84
  };
72
85
 
73
86
  export { usePrefetch };
74
- //# sourceMappingURL=react.esm.js.map
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
3
+ return typeof document === 'undefined'
4
+ ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
5
+ : (document.currentScript && document.currentScript.src) ||
6
+ new URL('main.js', document.baseURI).href;
7
+ })();
8
+ ;
9
+ var __webpack_modules__ = ({
10
+ "./hooks": (function (module) {
11
+ module.exports = require("./hooks.cjs");
12
+
13
+ }),
14
+
15
+ });
16
+ /************************************************************************/
17
+ // The module cache
18
+ var __webpack_module_cache__ = {};
19
+
20
+ // The require function
21
+ function __webpack_require__(moduleId) {
22
+
23
+ // Check if module is in cache
24
+ var cachedModule = __webpack_module_cache__[moduleId];
25
+ if (cachedModule !== undefined) {
26
+ return cachedModule.exports;
27
+ }
28
+ // Create a new module (and put it into the cache)
29
+ var module = (__webpack_module_cache__[moduleId] = {
30
+ exports: {}
31
+ });
32
+ // Execute the module function
33
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
34
+
35
+ // Return the exports of the module
36
+ return module.exports;
37
+
38
+ }
39
+
40
+ /************************************************************************/
41
+ // webpack/runtime/compat_get_default_export
42
+ (() => {
43
+ // getDefaultExport function for compatibility with non-ESM modules
44
+ __webpack_require__.n = (module) => {
45
+ var getter = module && module.__esModule ?
46
+ () => (module['default']) :
47
+ () => (module);
48
+ __webpack_require__.d(getter, { a: getter });
49
+ return getter;
50
+ };
51
+
52
+ })();
53
+ // webpack/runtime/define_property_getters
54
+ (() => {
55
+ __webpack_require__.d = (exports, definition) => {
56
+ for(var key in definition) {
57
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
58
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
59
+ }
60
+ }
61
+ };
62
+ })();
63
+ // webpack/runtime/has_own_property
64
+ (() => {
65
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
66
+ })();
67
+ // webpack/runtime/make_namespace_object
68
+ (() => {
69
+ // define __esModule on exports
70
+ __webpack_require__.r = (exports) => {
71
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
72
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
73
+ }
74
+ Object.defineProperty(exports, '__esModule', { value: true });
75
+ };
76
+ })();
77
+ /************************************************************************/
78
+ var __webpack_exports__ = {};
79
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
80
+ (() => {
81
+ __webpack_require__.r(__webpack_exports__);
82
+ /* ESM import */var _hooks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./hooks");
83
+ /* ESM import */var _hooks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_hooks__WEBPACK_IMPORTED_MODULE_0__);
84
+
85
+ /* ESM reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
86
+ /* ESM reexport (unknown) */ for( var __WEBPACK_IMPORT_KEY__ in _hooks__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] =function(key) { return _hooks__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
87
+ /* ESM reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
88
+
89
+
90
+ })();
91
+
92
+ for(var __webpack_i__ in __webpack_exports__) {
93
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
94
+ }
95
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,5 @@
1
+ export * from "./hooks.js";
2
+
3
+ ;// CONCATENATED MODULE: ./src/react/index.ts
4
+
5
+
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
3
+ return typeof document === 'undefined'
4
+ ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
5
+ : (document.currentScript && document.currentScript.src) ||
6
+ new URL('main.js', document.baseURI).href;
7
+ })();
8
+ ;
9
+ // The require scope
10
+ var __webpack_require__ = {};
11
+
12
+ /************************************************************************/
13
+ // webpack/runtime/define_property_getters
14
+ (() => {
15
+ __webpack_require__.d = (exports, definition) => {
16
+ for(var key in definition) {
17
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
18
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
19
+ }
20
+ }
21
+ };
22
+ })();
23
+ // webpack/runtime/has_own_property
24
+ (() => {
25
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
26
+ })();
27
+ // webpack/runtime/make_namespace_object
28
+ (() => {
29
+ // define __esModule on exports
30
+ __webpack_require__.r = (exports) => {
31
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
32
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
33
+ }
34
+ Object.defineProperty(exports, '__esModule', { value: true });
35
+ };
36
+ })();
37
+ /************************************************************************/
38
+ var __webpack_exports__ = {};
39
+ // ESM COMPAT FLAG
40
+ __webpack_require__.r(__webpack_exports__);
41
+
42
+ // EXPORTS
43
+ __webpack_require__.d(__webpack_exports__, {
44
+ useFirstMounted: () => (/* binding */ useFirstMounted)
45
+ });
46
+
47
+ ;// CONCATENATED MODULE: external "react"
48
+ const external_react_namespaceObject = require("react");
49
+ ;// CONCATENATED MODULE: ./src/react/utils.ts
50
+
51
+ const useFirstMounted = ()=>{
52
+ const ref = (0,external_react_namespaceObject.useRef)(true);
53
+ (0,external_react_namespaceObject.useEffect)(()=>{
54
+ ref.current = false;
55
+ }, []);
56
+ return ref.current;
57
+ };
58
+
59
+ exports.useFirstMounted = __webpack_exports__.useFirstMounted;
60
+ for(var __webpack_i__ in __webpack_exports__) {
61
+ if(["useFirstMounted"].indexOf(__webpack_i__) === -1) {
62
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
63
+ }
64
+ }
65
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -0,0 +1,15 @@
1
+ import { useEffect, useRef } from "react";
2
+
3
+ ;// CONCATENATED MODULE: external "react"
4
+
5
+ ;// CONCATENATED MODULE: ./src/react/utils.ts
6
+
7
+ const useFirstMounted = ()=>{
8
+ const ref = useRef(true);
9
+ useEffect(()=>{
10
+ ref.current = false;
11
+ }, []);
12
+ return ref.current;
13
+ };
14
+
15
+ export { useFirstMounted };
package/dist/react.cjs ADDED
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
3
+ return typeof document === 'undefined'
4
+ ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
5
+ : (document.currentScript && document.currentScript.src) ||
6
+ new URL('main.js', document.baseURI).href;
7
+ })();
8
+ ;
9
+ var __webpack_modules__ = ({
10
+ "./react/index": (function (module) {
11
+ module.exports = require("./react/index.cjs");
12
+
13
+ }),
14
+
15
+ });
16
+ /************************************************************************/
17
+ // The module cache
18
+ var __webpack_module_cache__ = {};
19
+
20
+ // The require function
21
+ function __webpack_require__(moduleId) {
22
+
23
+ // Check if module is in cache
24
+ var cachedModule = __webpack_module_cache__[moduleId];
25
+ if (cachedModule !== undefined) {
26
+ return cachedModule.exports;
27
+ }
28
+ // Create a new module (and put it into the cache)
29
+ var module = (__webpack_module_cache__[moduleId] = {
30
+ exports: {}
31
+ });
32
+ // Execute the module function
33
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
34
+
35
+ // Return the exports of the module
36
+ return module.exports;
37
+
38
+ }
39
+
40
+ /************************************************************************/
41
+ // webpack/runtime/compat_get_default_export
42
+ (() => {
43
+ // getDefaultExport function for compatibility with non-ESM modules
44
+ __webpack_require__.n = (module) => {
45
+ var getter = module && module.__esModule ?
46
+ () => (module['default']) :
47
+ () => (module);
48
+ __webpack_require__.d(getter, { a: getter });
49
+ return getter;
50
+ };
51
+
52
+ })();
53
+ // webpack/runtime/define_property_getters
54
+ (() => {
55
+ __webpack_require__.d = (exports, definition) => {
56
+ for(var key in definition) {
57
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
58
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
59
+ }
60
+ }
61
+ };
62
+ })();
63
+ // webpack/runtime/has_own_property
64
+ (() => {
65
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
66
+ })();
67
+ // webpack/runtime/make_namespace_object
68
+ (() => {
69
+ // define __esModule on exports
70
+ __webpack_require__.r = (exports) => {
71
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
72
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
73
+ }
74
+ Object.defineProperty(exports, '__esModule', { value: true });
75
+ };
76
+ })();
77
+ /************************************************************************/
78
+ var __webpack_exports__ = {};
79
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
80
+ (() => {
81
+ __webpack_require__.r(__webpack_exports__);
82
+ /* ESM import */var _react_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./react/index");
83
+ /* ESM import */var _react_index__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_react_index__WEBPACK_IMPORTED_MODULE_0__);
84
+
85
+ /* ESM reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
86
+ /* ESM reexport (unknown) */ for( var __WEBPACK_IMPORT_KEY__ in _react_index__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] =function(key) { return _react_index__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
87
+ /* ESM reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
88
+
89
+
90
+ })();
91
+
92
+ for(var __webpack_i__ in __webpack_exports__) {
93
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
94
+ }
95
+ Object.defineProperty(exports, '__esModule', { value: true });
package/dist/react.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./src/react/index";
1
+ export * from './react/index';
package/dist/react.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from "./react/index.js";
2
+
3
+ ;// CONCATENATED MODULE: ./src/react.ts
4
+
5
+
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
3
+ return typeof document === 'undefined'
4
+ ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
5
+ : (document.currentScript && document.currentScript.src) ||
6
+ new URL('main.js', document.baseURI).href;
7
+ })();
8
+ ;
9
+ // The require scope
10
+ var __webpack_require__ = {};
11
+
12
+ /************************************************************************/
13
+ // webpack/runtime/define_property_getters
14
+ (() => {
15
+ __webpack_require__.d = (exports, definition) => {
16
+ for(var key in definition) {
17
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
18
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
19
+ }
20
+ }
21
+ };
22
+ })();
23
+ // webpack/runtime/has_own_property
24
+ (() => {
25
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
26
+ })();
27
+ // webpack/runtime/make_namespace_object
28
+ (() => {
29
+ // define __esModule on exports
30
+ __webpack_require__.r = (exports) => {
31
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
32
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
33
+ }
34
+ Object.defineProperty(exports, '__esModule', { value: true });
35
+ };
36
+ })();
37
+ /************************************************************************/
38
+ var __webpack_exports__ = {};
39
+ // ESM COMPAT FLAG
40
+ __webpack_require__.r(__webpack_exports__);
41
+
42
+ // EXPORTS
43
+ __webpack_require__.d(__webpack_exports__, {
44
+ prefetch: () => (/* binding */ prefetch)
45
+ });
46
+
47
+ ;// CONCATENATED MODULE: external "../prefetch.cjs"
48
+ const external_prefetch_cjs_namespaceObject = require("../prefetch.cjs");
49
+ ;// CONCATENATED MODULE: external "../common/runtime-utils.cjs"
50
+ const runtime_utils_cjs_namespaceObject = require("../common/runtime-utils.cjs");
51
+ ;// CONCATENATED MODULE: ./src/universal/index.ts
52
+
53
+
54
+ function prefetch(options) {
55
+ const { id, functionId = 'default' } = options;
56
+ const mfScope = (0,runtime_utils_cjs_namespaceObject.getScope)();
57
+ const prefetchInstance = external_prefetch_cjs_namespaceObject.MFDataPrefetch.getInstance(mfScope) || new external_prefetch_cjs_namespaceObject.MFDataPrefetch({
58
+ name: mfScope
59
+ });
60
+ const res = prefetchInstance.getProjectExports();
61
+ if (res instanceof Promise) {
62
+ const promise = res.then(()=>{
63
+ const result = prefetchInstance.prefetch(options);
64
+ prefetchInstance.memorize(id + functionId, result);
65
+ return result;
66
+ });
67
+ return promise;
68
+ } else {
69
+ const result = prefetchInstance.prefetch(options);
70
+ prefetchInstance.memorize(id + functionId, result);
71
+ return result;
72
+ }
73
+ }
74
+
75
+ exports.prefetch = __webpack_exports__.prefetch;
76
+ for(var __webpack_i__ in __webpack_exports__) {
77
+ if(["prefetch"].indexOf(__webpack_i__) === -1) {
78
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
79
+ }
80
+ }
81
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,23 +1,28 @@
1
- import { M as MFDataPrefetch } from './prefetch.esm.js';
2
- import { g as getScope } from './runtime-utils.esm.js';
1
+ import { MFDataPrefetch } from "../prefetch.js";
2
+ import { getScope } from "../common/runtime-utils.js";
3
+
4
+ ;// CONCATENATED MODULE: external "../prefetch.js"
5
+
6
+ ;// CONCATENATED MODULE: external "../common/runtime-utils.js"
7
+
8
+ ;// CONCATENATED MODULE: ./src/universal/index.ts
9
+
3
10
 
4
11
  function prefetch(options) {
5
12
  const { id, functionId = 'default' } = options;
6
13
  const mfScope = getScope();
7
- const prefetchInstance = MFDataPrefetch.getInstance(mfScope) ||
8
- new MFDataPrefetch({
9
- name: mfScope,
10
- });
14
+ const prefetchInstance = MFDataPrefetch.getInstance(mfScope) || new MFDataPrefetch({
15
+ name: mfScope
16
+ });
11
17
  const res = prefetchInstance.getProjectExports();
12
18
  if (res instanceof Promise) {
13
- const promise = res.then(() => {
19
+ const promise = res.then(()=>{
14
20
  const result = prefetchInstance.prefetch(options);
15
21
  prefetchInstance.memorize(id + functionId, result);
16
22
  return result;
17
23
  });
18
24
  return promise;
19
- }
20
- else {
25
+ } else {
21
26
  const result = prefetchInstance.prefetch(options);
22
27
  prefetchInstance.memorize(id + functionId, result);
23
28
  return result;
@@ -25,4 +30,3 @@ function prefetch(options) {
25
30
  }
26
31
 
27
32
  export { prefetch };
28
- //# sourceMappingURL=universal.esm.js.map
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
3
+ return typeof document === 'undefined'
4
+ ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
5
+ : (document.currentScript && document.currentScript.src) ||
6
+ new URL('main.js', document.baseURI).href;
7
+ })();
8
+ ;
9
+ var __webpack_modules__ = ({
10
+ "./universal/index": (function (module) {
11
+ module.exports = require("./universal/index.cjs");
12
+
13
+ }),
14
+
15
+ });
16
+ /************************************************************************/
17
+ // The module cache
18
+ var __webpack_module_cache__ = {};
19
+
20
+ // The require function
21
+ function __webpack_require__(moduleId) {
22
+
23
+ // Check if module is in cache
24
+ var cachedModule = __webpack_module_cache__[moduleId];
25
+ if (cachedModule !== undefined) {
26
+ return cachedModule.exports;
27
+ }
28
+ // Create a new module (and put it into the cache)
29
+ var module = (__webpack_module_cache__[moduleId] = {
30
+ exports: {}
31
+ });
32
+ // Execute the module function
33
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
34
+
35
+ // Return the exports of the module
36
+ return module.exports;
37
+
38
+ }
39
+
40
+ /************************************************************************/
41
+ // webpack/runtime/compat_get_default_export
42
+ (() => {
43
+ // getDefaultExport function for compatibility with non-ESM modules
44
+ __webpack_require__.n = (module) => {
45
+ var getter = module && module.__esModule ?
46
+ () => (module['default']) :
47
+ () => (module);
48
+ __webpack_require__.d(getter, { a: getter });
49
+ return getter;
50
+ };
51
+
52
+ })();
53
+ // webpack/runtime/define_property_getters
54
+ (() => {
55
+ __webpack_require__.d = (exports, definition) => {
56
+ for(var key in definition) {
57
+ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
58
+ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
59
+ }
60
+ }
61
+ };
62
+ })();
63
+ // webpack/runtime/has_own_property
64
+ (() => {
65
+ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
66
+ })();
67
+ // webpack/runtime/make_namespace_object
68
+ (() => {
69
+ // define __esModule on exports
70
+ __webpack_require__.r = (exports) => {
71
+ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
72
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
73
+ }
74
+ Object.defineProperty(exports, '__esModule', { value: true });
75
+ };
76
+ })();
77
+ /************************************************************************/
78
+ var __webpack_exports__ = {};
79
+ // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
80
+ (() => {
81
+ __webpack_require__.r(__webpack_exports__);
82
+ /* ESM import */var _universal_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./universal/index");
83
+ /* ESM import */var _universal_index__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_universal_index__WEBPACK_IMPORTED_MODULE_0__);
84
+
85
+ /* ESM reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
86
+ /* ESM reexport (unknown) */ for( var __WEBPACK_IMPORT_KEY__ in _universal_index__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] =function(key) { return _universal_index__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
87
+ /* ESM reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
88
+
89
+
90
+ })();
91
+
92
+ for(var __webpack_i__ in __webpack_exports__) {
93
+ exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
94
+ }
95
+ Object.defineProperty(exports, '__esModule', { value: true });
@@ -1 +1 @@
1
- export * from "./src/universal/index";
1
+ export * from './universal/index';
@@ -0,0 +1,5 @@
1
+ export * from "./universal/index.js";
2
+
3
+ ;// CONCATENATED MODULE: ./src/universal.ts
4
+
5
+