ssr-plugin-react 6.1.8 → 6.1.9
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 +11 -0
- package/README.md +9 -1
- package/cjs/entry/server-entry.js +1 -1
- package/esm/entry/server-entry.js +1 -1
- package/package.json +4 -4
- package/src/entry/server-entry.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.1.9](https://github.com/zhangyuang/ssr/compare/ssr-plugin-react@6.1.8...ssr-plugin-react@6.1.9) (2021-12-02)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add location prop to StaticRouter ([#137](https://github.com/zhangyuang/ssr/issues/137)) ([301f997](https://github.com/zhangyuang/ssr/commit/301f9975ff08a94b8e792e36587c32796cf477ac))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [6.1.8](https://github.com/zhangyuang/ssr/compare/ssr-plugin-react@6.1.7...ssr-plugin-react@6.1.8) (2021-11-30)
|
|
7
18
|
|
|
8
19
|
|
package/README.md
CHANGED
|
@@ -106,6 +106,14 @@
|
|
|
106
106
|
<td align="center" style="height: 100px"><a href="https://jiawu.dewu.com" target="_blank"><img src="https://cdn.poizon.com/node-common/31116a45953ad8b468c6c832036aac88.png" width="200px;margin: 20px 0" alt="Dream2qBlog"/><br />
|
|
107
107
|
<a href="https://jiawu.dewu.com" target="_bvlank"><b>得物
|
|
108
108
|
</b></a></td>
|
|
109
|
+
<td align="center" style="height: 100px"><a href="https://www.habisummercamp.com/" target="_blank"><img src="https://res.wx.qq.com/op_res/XXUpF56bDue53vZadoCSPSnqKF3bZqPOQnqsPa_ngEARa0OUIW22pX7eKsftPb6pc5ny62cR_wXM4g5xJ7G3DQ
|
|
110
|
+
" width="200px;margin: 20px 0" alt="Dream2qBlog"/><br />
|
|
111
|
+
<a href="https://www.habisummercamp.com/" target="_bvlank"><b>HappyPC
|
|
112
|
+
</b></a></td>
|
|
113
|
+
<td align="center" style="height: 100px"><a href="https://m.habisummercamp.com/" target="_blank"><img src="https://res.wx.qq.com/op_res/XXUpF56bDue53vZadoCSPSnqKF3bZqPOQnqsPa_ngEARa0OUIW22pX7eKsftPb6pc5ny62cR_wXM4g5xJ7G3DQ
|
|
114
|
+
" width="200px;margin: 20px 0" alt="Dream2qBlog"/><br />
|
|
115
|
+
<a href="https://m.habisummercamp.com/" target="_bvlank"><b>HappyMobile
|
|
116
|
+
</b></a></td>
|
|
109
117
|
</tr>
|
|
110
118
|
</table>
|
|
111
119
|
|
|
@@ -262,7 +270,7 @@ $ npm run start:vite # 以 vite 模式启动,等价于 npx ssr start --vite
|
|
|
262
270
|
|
|
263
271
|
<div style="display:flex">
|
|
264
272
|
<img src="https://res.wx.qq.com/op_res/7F1t4Z8yCHWilehbcFGjAj0yVn0URMiWBGVJa-TVu_eqw5IwUXA2kPYBnfX6YRHy0FVBB-yC6l0IEL02QTJkLg" width="300">
|
|
265
|
-
<img src="https://res.wx.qq.com/op_res/
|
|
273
|
+
<img src="https://res.wx.qq.com/op_res/ECwdFhkCwm6NE1c_jP-DOYaVaR8K_ORJeEzFlDW9eBJj8igF3yeut9KnoChxyqJ4ReJogCG9bL_qZ3OYdZBI0w" width="300">
|
|
266
274
|
</div>
|
|
267
275
|
|
|
268
276
|
## 前端开发手册
|
|
@@ -97,7 +97,7 @@ const serverRender = async (ctx, config) => {
|
|
|
97
97
|
const injectState = isCsr ? null : React.createElement("script", { dangerouslySetInnerHTML: {
|
|
98
98
|
__html: `window.__USE_SSR__=true; window.__INITIAL_DATA__ =${serialize(combineData)}`
|
|
99
99
|
} });
|
|
100
|
-
return (React.createElement(react_router_dom_1.StaticRouter,
|
|
100
|
+
return (React.createElement(react_router_dom_1.StaticRouter, { location: ctx.request.url },
|
|
101
101
|
React.createElement(create_context_1.STORE_CONTEXT.Provider, { value: { state: combineData } },
|
|
102
102
|
React.createElement(index_tsx_1.default, { ctx: ctx, config: config, staticList: staticList, injectState: injectState }, isCsr ? React.createElement(React.Fragment, null) : React.createElement(Component, null)))));
|
|
103
103
|
};
|
|
@@ -94,7 +94,7 @@ const serverRender = async (ctx, config) => {
|
|
|
94
94
|
const injectState = isCsr ? null : React.createElement("script", { dangerouslySetInnerHTML: {
|
|
95
95
|
__html: `window.__USE_SSR__=true; window.__INITIAL_DATA__ =${serialize(combineData)}`
|
|
96
96
|
} });
|
|
97
|
-
return (React.createElement(StaticRouter,
|
|
97
|
+
return (React.createElement(StaticRouter, { location: ctx.request.url },
|
|
98
98
|
React.createElement(Context.Provider, { value: { state: combineData } },
|
|
99
99
|
React.createElement(Layout, { ctx: ctx, config: config, staticList: staticList, injectState: injectState }, isCsr ? React.createElement(React.Fragment, null) : React.createElement(Component, null)))));
|
|
100
100
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ssr-plugin-react",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.9",
|
|
4
4
|
"description": "plugin-react for ssr",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"serialize-javascript": "^3.0.0",
|
|
56
56
|
"ssr-client-utils": "^5.6.40",
|
|
57
57
|
"ssr-hoc-react": "^6.0.7",
|
|
58
|
-
"ssr-server-utils": "^5.7.
|
|
59
|
-
"ssr-webpack": "^5.7.
|
|
58
|
+
"ssr-server-utils": "^5.7.10",
|
|
59
|
+
"ssr-webpack": "^5.7.9",
|
|
60
60
|
"terser-webpack-plugin": "^2.3.5",
|
|
61
61
|
"url-loader": "^4.1.1",
|
|
62
62
|
"webpack-bundle-analyzer": "^3.6.1",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"@types/webpack": "^4.41.10",
|
|
73
73
|
"ssr-types-react": "^6.0.6"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "d13f3be99541ee9bcc9694aed1f642531f2680e4"
|
|
76
76
|
}
|
|
@@ -110,7 +110,7 @@ const serverRender = async (ctx: ISSRContext, config: IConfig): Promise<React.Re
|
|
|
110
110
|
}} />
|
|
111
111
|
|
|
112
112
|
return (
|
|
113
|
-
<StaticRouter>
|
|
113
|
+
<StaticRouter location={ctx.request.url}>
|
|
114
114
|
<Context.Provider value={{ state: combineData }}>
|
|
115
115
|
<Layout ctx={ctx} config={config} staticList={staticList} injectState={injectState}>
|
|
116
116
|
{isCsr ? <></> : <Component />}
|