@module-federation/bridge-react 0.0.0-next-20250410121036 → 0.0.0-next-20250413134017
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 +3 -3
- package/dist/{internal/bridge-base-DBiwuddQ.cjs.js → bridge-base-BQcdOEoU.cjs} +3 -3
- package/dist/{internal/bridge-base-CW88-1Be.es.js → bridge-base-BbzPi965.js} +3 -3
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +2 -2
- package/dist/router-v5.cjs.js +1 -1
- package/dist/router-v5.es.js +1 -1
- package/dist/router-v6.cjs.js +1 -1
- package/dist/router-v6.es.js +1 -1
- package/dist/router.cjs.js +1 -1
- package/dist/router.es.js +1 -1
- package/dist/v16.cjs.js +1 -1
- package/dist/v16.es.js +1 -1
- package/dist/v18.cjs.js +1 -1
- package/dist/v18.es.js +1 -1
- package/dist/v19.cjs.js +1 -1
- package/dist/v19.es.js +1 -1
- package/package.json +4 -4
- package/vite.config.ts +0 -51
- /package/dist/{internal/context.cjs.js → context-C79iMWYD.cjs} +0 -0
- /package/dist/{internal/context.es.js → context-Dbqf0szX.js} +0 -0
- /package/dist/{internal/react-error-boundary.esm-CMdlkNPP.es.js → react-error-boundary.esm-CMdlkNPP.js} +0 -0
- /package/dist/{internal/react-error-boundary.esm-D8nxmvmv.cjs.js → react-error-boundary.esm-D8nxmvmv.cjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @module-federation/bridge-react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-20250413134017
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
- d0a11ff: feat(bridge-react): support react v19 in react compat file.
|
|
12
12
|
- Updated dependencies [f4fb242]
|
|
13
|
-
- @module-federation/sdk@0.0.0-next-
|
|
14
|
-
- @module-federation/bridge-shared@0.0.0-next-
|
|
13
|
+
- @module-federation/sdk@0.0.0-next-20250413134017
|
|
14
|
+
- @module-federation/bridge-shared@0.0.0-next-20250413134017
|
|
15
15
|
|
|
16
16
|
## 0.11.4
|
|
17
17
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const React = require("react");
|
|
3
|
-
const reactErrorBoundary_esm = require("./react-error-boundary.esm-D8nxmvmv.cjs
|
|
4
|
-
const context = require("./context.cjs
|
|
5
|
-
const plugin = require("
|
|
3
|
+
const reactErrorBoundary_esm = require("./react-error-boundary.esm-D8nxmvmv.cjs");
|
|
4
|
+
const context = require("./context-C79iMWYD.cjs");
|
|
5
|
+
const plugin = require("./plugin.cjs.js");
|
|
6
6
|
function _interopNamespaceDefault(e) {
|
|
7
7
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
8
|
if (e) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { E as ErrorBoundary } from "./react-error-boundary.esm-CMdlkNPP.
|
|
3
|
-
import { L as LoggerInstance, R as RouterContext } from "./context.
|
|
4
|
-
import { federationRuntime } from "
|
|
2
|
+
import { E as ErrorBoundary } from "./react-error-boundary.esm-CMdlkNPP.js";
|
|
3
|
+
import { L as LoggerInstance, R as RouterContext } from "./context-Dbqf0szX.js";
|
|
4
|
+
import { federationRuntime } from "./plugin.es.js";
|
|
5
5
|
function createBaseBridgeComponent({
|
|
6
6
|
createRoot,
|
|
7
7
|
defaultRootOptions,
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
|
-
const reactErrorBoundary_esm = require("./
|
|
5
|
-
const context = require("./
|
|
4
|
+
const reactErrorBoundary_esm = require("./react-error-boundary.esm-D8nxmvmv.cjs");
|
|
5
|
+
const context = require("./context-C79iMWYD.cjs");
|
|
6
6
|
const ReactRouterDOM = require("react-router-dom");
|
|
7
7
|
const plugin = require("./plugin.cjs.js");
|
|
8
8
|
const ReactDOM = require("react-dom");
|
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import React__default, { forwardRef, useRef, useState, useEffect, useContext } from "react";
|
|
3
|
-
import { E as ErrorBoundary } from "./
|
|
4
|
-
import { L as LoggerInstance, g as getRootDomDefaultClassName, p as pathJoin, R as RouterContext } from "./
|
|
3
|
+
import { E as ErrorBoundary } from "./react-error-boundary.esm-CMdlkNPP.js";
|
|
4
|
+
import { L as LoggerInstance, g as getRootDomDefaultClassName, p as pathJoin, R as RouterContext } from "./context-Dbqf0szX.js";
|
|
5
5
|
import * as ReactRouterDOM from "react-router-dom";
|
|
6
6
|
import { federationRuntime } from "./plugin.es.js";
|
|
7
7
|
import ReactDOM from "react-dom";
|
package/dist/router-v5.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const ReactRouterDom$1 = require("react-router-dom/index.js");
|
|
5
|
-
const context = require("./
|
|
5
|
+
const context = require("./context-C79iMWYD.cjs");
|
|
6
6
|
const ReactRouterDom = require("react-router-dom/index.js");
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
package/dist/router-v5.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useContext } from "react";
|
|
2
2
|
import * as ReactRouterDom$1 from "react-router-dom/index.js";
|
|
3
|
-
import { R as RouterContext, L as LoggerInstance } from "./
|
|
3
|
+
import { R as RouterContext, L as LoggerInstance } from "./context-Dbqf0szX.js";
|
|
4
4
|
export * from "react-router-dom/index.js";
|
|
5
5
|
function WraperRouter(props) {
|
|
6
6
|
const { basename, ...propsRes } = props;
|
package/dist/router-v6.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const ReactRouterDom$1 = require("react-router-dom/dist/index.js");
|
|
5
|
-
const context = require("./
|
|
5
|
+
const context = require("./context-C79iMWYD.cjs");
|
|
6
6
|
const ReactRouterDom = require("react-router-dom/dist/index.js");
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
package/dist/router-v6.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React__default, { useContext } from "react";
|
|
2
2
|
import * as ReactRouterDom$1 from "react-router-dom/dist/index.js";
|
|
3
|
-
import { R as RouterContext, L as LoggerInstance } from "./
|
|
3
|
+
import { R as RouterContext, L as LoggerInstance } from "./context-Dbqf0szX.js";
|
|
4
4
|
export * from "react-router-dom/dist/index.js";
|
|
5
5
|
function WraperRouter(props) {
|
|
6
6
|
const { basename, ...propsRes } = props;
|
package/dist/router.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const React = require("react");
|
|
4
4
|
const ReactRouterDom = require("react-router-dom/");
|
|
5
|
-
const context = require("./
|
|
5
|
+
const context = require("./context-C79iMWYD.cjs");
|
|
6
6
|
function _interopNamespaceDefault(e) {
|
|
7
7
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
8
|
if (e) {
|
package/dist/router.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React__default, { useContext } from "react";
|
|
2
2
|
import * as ReactRouterDom from "react-router-dom/";
|
|
3
3
|
export * from "react-router-dom/";
|
|
4
|
-
import { R as RouterContext, L as LoggerInstance } from "./
|
|
4
|
+
import { R as RouterContext, L as LoggerInstance } from "./context-Dbqf0szX.js";
|
|
5
5
|
function WrapperRouter(props) {
|
|
6
6
|
const { basename, ...propsRes } = props;
|
|
7
7
|
const routerContextProps = useContext(RouterContext) || {};
|
package/dist/v16.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const bridgeBase = require("./
|
|
3
|
+
const bridgeBase = require("./bridge-base-BQcdOEoU.cjs");
|
|
4
4
|
const ReactDOM = require("react-dom");
|
|
5
5
|
function createReact16Or17Root(container) {
|
|
6
6
|
return {
|
package/dist/v16.es.js
CHANGED
package/dist/v18.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const client = require("react-dom/client");
|
|
4
|
-
const bridgeBase = require("./
|
|
4
|
+
const bridgeBase = require("./bridge-base-BQcdOEoU.cjs");
|
|
5
5
|
function createReact18Root(container, options) {
|
|
6
6
|
return client.createRoot(container, options);
|
|
7
7
|
}
|
package/dist/v18.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRoot } from "react-dom/client";
|
|
2
|
-
import { c as createBaseBridgeComponent } from "./
|
|
2
|
+
import { c as createBaseBridgeComponent } from "./bridge-base-BbzPi965.js";
|
|
3
3
|
function createReact18Root(container, options) {
|
|
4
4
|
return createRoot(container, options);
|
|
5
5
|
}
|
package/dist/v19.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const client = require("react-dom/client");
|
|
4
|
-
const bridgeBase = require("./
|
|
4
|
+
const bridgeBase = require("./bridge-base-BQcdOEoU.cjs");
|
|
5
5
|
function createReact19Root(container, options) {
|
|
6
6
|
return client.createRoot(container, options);
|
|
7
7
|
}
|
package/dist/v19.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRoot } from "react-dom/client";
|
|
2
|
-
import { c as createBaseBridgeComponent } from "./
|
|
2
|
+
import { c as createBaseBridgeComponent } from "./bridge-base-BbzPi965.js";
|
|
3
3
|
function createReact19Root(container, options) {
|
|
4
4
|
return createRoot(container, options);
|
|
5
5
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/bridge-react",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20250413134017",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"react-error-boundary": "^4.1.2",
|
|
63
|
-
"@module-federation/bridge-shared": "0.0.0-next-
|
|
64
|
-
"@module-federation/sdk": "0.0.0-next-
|
|
63
|
+
"@module-federation/bridge-shared": "0.0.0-next-20250413134017",
|
|
64
|
+
"@module-federation/sdk": "0.0.0-next-20250413134017"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"react": ">=16.9.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"typescript": "^5.2.2",
|
|
83
83
|
"vite": "^5.4.12",
|
|
84
84
|
"vite-plugin-dts": "^4.3.0",
|
|
85
|
-
"@module-federation/runtime": "0.0.0-next-
|
|
85
|
+
"@module-federation/runtime": "0.0.0-next-20250413134017"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
88
|
"dev": "vite",
|
package/vite.config.ts
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { defineConfig } from 'vite';
|
|
2
|
-
// import vue from '@vitejs/plugin-vue';
|
|
3
2
|
import path from 'path';
|
|
4
3
|
import dts from 'vite-plugin-dts';
|
|
5
|
-
// import react from '@vitejs/plugin-react';
|
|
6
4
|
import packageJson from './package.json';
|
|
7
|
-
import fs from 'fs';
|
|
8
5
|
|
|
9
6
|
const perDepsKeys = Object.keys(packageJson.peerDependencies);
|
|
10
7
|
|
|
@@ -17,40 +14,6 @@ export default defineConfig({
|
|
|
17
14
|
'@module-federation/bridge-shared',
|
|
18
15
|
'react-error-boundary',
|
|
19
16
|
],
|
|
20
|
-
// 自定义类型声明文件的输出路径
|
|
21
|
-
afterBuild: () => {
|
|
22
|
-
// 确保provider目录存在
|
|
23
|
-
if (!fs.existsSync('dist/provider')) {
|
|
24
|
-
fs.mkdirSync('dist/provider', { recursive: true });
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// 复制src/provider/versions中的类型声明文件到dist/provider目录
|
|
28
|
-
const srcDir = path.resolve(__dirname, 'dist/provider/versions');
|
|
29
|
-
const destDir = path.resolve(__dirname, 'dist/provider');
|
|
30
|
-
|
|
31
|
-
if (fs.existsSync(srcDir)) {
|
|
32
|
-
// 读取srcDir中的所有文件
|
|
33
|
-
const files = fs.readdirSync(srcDir);
|
|
34
|
-
|
|
35
|
-
// 复制每个v*.d.ts文件到destDir
|
|
36
|
-
files.forEach((file) => {
|
|
37
|
-
if (file.match(/^v\d+\.d\.ts$/)) {
|
|
38
|
-
const srcFile = path.join(srcDir, file);
|
|
39
|
-
const destFile = path.join(destDir, file);
|
|
40
|
-
|
|
41
|
-
// 读取源文件内容
|
|
42
|
-
const content = fs.readFileSync(srcFile, 'utf8');
|
|
43
|
-
|
|
44
|
-
// 写入目标文件
|
|
45
|
-
fs.writeFileSync(destFile, content);
|
|
46
|
-
|
|
47
|
-
console.log(`Copied ${srcFile} to ${destFile}`);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
} else {
|
|
51
|
-
console.warn(`Source directory ${srcDir} does not exist.`);
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
17
|
}),
|
|
55
18
|
],
|
|
56
19
|
build: {
|
|
@@ -79,20 +42,6 @@ export default defineConfig({
|
|
|
79
42
|
'react-router-dom/index.js',
|
|
80
43
|
'react-router-dom/dist/index.js',
|
|
81
44
|
],
|
|
82
|
-
output: {
|
|
83
|
-
// 将共享chunk文件放在internal目录下,并使用更清晰的命名
|
|
84
|
-
chunkFileNames: (chunkInfo) => {
|
|
85
|
-
// 根据chunk的名称或内容确定一个更有意义的名称
|
|
86
|
-
const name = chunkInfo.name;
|
|
87
|
-
if (name.includes('context')) {
|
|
88
|
-
return 'internal/context.[format].js';
|
|
89
|
-
}
|
|
90
|
-
if (name.includes('version-specific')) {
|
|
91
|
-
return 'internal/version-specific.[format].js';
|
|
92
|
-
}
|
|
93
|
-
return 'internal/[name]-[hash].[format].js';
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
45
|
plugins: [
|
|
97
46
|
{
|
|
98
47
|
name: 'modify-output-plugin',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|