@module-federation/bridge-react 0.18.3 → 0.19.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,20 @@
1
1
  # @module-federation/bridge-react
2
2
 
3
+ ## 0.19.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @module-federation/sdk@0.19.0
8
+ - @module-federation/bridge-shared@0.19.0
9
+
10
+ ## 0.18.4
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [8061f8c]
15
+ - @module-federation/sdk@0.18.4
16
+ - @module-federation/bridge-shared@0.18.4
17
+
3
18
  ## 0.18.3
4
19
 
5
20
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const lazyUtils = require("./utils-vIpCrZmn.js");
4
- const prefetch = require("./prefetch-6CJoG88F.js");
4
+ const prefetch = require("./prefetch-CUK94uFo.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-VSOJTX_o.mjs";
2
2
  import { C, b, e, h, c, d, r } from "./utils-VSOJTX_o.mjs";
3
- import { d as dataFetchFunction } from "./prefetch-BLYV643i.mjs";
4
- import { i, p } from "./prefetch-BLYV643i.mjs";
3
+ import { d as dataFetchFunction } from "./prefetch-Ci3Bjh-D.mjs";
4
+ import { i, p } from "./prefetch-Ci3Bjh-D.mjs";
5
5
  async function callDataFetch() {
6
6
  const dataFetch = globalThis[DATA_FETCH_FUNCTION];
7
7
  if (dataFetch) {
package/dist/index.cjs.js CHANGED
@@ -6,10 +6,10 @@ const React = require("react");
6
6
  const index = require("./index-eN2xRRXs.js");
7
7
  const ReactRouterDOM = require("react-router-dom");
8
8
  const plugin = require("./plugin.cjs.js");
9
- const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-DwJLK9Ef.js");
9
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-Aa70kps6.js");
10
10
  const lazyUtils = require("./utils-vIpCrZmn.js");
11
11
  const dataFetchUtils = require("./data-fetch-utils.cjs.js");
12
- const prefetch = require("./prefetch-6CJoG88F.js");
12
+ const prefetch = require("./prefetch-CUK94uFo.js");
13
13
  function _interopNamespaceDefault(e2) {
14
14
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
15
15
  if (e2) {
package/dist/index.es.js CHANGED
@@ -4,10 +4,10 @@ import React__default, { forwardRef, useContext, useState, useEffect, useRef } f
4
4
  import { p as pathJoin, L as LoggerInstance, g as getRootDomDefaultClassName } from "./index-rAO0Wr0M.mjs";
5
5
  import * as ReactRouterDOM from "react-router-dom";
6
6
  import { federationRuntime } from "./plugin.es.js";
7
- import { b, a, c, l } from "./lazy-load-component-plugin-zUhngDSw.mjs";
7
+ import { b, a, c, l } from "./lazy-load-component-plugin-BPXiZ3Pv.mjs";
8
8
  import { C, b as b2, E, e, h, c as c2, d, r, s } from "./utils-VSOJTX_o.mjs";
9
9
  import { callDataFetch } from "./data-fetch-utils.es.js";
10
- import { p } from "./prefetch-BLYV643i.mjs";
10
+ import { p } from "./prefetch-Ci3Bjh-D.mjs";
11
11
  function createReact16Or17Root(container) {
12
12
  return {
13
13
  render(children) {
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const prefetch = require("./prefetch-6CJoG88F.js");
2
+ const prefetch = require("./prefetch-CUK94uFo.js");
3
3
  const lazyUtils = require("./utils-vIpCrZmn.js");
4
4
  const React = require("react");
5
5
  const autoFetchData = () => {
@@ -1,4 +1,4 @@
1
- import { i as injectDataFetch, p as prefetch } from "./prefetch-BLYV643i.mjs";
1
+ import { i as injectDataFetch, p as prefetch } from "./prefetch-Ci3Bjh-D.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, a as loadDataFetchModule, M as MF_DATA_FETCH_STATUS, g 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-VSOJTX_o.mjs";
3
3
  import React__default, { useRef, useState, Suspense, useEffect } from "react";
4
4
  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-DwJLK9Ef.js");
4
- require("./prefetch-6CJoG88F.js");
3
+ const lazyLoadComponentPlugin = require("./lazy-load-component-plugin-Aa70kps6.js");
4
+ require("./prefetch-CUK94uFo.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-zUhngDSw.mjs";
2
- import "./prefetch-BLYV643i.mjs";
1
+ import { l, l as l2 } from "./lazy-load-component-plugin-BPXiZ3Pv.mjs";
2
+ import "./prefetch-Ci3Bjh-D.mjs";
3
3
  export {
4
4
  l as default,
5
5
  l2 as lazyLoadComponentPlugin
@@ -271,7 +271,7 @@ function getGlobalFederationConstructor() {
271
271
  function setGlobalFederationConstructor(FederationConstructor, isDebug = index_esm.isDebugMode()) {
272
272
  if (isDebug) {
273
273
  CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
274
- CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.18.3";
274
+ CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.19.0";
275
275
  }
276
276
  }
277
277
  function getInfoWithoutType(target, key) {
@@ -951,16 +951,17 @@ function handleRemoteEntryLoaded(name, globalName, entry) {
951
951
  }));
952
952
  return entryExports;
953
953
  }
954
- async function loadEntryScript({ name, globalName, entry, loaderHook }) {
954
+ async function loadEntryScript({ name, globalName, entry, loaderHook, getEntryUrl }) {
955
955
  const { entryExports: remoteEntryExports } = getRemoteEntryExports(name, globalName);
956
956
  if (remoteEntryExports) {
957
957
  return remoteEntryExports;
958
958
  }
959
- return index_esm.loadScript(entry, {
959
+ const url = getEntryUrl ? getEntryUrl(entry) : entry;
960
+ return index_esm.loadScript(url, {
960
961
  attrs: {},
961
- createScriptHook: (url, attrs) => {
962
+ createScriptHook: (url2, attrs) => {
962
963
  const res = loaderHook.lifecycle.createScript.emit({
963
- url,
964
+ url: url2,
964
965
  attrs
965
966
  });
966
967
  if (!res) return;
@@ -982,7 +983,7 @@ async function loadEntryScript({ name, globalName, entry, loaderHook }) {
982
983
  throw e;
983
984
  });
984
985
  }
985
- async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook }) {
986
+ async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEntryUrl }) {
986
987
  const { entry, entryGlobalName: globalName, name, type } = remoteInfo;
987
988
  switch (type) {
988
989
  case "esm":
@@ -1001,7 +1002,8 @@ async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook }) {
1001
1002
  entry,
1002
1003
  globalName,
1003
1004
  name,
1004
- loaderHook
1005
+ loaderHook,
1006
+ getEntryUrl
1005
1007
  });
1006
1008
  }
1007
1009
  }
@@ -1040,7 +1042,8 @@ function getRemoteEntryUniqueKey(remoteInfo) {
1040
1042
  const { entry, name } = remoteInfo;
1041
1043
  return index_esm.composeKeyWithSeparator(name, entry);
1042
1044
  }
1043
- async function getRemoteEntry({ origin, remoteEntryExports, remoteInfo }) {
1045
+ async function getRemoteEntry(params) {
1046
+ const { origin, remoteEntryExports, remoteInfo, getEntryUrl } = params;
1044
1047
  const uniqueKey = getRemoteEntryUniqueKey(remoteInfo);
1045
1048
  if (remoteEntryExports) {
1046
1049
  return remoteEntryExports;
@@ -1060,7 +1063,8 @@ async function getRemoteEntry({ origin, remoteEntryExports, remoteInfo }) {
1060
1063
  return isWebEnvironment ? loadEntryDom({
1061
1064
  remoteInfo,
1062
1065
  remoteEntryExports,
1063
- loaderHook
1066
+ loaderHook,
1067
+ getEntryUrl
1064
1068
  }) : loadEntryNode({
1065
1069
  remoteInfo,
1066
1070
  loaderHook
@@ -270,7 +270,7 @@ function getGlobalFederationConstructor() {
270
270
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
271
271
  if (isDebug) {
272
272
  CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
273
- CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.18.3";
273
+ CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "0.19.0";
274
274
  }
275
275
  }
276
276
  function getInfoWithoutType(target, key) {
@@ -950,16 +950,17 @@ function handleRemoteEntryLoaded(name, globalName, entry) {
950
950
  }));
951
951
  return entryExports;
952
952
  }
953
- async function loadEntryScript({ name, globalName, entry, loaderHook }) {
953
+ async function loadEntryScript({ name, globalName, entry, loaderHook, getEntryUrl }) {
954
954
  const { entryExports: remoteEntryExports } = getRemoteEntryExports(name, globalName);
955
955
  if (remoteEntryExports) {
956
956
  return remoteEntryExports;
957
957
  }
958
- return loadScript(entry, {
958
+ const url = getEntryUrl ? getEntryUrl(entry) : entry;
959
+ return loadScript(url, {
959
960
  attrs: {},
960
- createScriptHook: (url, attrs) => {
961
+ createScriptHook: (url2, attrs) => {
961
962
  const res = loaderHook.lifecycle.createScript.emit({
962
- url,
963
+ url: url2,
963
964
  attrs
964
965
  });
965
966
  if (!res) return;
@@ -981,7 +982,7 @@ async function loadEntryScript({ name, globalName, entry, loaderHook }) {
981
982
  throw e;
982
983
  });
983
984
  }
984
- async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook }) {
985
+ async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEntryUrl }) {
985
986
  const { entry, entryGlobalName: globalName, name, type } = remoteInfo;
986
987
  switch (type) {
987
988
  case "esm":
@@ -1000,7 +1001,8 @@ async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook }) {
1000
1001
  entry,
1001
1002
  globalName,
1002
1003
  name,
1003
- loaderHook
1004
+ loaderHook,
1005
+ getEntryUrl
1004
1006
  });
1005
1007
  }
1006
1008
  }
@@ -1039,7 +1041,8 @@ function getRemoteEntryUniqueKey(remoteInfo) {
1039
1041
  const { entry, name } = remoteInfo;
1040
1042
  return composeKeyWithSeparator(name, entry);
1041
1043
  }
1042
- async function getRemoteEntry({ origin, remoteEntryExports, remoteInfo }) {
1044
+ async function getRemoteEntry(params) {
1045
+ const { origin, remoteEntryExports, remoteInfo, getEntryUrl } = params;
1043
1046
  const uniqueKey = getRemoteEntryUniqueKey(remoteInfo);
1044
1047
  if (remoteEntryExports) {
1045
1048
  return remoteEntryExports;
@@ -1059,7 +1062,8 @@ async function getRemoteEntry({ origin, remoteEntryExports, remoteInfo }) {
1059
1062
  return isWebEnvironment ? loadEntryDom({
1060
1063
  remoteInfo,
1061
1064
  remoteEntryExports,
1062
- loaderHook
1065
+ loaderHook,
1066
+ getEntryUrl
1063
1067
  }) : loadEntryNode({
1064
1068
  remoteInfo,
1065
1069
  loaderHook
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/bridge-react",
3
- "version": "0.18.3",
3
+ "version": "0.19.0",
4
4
  "sideEffects": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,7 +9,7 @@
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
12
- "url": "https://github.com/module-federation/core",
12
+ "url": "git+https://github.com/module-federation/core.git",
13
13
  "directory": "packages/bridge-react"
14
14
  },
15
15
  "main": "./dist/index.cjs.js",
@@ -95,8 +95,8 @@
95
95
  "dependencies": {
96
96
  "react-error-boundary": "^4.1.2",
97
97
  "lru-cache": "^10.4.3",
98
- "@module-federation/bridge-shared": "0.18.3",
99
- "@module-federation/sdk": "0.18.3"
98
+ "@module-federation/sdk": "0.19.0",
99
+ "@module-federation/bridge-shared": "0.19.0"
100
100
  },
101
101
  "peerDependencies": {
102
102
  "react": ">=16.9.0",
@@ -118,8 +118,8 @@
118
118
  "vite": "^5.4.18",
119
119
  "vite-plugin-dts": "^4.3.0",
120
120
  "hono": "3.12.12",
121
- "@module-federation/runtime": "0.18.3",
122
- "@module-federation/runtime-core": "0.18.3"
121
+ "@module-federation/runtime": "0.19.0",
122
+ "@module-federation/runtime-core": "0.19.0"
123
123
  },
124
124
  "scripts": {
125
125
  "dev": "vite",