ssr-plugin-react 6.2.1 → 6.2.4

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
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.2.4](https://github.com/zhangyuang/ssr/compare/v6.2.3...v6.2.4) (2022-04-01)
7
+
8
+ **Note:** Version bump only for package ssr-plugin-react
9
+
10
+
11
+
12
+
13
+
14
+ ## [6.2.3](https://github.com/zhangyuang/ssr/compare/v6.2.1...v6.2.3) (2022-04-01)
15
+
16
+
17
+ ### Features
18
+
19
+ * judge microapp environment automaticlly ([85395dc](https://github.com/zhangyuang/ssr/commit/85395dcd3755ec2d2fdbeb22b2aa7097035e07d2))
20
+
21
+
22
+
23
+
24
+
25
+ ## [6.2.2](https://github.com/zhangyuang/ssr/compare/v6.2.1...v6.2.2) (2022-04-01)
26
+
27
+
28
+ ### Features
29
+
30
+ * judge microapp environment automaticlly ([85395dc](https://github.com/zhangyuang/ssr/commit/85395dcd3755ec2d2fdbeb22b2aa7097035e07d2))
31
+
32
+
33
+
34
+
35
+
6
36
  ## [6.2.1](https://github.com/zhangyuang/ssr/compare/v6.2.0...v6.2.1) (2022-04-01)
7
37
 
8
38
 
@@ -15,7 +15,7 @@ const clientRender = async () => {
15
15
  return props.children;
16
16
  };
17
17
  // 客户端渲染||hydrate
18
- const baseName = (_b = (_a = window.clientPrefix) !== null && _a !== void 0 ? _a : window.prefix) !== null && _b !== void 0 ? _b : PrefixRouterBase;
18
+ const baseName = (_b = (_a = (window.microApp && window.clientPrefix)) !== null && _a !== void 0 ? _a : window.prefix) !== null && _b !== void 0 ? _b : PrefixRouterBase;
19
19
  const routes = await (0, ssr_client_utils_1.preloadComponent)(FeRoutes, baseName);
20
20
  ReactDOM[window.__USE_SSR__ ? 'hydrate' : 'render'](React.createElement(react_router_dom_1.BrowserRouter, { basename: baseName },
21
21
  React.createElement(context_1.AppContext, null,
@@ -12,7 +12,7 @@ const clientRender = async () => {
12
12
  return props.children;
13
13
  };
14
14
  // 客户端渲染||hydrate
15
- const baseName = (_b = (_a = window.clientPrefix) !== null && _a !== void 0 ? _a : window.prefix) !== null && _b !== void 0 ? _b : PrefixRouterBase;
15
+ const baseName = (_b = (_a = (window.microApp && window.clientPrefix)) !== null && _a !== void 0 ? _a : window.prefix) !== null && _b !== void 0 ? _b : PrefixRouterBase;
16
16
  const routes = await preloadComponent(FeRoutes, baseName);
17
17
  ReactDOM[window.__USE_SSR__ ? 'hydrate' : 'render'](React.createElement(BrowserRouter, { basename: baseName },
18
18
  React.createElement(AppContext, null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssr-plugin-react",
3
- "version": "6.2.1",
3
+ "version": "6.2.4",
4
4
  "description": "plugin-react for ssr",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -55,10 +55,10 @@
55
55
  "postcss-safe-parser": "^6.0.0",
56
56
  "react-dev-utils": "^11.0.4",
57
57
  "serialize-javascript": "^6.0.0",
58
- "ssr-client-utils": "^6.2.1",
59
- "ssr-hoc-react": "^6.2.1",
60
- "ssr-server-utils": "^6.2.0",
61
- "ssr-webpack": "^6.2.1",
58
+ "ssr-client-utils": "^6.2.3",
59
+ "ssr-hoc-react": "^6.2.3",
60
+ "ssr-server-utils": "^6.2.4",
61
+ "ssr-webpack": "^6.2.4",
62
62
  "terser-webpack-plugin": "^2.3.5",
63
63
  "url-loader": "^4.1.1",
64
64
  "vite": "^2.7.0",
@@ -74,7 +74,7 @@
74
74
  "@types/react-router-dom": "^5.1.3",
75
75
  "@types/webpack": "^4.41.10",
76
76
  "concurrently": "^5.1.0",
77
- "ssr-types-react": "^6.2.1"
77
+ "ssr-types-react": "^6.2.3"
78
78
  },
79
- "gitHead": "63db30353d27f6ead84d5cca7374b63ebc8916c6"
79
+ "gitHead": "d7d13b088b03b20be02206b2ef4b879081b25f07"
80
80
  }
@@ -17,7 +17,7 @@ const clientRender = async (): Promise<void> => {
17
17
  return props.children!
18
18
  }
19
19
  // 客户端渲染||hydrate
20
- const baseName = window.clientPrefix ?? window.prefix ?? PrefixRouterBase
20
+ const baseName = (window.microApp && window.clientPrefix) ?? window.prefix ?? PrefixRouterBase
21
21
  const routes = await preloadComponent(FeRoutes, baseName)
22
22
  ReactDOM[window.__USE_SSR__ ? 'hydrate' : 'render'](
23
23
  <BrowserRouter basename={baseName}>