ssr-plugin-react 6.2.18 → 6.2.19
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 +12 -0
- package/README.md +29 -18
- package/cjs/config/base.js +1 -3
- package/cjs/config/client.d.ts +0 -1
- package/cjs/entry/client-entry.js +1 -1
- package/cjs/entry/context.d.ts +0 -1
- package/esm/config/base.js +1 -3
- package/esm/config/client.d.ts +0 -1
- package/esm/entry/client-entry.js +2 -2
- package/esm/entry/context.d.ts +0 -1
- package/package.json +1 -1
- package/src/config/base.ts +1 -3
- package/src/entry/client-entry.tsx +3 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [6.2.19](https://github.com/zhangyuang/ssr/compare/plugin-react@6.2.18...plugin-react@6.2.19) (2022-05-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add ssr-common-utils ([c12a283](https://github.com/zhangyuang/ssr/commit/c12a283e0133285402f4af5cd0346b84f2aaf098))
|
|
7
|
+
* render add generic function overloading ([f03897f](https://github.com/zhangyuang/ssr/commit/f03897f07844d8fd5f9d2cf3eeef1a726da794bf))
|
|
8
|
+
* update chainBaseConfig ([51c1fbe](https://github.com/zhangyuang/ssr/commit/51c1fbe5a645d4701c7ebc035083096d50301891))
|
|
9
|
+
* update ssr-common-utils ([c7cadc1](https://github.com/zhangyuang/ssr/commit/c7cadc14922383f8fdaa6c76b4dbe9c220d0ac72))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
1
13
|
## [6.2.18](https://github.com/zhangyuang/ssr/compare/plugin-react@6.2.17...plugin-react@6.2.18) (2022-05-13)
|
|
2
14
|
|
|
3
15
|
|
package/README.md
CHANGED
|
@@ -51,31 +51,33 @@
|
|
|
51
51
|
<td align="center"><a target="_blank" href="http://youku.com/"><img src="https://img.alicdn.com/tfs/TB17DTuXkH0gK0jSZPiXXavapXa-680-133.svg" width="120"/><br />
|
|
52
52
|
<sub><b>优酷视频
|
|
53
53
|
</b></td>
|
|
54
|
-
<td align="center" style="width: 120px;"><a target="_blank" href="
|
|
54
|
+
<td align="center" style="width: 120px;"><a target="_blank" href="#"><img src="https://wxa-shop-1258344707.cos.ap-shanghai.myqcloud.com/test/cdn/c8e49fda-d8ef-4332-a2c0-8c9e571883f5.jpeg?sign=q-sign-algorithm%3Dsha1%26q-ak%3DAKIDtb4HEuJSLyJNCk11kCNHvIPGp8AvQfdK%26q-sign-time%3D1653378495%3B4294967040%26q-key-time%3D1653378495%3B4294967040%26q-header-list%3Dhost%26q-url-param-list%3D%26q-signature%3D2d09dc5ceec264a030da16b747477adf0ae5b647
|
|
55
|
+
" width="120"/><br><sub><b>微信公众平台
|
|
55
56
|
</b></sub></a></td>
|
|
57
|
+
<td align="center" style="height: 100px"><a href="#" target="_blank"><img src="https://res.wx.qq.com/op_res/wy4vvtyfqW8HjIfBKjba6TNEFBHuAApjJ1FjSQ37OVIdIYtylmiBm2ZeJ79SRtmT4IipU69bDNDw0Rrdnjd9yg
|
|
58
|
+
" width="200px;margin: 20px 0" /><br />
|
|
59
|
+
<a href="#" target="_bvlank"><b>腾讯体育
|
|
60
|
+
</b></a></td>
|
|
61
|
+
<td align="center" style="height: 100px"><a href="#" target="_blank"><img src="https://res.wx.qq.com/op_res/qc0sXfbvOvZFKVaDy9OLsqHfwHg6U4AemN2MP6YUxEo0EWpK6RyRcj70bIf3GEg5y_WA1wuv4HcfYi2FP7Awkw
|
|
62
|
+
" width="200px;margin: 20px 0" /><br />
|
|
63
|
+
<a href="#" target="_bvlank"><b>QQ会员
|
|
64
|
+
</b></a></td>
|
|
65
|
+
<td align="center" style="height: 100px"><a href="https://m.film.qq.com/x/tva-vip-center/" target="_blank"><img src="https://res.wx.qq.com/op_res/x7sWI9AfUK1QwH0EDhKp4e_bGWxYOQ_1RlZqBFy9JntJzaE4aRzNhVgmxLNloAFpSQ-mBr9X9pux3QlV9QHHvQ" width="200px;margin: 20px 0" /><br />
|
|
66
|
+
<a href="https://m.film.qq.com/x/tva-vip-center/" target="_bvlank"><b>腾讯视频
|
|
67
|
+
</b></a></td>
|
|
56
68
|
<td align="center"><a href="https://www.niuniuda.com/mall" target="_blank"><img src="https://img.alicdn.com/tfs/TB1df_8pBr0gK0jSZFnXXbRRXXa-160-60.png" width="120" alt="牛牛搭"/><br />
|
|
57
69
|
<a href="https://www.niuniuda.com/mall" target="_blank"><sub><b>牛牛搭
|
|
58
70
|
</b></a></td>
|
|
59
71
|
<td align="center"><a href="https://www.gszq.com/" target="_blank"><img src="https://www.gszq.com/static/media/icon-slogan.4d1c7974.png
|
|
60
|
-
" width="120"
|
|
72
|
+
" width="120"/><br />
|
|
61
73
|
<a href="https://www.gszq.com/" target="_bvlank"><sub><b>国盛证券
|
|
62
74
|
</b></a></td>
|
|
63
75
|
<td align="center"><a href="https://m.isle.org.cn" target="_blank"><img src="https://res.wx.qq.com/op_res/qzBjcpT1AZDopDDkEJfj5gKFADotYHTgD33lz9xvZUIj7VJaIR_8HE4lfOxwaiYBgi4V2xXm0xLmAcdQxF4IrQ" width="120" alt="三易科技"/><br />
|
|
64
76
|
<a href="https://m.isle.org.cn" target="_bvlank"><sub><b>三易科技
|
|
65
77
|
</b></a></td>
|
|
66
|
-
<td align="center"><a href="https://
|
|
67
|
-
</b></a></td>
|
|
68
|
-
<td align="center"><a href="https://wecard.qq.com/index/" target="_blank"><img src="https://img.alicdn.com/tfs/TB1pTZGrFT7gK0jSZFpXXaTkpXa-164-164.jpg" width="120" alt="腾讯微卡"/><br />
|
|
78
|
+
<td align="center"><a href="https://wecard.qq.com/index/" target="_blank"><img src="https://img.alicdn.com/tfs/TB1pTZGrFT7gK0jSZFpXXaTkpXa-164-164.jpg" width="120"/><br />
|
|
69
79
|
<a href="https://wecard.qq.com/index/" target="_blank"><sub><b>腾讯微卡
|
|
70
80
|
</b></a></td>
|
|
71
|
-
<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
|
|
72
|
-
" width="200px;margin: 20px 0" alt="Happy"/><br />
|
|
73
|
-
<a href="https://www.habisummercamp.com/" target="_bvlank"><b>HappyPC
|
|
74
|
-
</b></a></td>
|
|
75
|
-
<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
|
|
76
|
-
" width="200px;margin: 20px 0" alt="Happy"/><br />
|
|
77
|
-
<a href="https://m.habisummercamp.com/" target="_bvlank"><b>HappyMobile
|
|
78
|
-
</b></a></td>
|
|
79
81
|
</tr>
|
|
80
82
|
<tr>
|
|
81
83
|
<td align="center"><a href="https://syzs.qq.com/" target="_blank"><img src="images/syzs.png" width="120" alt="腾讯手游助手"/><br />
|
|
@@ -88,12 +90,9 @@
|
|
|
88
90
|
</b></sub></a></td>
|
|
89
91
|
<td align="center"><a target="_blank" href="http://tx.ssr-fc.com/"><img src="http://s0.60logo.com/uploads/items/images/soft/180126/tengxunyun.svg" width="120"/><br><sub><b>部署于腾讯云示例应用
|
|
90
92
|
</b></sub></a></td>
|
|
91
|
-
<td align="center"><a href="https://www.100.com/" target="_blank"><img src="https://oss.bs2dl.100.com/hippo/config/f13ee98cfca7ce13888752c1261081b44bd356fd.png" width="120"
|
|
93
|
+
<td align="center"><a href="https://www.100.com/" target="_blank"><img src="https://oss.bs2dl.100.com/hippo/config/f13ee98cfca7ce13888752c1261081b44bd356fd.png" width="120" /><br />
|
|
92
94
|
<a href="https://www.100.com/" target="_bvlank"><sub><b>100教育
|
|
93
95
|
</b></a></td>
|
|
94
|
-
<td align="center" style="height: 100px"><a href="https://m.film.qq.com/x/tva-vip-center/" target="_blank"><img src="https://res.wx.qq.com/op_res/x7sWI9AfUK1QwH0EDhKp4e_bGWxYOQ_1RlZqBFy9JntJzaE4aRzNhVgmxLNloAFpSQ-mBr9X9pux3QlV9QHHvQ" width="200px;margin: 20px 0" alt="腾讯视频"/><br />
|
|
95
|
-
<a href="https://m.film.qq.com/x/tva-vip-center/" target="_bvlank"><b>腾讯视频
|
|
96
|
-
</b></a></td>
|
|
97
96
|
<td align="center" style="height: 100px"><a href="https://blog.dreamer2q.wang/" target="_blank"><img src="https://res.wx.qq.com/op_res/MxxGgjPFRiTgjiReUefs2aMce-SgNvxxTB9U87YYhcOu6KPw9er7r2Lc0ne-b90nFstTUpc8REDwpxfUreKV1g" width="200px;margin: 20px 0" alt="Dream2qBlog"/><br />
|
|
98
97
|
<a href="https://blog.dreamer2q.wang/" target="_bvlank"><b>个人博客
|
|
99
98
|
</b></a></td>
|
|
@@ -105,18 +104,30 @@
|
|
|
105
104
|
</b></a></td>
|
|
106
105
|
</tr>
|
|
107
106
|
<tr>
|
|
107
|
+
<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
|
|
108
|
+
" width="200px;margin: 20px 0" alt="Happy"/><br />
|
|
109
|
+
<a href="https://www.habisummercamp.com/" target="_bvlank"><b>HappyPC
|
|
110
|
+
</b></a></td>
|
|
111
|
+
<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
|
|
112
|
+
" width="200px;margin: 20px 0" alt="Happy"/><br />
|
|
113
|
+
<a href="https://m.habisummercamp.com/" target="_bvlank"><b>HappyMobile
|
|
114
|
+
</b></a></td>
|
|
115
|
+
<td align="center" style="width: 120px;"><a target="_blank" href="https://yulebao.alibaba.com/"><img src="https://gw.alicdn.com/tfs/TB1CmlIIFT7gK0jSZFpXXaTkpXa-190-46.png" width="120"/><br><sub><b>阿里影业娱乐宝
|
|
116
|
+
</b></sub></a></td>
|
|
108
117
|
<td align="center"><a target="_blank" href="https://campaign.vmate.com/vrbollywood"><img src="https://img.alicdn.com/tfs/TB17p6Vhbj1gK0jSZFOXXc7GpXa-512-512.png" width="120" alt="vmate 积分商城"/><br />
|
|
109
118
|
<a target="_blank" href="https://job.alibaba.com/zhaopin/position_detail.htm?trace=qrcode_share&positionCode=GP524819"><sub><b>Vmate短视频
|
|
110
119
|
</b></a></td>
|
|
111
120
|
<td align="center"><a target="_blank" href="https://enjoysales.paat.com/"><img src="https://img.alicdn.com/tfs/TB1Ma0BiEY1gK0jSZFMXXaWcVXa-836-836.png" width="120" alt="火炽星原CRM"/><br />
|
|
112
121
|
<a target="_blank" href="https://enjoysales.paat.com/"><sub><b>火炽星原CRM
|
|
113
122
|
</b></a></td>
|
|
114
|
-
<td align="center" style="height: 100px"><a href="https://www.paixin.com/" target="_blank"><img src="https://www.paixin.com/favicon.ico" width="200px;margin: 20px 0"
|
|
123
|
+
<td align="center" style="height: 100px"><a href="https://www.paixin.com/" target="_blank"><img src="https://www.paixin.com/favicon.ico" width="200px;margin: 20px 0" /><br />
|
|
115
124
|
<a href="https://www.paixin.com/" target="_bvlank"><b>拍信创意
|
|
116
125
|
</b></a></td>
|
|
117
126
|
<td align="center"><a href="https://www.66tools.com/" target="_blank"><img src="https://cdn.66tools.com/extension/chrome_qrcode_avatar.png" width="120" alt="极速二维码"/><br />
|
|
118
127
|
<a href="https://www.66tools.com/" target="_bvlank"><sub><b>极速二维码
|
|
119
128
|
</b></a></td>
|
|
129
|
+
<td align="center"><a href="https://help.seewo.com/" target="_blank"><img src="https://img.alicdn.com/tfs/TB11Xo3q4v1gK0jSZFFXXb0sXXa-350-55.png" width="120" alt="cvte"/><br /><a href="https://help.seewo.com/" target="_blank"><sub><b>希沃帮助中心
|
|
130
|
+
</b></a></td>
|
|
120
131
|
</tr>
|
|
121
132
|
</table>
|
|
122
133
|
|
package/cjs/config/base.js
CHANGED
|
@@ -82,8 +82,6 @@ const getBaseConfig = (chain, isServer) => {
|
|
|
82
82
|
chain.module
|
|
83
83
|
.rule('mjs')
|
|
84
84
|
.test(/\.mjs/)
|
|
85
|
-
.include
|
|
86
|
-
.add(/node_modules/).end()
|
|
87
85
|
.type('javascript/auto')
|
|
88
86
|
.end();
|
|
89
87
|
const module = chain.module
|
|
@@ -134,7 +132,7 @@ const getBaseConfig = (chain, isServer) => {
|
|
|
134
132
|
...(isServer ? define === null || define === void 0 ? void 0 : define.server : define === null || define === void 0 ? void 0 : define.client),
|
|
135
133
|
...define === null || define === void 0 ? void 0 : define.base
|
|
136
134
|
}]);
|
|
137
|
-
chainBaseConfig(chain);
|
|
135
|
+
chainBaseConfig(chain, isServer);
|
|
138
136
|
return config;
|
|
139
137
|
};
|
|
140
138
|
exports.getBaseConfig = getBaseConfig;
|
package/cjs/config/client.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ const clientRender = async () => {
|
|
|
14
14
|
return props.children;
|
|
15
15
|
};
|
|
16
16
|
// 客户端渲染||hydrate
|
|
17
|
-
const baseName =
|
|
17
|
+
const baseName = (0, ssr_client_utils_1.isMicro)() ? window.clientPrefix : window.prefix;
|
|
18
18
|
const routes = await (0, ssr_client_utils_1.preloadComponent)(FeRoutes, baseName);
|
|
19
19
|
ReactDOM[window.__USE_SSR__ ? 'hydrate' : 'render'](React.createElement(react_router_dom_1.BrowserRouter, { basename: baseName },
|
|
20
20
|
React.createElement(context_1.AppContext, null,
|
package/cjs/entry/context.d.ts
CHANGED
package/esm/config/base.js
CHANGED
|
@@ -79,8 +79,6 @@ const getBaseConfig = (chain, isServer) => {
|
|
|
79
79
|
chain.module
|
|
80
80
|
.rule('mjs')
|
|
81
81
|
.test(/\.mjs/)
|
|
82
|
-
.include
|
|
83
|
-
.add(/node_modules/).end()
|
|
84
82
|
.type('javascript/auto')
|
|
85
83
|
.end();
|
|
86
84
|
const module = chain.module
|
|
@@ -131,7 +129,7 @@ const getBaseConfig = (chain, isServer) => {
|
|
|
131
129
|
...(isServer ? define === null || define === void 0 ? void 0 : define.server : define === null || define === void 0 ? void 0 : define.client),
|
|
132
130
|
...define === null || define === void 0 ? void 0 : define.base
|
|
133
131
|
}]);
|
|
134
|
-
chainBaseConfig(chain);
|
|
132
|
+
chainBaseConfig(chain, isServer);
|
|
135
133
|
return config;
|
|
136
134
|
};
|
|
137
135
|
export { getBaseConfig };
|
package/esm/config/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as ReactDOM from 'react-dom';
|
|
3
3
|
import { BrowserRouter, Route, Switch } from 'react-router-dom';
|
|
4
|
-
import { preloadComponent } from 'ssr-client-utils';
|
|
4
|
+
import { preloadComponent, isMicro } from 'ssr-client-utils';
|
|
5
5
|
import { wrapComponent } from 'ssr-hoc-react';
|
|
6
6
|
import { Routes } from './create-router';
|
|
7
7
|
import { AppContext } from './context';
|
|
@@ -11,7 +11,7 @@ const clientRender = async () => {
|
|
|
11
11
|
return props.children;
|
|
12
12
|
};
|
|
13
13
|
// 客户端渲染||hydrate
|
|
14
|
-
const baseName =
|
|
14
|
+
const baseName = isMicro() ? window.clientPrefix : window.prefix;
|
|
15
15
|
const routes = await preloadComponent(FeRoutes, baseName);
|
|
16
16
|
ReactDOM[window.__USE_SSR__ ? 'hydrate' : 'render'](React.createElement(BrowserRouter, { basename: baseName },
|
|
17
17
|
React.createElement(AppContext, null,
|
package/esm/entry/context.d.ts
CHANGED
package/package.json
CHANGED
package/src/config/base.ts
CHANGED
|
@@ -88,8 +88,6 @@ const getBaseConfig = (chain: WebpackChain, isServer: boolean) => {
|
|
|
88
88
|
chain.module
|
|
89
89
|
.rule('mjs')
|
|
90
90
|
.test(/\.mjs/)
|
|
91
|
-
.include
|
|
92
|
-
.add(/node_modules/).end()
|
|
93
91
|
.type('javascript/auto')
|
|
94
92
|
.end()
|
|
95
93
|
|
|
@@ -147,7 +145,7 @@ const getBaseConfig = (chain: WebpackChain, isServer: boolean) => {
|
|
|
147
145
|
...(isServer ? define?.server : define?.client),
|
|
148
146
|
...define?.base
|
|
149
147
|
}])
|
|
150
|
-
chainBaseConfig(chain)
|
|
148
|
+
chainBaseConfig(chain, isServer)
|
|
151
149
|
return config
|
|
152
150
|
}
|
|
153
151
|
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import * as ReactDOM from 'react-dom'
|
|
3
3
|
import { BrowserRouter, Route, Switch } from 'react-router-dom'
|
|
4
|
-
import { preloadComponent } from 'ssr-client-utils'
|
|
4
|
+
import { preloadComponent, isMicro } from 'ssr-client-utils'
|
|
5
5
|
import { wrapComponent } from 'ssr-hoc-react'
|
|
6
|
-
import {
|
|
6
|
+
import { LayoutProps, ReactRoutesType } from 'ssr-types-react'
|
|
7
7
|
import { Routes } from './create-router'
|
|
8
8
|
import { AppContext } from './context'
|
|
9
9
|
|
|
10
10
|
const { FeRoutes, layoutFetch, App } = Routes as ReactRoutesType
|
|
11
11
|
|
|
12
|
-
declare const window: IWindow
|
|
13
|
-
|
|
14
12
|
const clientRender = async (): Promise<void> => {
|
|
15
13
|
const IApp = App ?? function (props: LayoutProps) {
|
|
16
14
|
return props.children!
|
|
17
15
|
}
|
|
18
16
|
// 客户端渲染||hydrate
|
|
19
|
-
const baseName =
|
|
17
|
+
const baseName = isMicro() ? window.clientPrefix : window.prefix
|
|
20
18
|
const routes = await preloadComponent(FeRoutes, baseName)
|
|
21
19
|
ReactDOM[window.__USE_SSR__ ? 'hydrate' : 'render'](
|
|
22
20
|
<BrowserRouter basename={baseName}>
|