@module-federation/bridge-react 2.2.2 → 2.3.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @module-federation/bridge-react@2.2.2 build /home/runner/work/core/core/packages/bridge/bridge-react
2
+ > @module-federation/bridge-react@2.3.0 build /home/runner/work/core/core/packages/bridge/bridge-react
3
3
  > vite build
4
4
 
5
5
  The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
@@ -26,12 +26,12 @@ computing gzip size...
26
26
  dist/router-v7.cjs.js  3.27 kB │ gzip: 0.95 kB
27
27
  dist/router-v6.cjs.js  3.28 kB │ gzip: 0.95 kB
28
28
  dist/logger-Dxblx6P-.js  3.78 kB │ gzip: 1.22 kB
29
- dist/index.cjs.js  5.25 kB │ gzip: 1.51 kB
29
+ dist/index.cjs.js  5.25 kB │ gzip: 1.52 kB
30
30
  dist/data-fetch-server-middleware.cjs.js  5.79 kB │ gzip: 1.73 kB
31
31
  dist/createHelpers-9B0ttrN_.js  7.32 kB │ gzip: 1.95 kB
32
32
  dist/bridge-base-IlvdqYIj.js  7.70 kB │ gzip: 2.11 kB
33
- dist/lazy-load-component-plugin-0-2dETvt.js 17.65 kB │ gzip: 4.20 kB
34
- dist/prefetch-BIuiJePI.js 31.61 kB │ gzip: 7.73 kB
33
+ dist/lazy-load-component-plugin-ZC6dhtcT.js 17.65 kB │ gzip: 4.21 kB
34
+ dist/prefetch-8e8pqiSo.js 31.90 kB │ gzip: 7.84 kB
35
35
  dist/utils-CFTy4LVE.js 72.53 kB │ gzip: 15.19 kB
36
36
  [vite:dts] Start rollup declaration files...
37
37
  Analysis will use the bundled TypeScript version 5.8.2
@@ -60,7 +60,7 @@ Analysis will use the bundled TypeScript version 5.8.2
60
60
  *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
61
61
  Analysis will use the bundled TypeScript version 5.8.2
62
62
  *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
63
- [vite:dts] Declaration files built in 48507ms.
63
+ [vite:dts] Declaration files built in 50941ms.
64
64
  
65
65
  dist/lazy-load-component-plugin.es.js  0.17 kB │ gzip: 0.15 kB
66
66
  dist/plugin.es.js  0.29 kB │ gzip: 0.18 kB
@@ -79,7 +79,7 @@ Analysis will use the bundled TypeScript version 5.8.2
79
79
  dist/data-fetch-server-middleware.es.js  5.73 kB │ gzip: 1.76 kB
80
80
  dist/bridge-base-EnVXD4Hr.mjs  7.11 kB │ gzip: 1.92 kB
81
81
  dist/createHelpers-D77sECmY.mjs  7.27 kB │ gzip: 1.96 kB
82
- dist/lazy-load-component-plugin-ChXiUL6x.mjs 17.79 kB │ gzip: 4.33 kB
83
- dist/prefetch-DLfc6h__.mjs 31.63 kB │ gzip: 7.80 kB
82
+ dist/lazy-load-component-plugin-CqxENGBE.mjs 17.79 kB │ gzip: 4.33 kB
83
+ dist/prefetch-CFKA0dZg.mjs 31.92 kB │ gzip: 7.90 kB
84
84
  dist/utils-D4k5eixv.mjs 71.78 kB │ gzip: 15.18 kB
85
- ✓ built in 51.16s
85
+ ✓ built in 53.70s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @module-federation/bridge-react
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [eb26065]
8
+ - Updated dependencies [8f2ec9b]
9
+ - @module-federation/sdk@2.3.0
10
+ - @module-federation/bridge-shared@2.3.0
11
+
12
+ ## 2.2.3
13
+
14
+ ### Patch Changes
15
+
16
+ - @module-federation/sdk@2.2.3
17
+ - @module-federation/bridge-shared@2.2.3
18
+
3
19
  ## 2.2.2
4
20
 
5
21
  ### Patch Changes
package/dist/base.cjs.js CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const createHelpers = require("./createHelpers-9B0ttrN_.js");
4
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-0-2dETvt.js");
4
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-ZC6dhtcT.js");
5
5
  const lazyUtils = require("./utils-CFTy4LVE.js");
6
6
  const dataFetchUtils = require("./data-fetch-utils.cjs.js");
7
- const prefetch = require("./prefetch-BIuiJePI.js");
7
+ const prefetch = require("./prefetch-8e8pqiSo.js");
8
8
  const createRemoteAppComponent = createHelpers.createRemoteAppComponentFactory(createHelpers.RemoteAppWrapper);
9
9
  const createRemoteComponent = createHelpers.createDeprecatedRemoteComponentFactory(
10
10
  createRemoteAppComponent
package/dist/base.es.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { c as createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory, R as RemoteAppWrapper } from "./createHelpers-D77sECmY.mjs";
2
2
  import { b } from "./createHelpers-D77sECmY.mjs";
3
- import { a, c, b as b2, l } from "./lazy-load-component-plugin-ChXiUL6x.mjs";
3
+ import { a, c, b as b2, l } from "./lazy-load-component-plugin-CqxENGBE.mjs";
4
4
  import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-D4k5eixv.mjs";
5
5
  import { callDataFetch } from "./data-fetch-utils.es.js";
6
- import { p } from "./prefetch-DLfc6h__.mjs";
6
+ import { p } from "./prefetch-CFKA0dZg.mjs";
7
7
  const createRemoteAppComponent = createRemoteAppComponentFactory(RemoteAppWrapper);
8
8
  const createRemoteComponent = createDeprecatedRemoteComponentFactory(
9
9
  createRemoteAppComponent
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const lazyUtils = require("./utils-CFTy4LVE.js");
4
- const prefetch = require("./prefetch-BIuiJePI.js");
4
+ const prefetch = require("./prefetch-8e8pqiSo.js");
5
5
  async function callDataFetch() {
6
6
  const dataFetch = globalThis[lazyUtils.DATA_FETCH_FUNCTION];
7
7
  if (dataFetch) {
@@ -1,7 +1,7 @@
1
1
  import { x as DATA_FETCH_FUNCTION } from "./utils-D4k5eixv.mjs";
2
2
  import { C, a, c, b, d, g, r } from "./utils-D4k5eixv.mjs";
3
- import { d as dataFetchFunction } from "./prefetch-DLfc6h__.mjs";
4
- import { i, p } from "./prefetch-DLfc6h__.mjs";
3
+ import { d as dataFetchFunction } from "./prefetch-CFKA0dZg.mjs";
4
+ import { i, p } from "./prefetch-CFKA0dZg.mjs";
5
5
  async function callDataFetch() {
6
6
  const dataFetch = globalThis[DATA_FETCH_FUNCTION];
7
7
  if (dataFetch) {
package/dist/index.cjs.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const createHelpers = require("./createHelpers-9B0ttrN_.js");
4
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-0-2dETvt.js");
4
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-ZC6dhtcT.js");
5
5
  const lazyUtils = require("./utils-CFTy4LVE.js");
6
6
  const dataFetchUtils = require("./data-fetch-utils.cjs.js");
7
7
  const React = require("react");
8
8
  const ReactRouterDOM = require("react-router-dom");
9
9
  const index = require("./index-DbjGCKOr.js");
10
- const prefetch = require("./prefetch-BIuiJePI.js");
10
+ const prefetch = require("./prefetch-8e8pqiSo.js");
11
11
  function _interopNamespaceDefault(e2) {
12
12
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
13
13
  if (e2) {
package/dist/index.es.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { R as RemoteAppWrapper, c as createRemoteAppComponentFactory, a as createDeprecatedRemoteComponentFactory } from "./createHelpers-D77sECmY.mjs";
2
2
  import { b } from "./createHelpers-D77sECmY.mjs";
3
- import { a, c, b as b2, l } from "./lazy-load-component-plugin-ChXiUL6x.mjs";
3
+ import { a, c, b as b2, l } from "./lazy-load-component-plugin-CqxENGBE.mjs";
4
4
  import { C, a as a2, E, c as c2, b as b3, d, g, r, s } from "./utils-D4k5eixv.mjs";
5
5
  import { callDataFetch } from "./data-fetch-utils.es.js";
6
6
  import React__default, { forwardRef, useContext, useState, useEffect } from "react";
7
7
  import * as ReactRouterDOM from "react-router-dom";
8
8
  import { p as pathJoin, L as LoggerInstance } from "./index-Bs2NxD2z.mjs";
9
- import { p } from "./prefetch-DLfc6h__.mjs";
9
+ import { p } from "./prefetch-CFKA0dZg.mjs";
10
10
  function e() {
11
11
  const t = new PopStateEvent("popstate", { state: window.history.state });
12
12
  window.dispatchEvent(t);
@@ -1,4 +1,4 @@
1
- import { i as injectDataFetch, p as prefetch } from "./prefetch-DLfc6h__.mjs";
1
+ import { i as injectDataFetch, p as prefetch } from "./prefetch-CFKA0dZg.mjs";
2
2
  import { i as initDataFetchMap, j as isDataLoaderExpose, k as getDataFetchInfo, m as getDataFetchMapKey, l as logger, n as getDataFetchItem, o as DATA_FETCH_CLIENT_SUFFIX, p as MF_DATA_FETCH_TYPE, q as isCSROnly, M as MF_DATA_FETCH_STATUS, h as loadDataFetchModule, e as getDataFetchMap, t as isServerEnv, u as getDataFetchIdWithErrorMsgs, v as DATA_FETCH_ERROR_PREFIX, E as ERROR_TYPE, w as wrapDataFetchId, L as LOAD_REMOTE_ERROR_PREFIX, x as DATA_FETCH_FUNCTION, y as getLoadedRemoteInfos, f as fetchData$1, z as setDataFetchItemLoadedStatus, F as FS_HREF } from "./utils-D4k5eixv.mjs";
3
3
  import React__default, { useRef, useState, Suspense, useEffect } from "react";
4
4
  const autoFetchData = () => {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const prefetch = require("./prefetch-BIuiJePI.js");
2
+ const prefetch = require("./prefetch-8e8pqiSo.js");
3
3
  const lazyUtils = require("./utils-CFTy4LVE.js");
4
4
  const React = require("react");
5
5
  const autoFetchData = () => {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-0-2dETvt.js");
4
- require("./prefetch-BIuiJePI.js");
3
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-ZC6dhtcT.js");
4
+ require("./prefetch-8e8pqiSo.js");
5
5
  exports.default = lazyLoadComponentPlugin.lazyLoadComponentPlugin;
6
6
  exports.lazyLoadComponentPlugin = lazyLoadComponentPlugin.lazyLoadComponentPlugin;
@@ -1,5 +1,5 @@
1
- import { l, l as l2 } from "./lazy-load-component-plugin-ChXiUL6x.mjs";
2
- import "./prefetch-DLfc6h__.mjs";
1
+ import { l, l as l2 } from "./lazy-load-component-plugin-CqxENGBE.mjs";
2
+ import "./prefetch-CFKA0dZg.mjs";
3
3
  export {
4
4
  l as default,
5
5
  l2 as lazyLoadComponentPlugin
@@ -63,7 +63,7 @@ function createScript(info) {
63
63
  if (executionErrorHandler) window.removeEventListener("error", executionErrorHandler);
64
64
  const onScriptCompleteCallback = () => {
65
65
  if ((event == null ? void 0 : event.type) === "error") {
66
- const networkError = /* @__PURE__ */ new Error(`ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
66
+ const networkError = /* @__PURE__ */ new Error((event == null ? void 0 : event.isTimeout) ? `ScriptNetworkError: Script "${info.url}" timed out.` : `ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
67
67
  networkError.name = "ScriptNetworkError";
68
68
  (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(networkError));
69
69
  } else if (executionError) (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(executionError));
@@ -92,7 +92,10 @@ function createScript(info) {
92
92
  script.onerror = onScriptComplete.bind(null, script.onerror);
93
93
  script.onload = onScriptComplete.bind(null, script.onload);
94
94
  timeoutId = setTimeout(() => {
95
- onScriptComplete(null, /* @__PURE__ */ new Error(`Remote script "${info.url}" time-outed.`));
95
+ onScriptComplete(null, {
96
+ type: "error",
97
+ isTimeout: true
98
+ });
96
99
  }, timeout);
97
100
  return {
98
101
  script,
@@ -490,6 +493,7 @@ const RUNTIME_008 = "RUNTIME-008";
490
493
  const RUNTIME_009 = "RUNTIME-009";
491
494
  const RUNTIME_010 = "RUNTIME-010";
492
495
  const RUNTIME_011 = "RUNTIME-011";
496
+ const RUNTIME_012 = "RUNTIME-012";
493
497
  const runtimeDescMap = {
494
498
  [RUNTIME_001]: "Failed to get remoteEntry exports.",
495
499
  [RUNTIME_002]: 'The remote entry interface does not contain "init"',
@@ -501,7 +505,8 @@ const runtimeDescMap = {
501
505
  [RUNTIME_008]: "Failed to load script resources.",
502
506
  [RUNTIME_009]: "Please call createInstance first.",
503
507
  [RUNTIME_010]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
504
- [RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot."
508
+ [RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot.",
509
+ [RUNTIME_012]: 'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.'
505
510
  };
506
511
  ({
507
512
  ...runtimeDescMap
@@ -62,7 +62,7 @@ function createScript(info) {
62
62
  if (executionErrorHandler) window.removeEventListener("error", executionErrorHandler);
63
63
  const onScriptCompleteCallback = () => {
64
64
  if ((event == null ? void 0 : event.type) === "error") {
65
- const networkError = /* @__PURE__ */ new Error(`ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
65
+ const networkError = /* @__PURE__ */ new Error((event == null ? void 0 : event.isTimeout) ? `ScriptNetworkError: Script "${info.url}" timed out.` : `ScriptNetworkError: Failed to load script "${info.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);
66
66
  networkError.name = "ScriptNetworkError";
67
67
  (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(networkError));
68
68
  } else if (executionError) (info == null ? void 0 : info.onErrorCallback) && (info == null ? void 0 : info.onErrorCallback(executionError));
@@ -91,7 +91,10 @@ function createScript(info) {
91
91
  script.onerror = onScriptComplete.bind(null, script.onerror);
92
92
  script.onload = onScriptComplete.bind(null, script.onload);
93
93
  timeoutId = setTimeout(() => {
94
- onScriptComplete(null, /* @__PURE__ */ new Error(`Remote script "${info.url}" time-outed.`));
94
+ onScriptComplete(null, {
95
+ type: "error",
96
+ isTimeout: true
97
+ });
95
98
  }, timeout);
96
99
  return {
97
100
  script,
@@ -489,6 +492,7 @@ const RUNTIME_008 = "RUNTIME-008";
489
492
  const RUNTIME_009 = "RUNTIME-009";
490
493
  const RUNTIME_010 = "RUNTIME-010";
491
494
  const RUNTIME_011 = "RUNTIME-011";
495
+ const RUNTIME_012 = "RUNTIME-012";
492
496
  const runtimeDescMap = {
493
497
  [RUNTIME_001]: "Failed to get remoteEntry exports.",
494
498
  [RUNTIME_002]: 'The remote entry interface does not contain "init"',
@@ -500,7 +504,8 @@ const runtimeDescMap = {
500
504
  [RUNTIME_008]: "Failed to load script resources.",
501
505
  [RUNTIME_009]: "Please call createInstance first.",
502
506
  [RUNTIME_010]: 'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',
503
- [RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot."
507
+ [RUNTIME_011]: "The remoteEntry URL is missing from the remote snapshot.",
508
+ [RUNTIME_012]: 'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.'
504
509
  };
505
510
  ({
506
511
  ...runtimeDescMap
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/bridge-react",
3
- "version": "2.2.2",
3
+ "version": "2.3.0",
4
4
  "sideEffects": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -129,8 +129,8 @@
129
129
  "dependencies": {
130
130
  "react-error-boundary": "^4.1.2",
131
131
  "lru-cache": "^10.4.3",
132
- "@module-federation/bridge-shared": "2.2.2",
133
- "@module-federation/sdk": "2.2.2"
132
+ "@module-federation/sdk": "2.3.0",
133
+ "@module-federation/bridge-shared": "2.3.0"
134
134
  },
135
135
  "peerDependencies": {
136
136
  "react": ">=16.9.0",
@@ -167,8 +167,8 @@
167
167
  "vite-plugin-dts": "^4.3.0",
168
168
  "hono": "4.12.7",
169
169
  "vitest": "1.6.0",
170
- "@module-federation/runtime": "2.2.2",
171
- "@module-federation/runtime-core": "2.2.2"
170
+ "@module-federation/runtime": "2.3.0",
171
+ "@module-federation/runtime-core": "2.3.0"
172
172
  },
173
173
  "scripts": {
174
174
  "dev": "vite",