ssr-plugin-react 6.1.65 → 6.1.68

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.1.68](https://github.com/zhangyuang/ssr/compare/v6.1.67...v6.1.68) (2022-03-04)
7
+
8
+ **Note:** Version bump only for package ssr-plugin-react
9
+
10
+
11
+
12
+
13
+
14
+ ## [6.1.67](https://github.com/zhangyuang/ssr/compare/v6.1.66...v6.1.67) (2022-02-18)
15
+
16
+
17
+ ### Features
18
+
19
+ * transform route.ts by esbuild ([1719168](https://github.com/zhangyuang/ssr/commit/17191687db5dc6805b5bbcf5dcd8f80d8d29bbde))
20
+
21
+
22
+
23
+
24
+
25
+ ## [6.1.66](https://github.com/zhangyuang/ssr/compare/v6.1.65...v6.1.66) (2022-02-18)
26
+
27
+
28
+ ### Bug Fixes
29
+
30
+ * create-router ([ee9c3fa](https://github.com/zhangyuang/ssr/commit/ee9c3fa5fe14f8e324edcf5da64bf1dd8e041891))
31
+
32
+
33
+
34
+
35
+
6
36
  ## [6.1.65](https://github.com/zhangyuang/ssr/compare/v6.1.62...v6.1.65) (2022-02-17)
7
37
 
8
38
 
package/README.md CHANGED
@@ -188,7 +188,7 @@ $ npm run build # 资源构建,等价于 npx ssr build
188
188
  $ npm run start:vite # 以 vite 模式启动,等价于 npx ssr start --vite
189
189
  ```
190
190
 
191
- ![](http://doc.ssr-fc.com/images/resume3.svg)
191
+ ![](http://doc.ssr-fc.com/images/start-vite2.gif)
192
192
 
193
193
  ## 线上案例
194
194
 
@@ -271,7 +271,7 @@ $ npm run start:vite # 以 vite 模式启动,等价于 npx ssr start --vite
271
271
 
272
272
  <div style="display:flex">
273
273
  <!-- <img src="https://res.wx.qq.com/op_res/7F1t4Z8yCHWilehbcFGjAj0yVn0URMiWBGVJa-TVu_eqw5IwUXA2kPYBnfX6YRHy0FVBB-yC6l0IEL02QTJkLg" width="300"> -->
274
- <img src="https://res.wx.qq.com/op_res/yEMBkta89JhlC9RlNrTqXHshV4a6Wa-tBIBMZe9PjLoOJgtnLYjHQ4TQttfqJ4iYbqhSTEA4YI6TBWkO76-chA" width="300">
274
+ <img src="https://res.wx.qq.com/op_res/QAMR2cMecWSBwvxF-zDR9Rt2TfALiULQ5SQbagHYpceeisESp-BCPUwEX9N8Ty2Xu6sGSHrU6PCJyaL7-Ry1Qw" width="300">
275
275
  </div>
276
276
 
277
277
  ## 前端开发手册
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Routes = void 0;
4
4
  // @ts-expect-error
5
- const declareRoutes = require("_build/ssr-temporary-routes");
5
+ const declareRoutes = require("_build/ssr-declare-routes");
6
6
  // @ts-expect-error
7
7
  const ManualRoutes = require("_build/ssr-manual-routes");
8
8
  const declareRoutesWithType = declareRoutes;
@@ -13,12 +13,9 @@ const Routes = {
13
13
  };
14
14
  exports.Routes = Routes;
15
15
  if (ManualRoutesWithType.FeRoutes) {
16
- // 如果存在相同 path,取声明式路由为最高优先级
17
- const combineRoutes = declareRoutesWithType.FeRoutes.map(route => {
18
- const found = ManualRoutesWithType.FeRoutes.find(e => e.path === route.path);
19
- return found !== null && found !== void 0 ? found : route;
20
- });
21
- declareRoutesWithType.FeRoutes.forEach(route => {
16
+ // 声明式路由覆盖约定式路由同名path
17
+ const combineRoutes = declareRoutesWithType.FeRoutes.map(route => { var _a; return (_a = ManualRoutesWithType.FeRoutes.find(e => e.path === route.path)) !== null && _a !== void 0 ? _a : route; });
18
+ ManualRoutesWithType.FeRoutes.forEach(route => {
22
19
  // 补充声明式路由新增的配置
23
20
  const found = combineRoutes.find(e => e.path === route.path);
24
21
  if (!found) {
package/cjs/tools/vite.js CHANGED
@@ -42,12 +42,12 @@ const serverConfig = {
42
42
  build: {
43
43
  ssr: reactServerEntry,
44
44
  outDir: serverOutPut,
45
- rollupOptions: Object.assign(isDev ? { input: reactClientEntry } : {}, // setting prebundle list by client-entry in dev
46
- {
45
+ rollupOptions: {
46
+ input: isDev ? reactClientEntry : reactServerEntry,
47
47
  output: {
48
48
  entryFileNames: 'Page.server.js'
49
49
  }
50
- })
50
+ }
51
51
  },
52
52
  define: {
53
53
  __isBrowser__: false,
@@ -1,5 +1,5 @@
1
1
  // @ts-expect-error
2
- import * as declareRoutes from '_build/ssr-temporary-routes';
2
+ import * as declareRoutes from '_build/ssr-declare-routes';
3
3
  // @ts-expect-error
4
4
  import * as ManualRoutes from '_build/ssr-manual-routes';
5
5
  const declareRoutesWithType = declareRoutes;
@@ -9,12 +9,9 @@ const Routes = {
9
9
  ...ManualRoutesWithType
10
10
  };
11
11
  if (ManualRoutesWithType.FeRoutes) {
12
- // 如果存在相同 path,取声明式路由为最高优先级
13
- const combineRoutes = declareRoutesWithType.FeRoutes.map(route => {
14
- const found = ManualRoutesWithType.FeRoutes.find(e => e.path === route.path);
15
- return found !== null && found !== void 0 ? found : route;
16
- });
17
- declareRoutesWithType.FeRoutes.forEach(route => {
12
+ // 声明式路由覆盖约定式路由同名path
13
+ const combineRoutes = declareRoutesWithType.FeRoutes.map(route => { var _a; return (_a = ManualRoutesWithType.FeRoutes.find(e => e.path === route.path)) !== null && _a !== void 0 ? _a : route; });
14
+ ManualRoutesWithType.FeRoutes.forEach(route => {
18
15
  // 补充声明式路由新增的配置
19
16
  const found = combineRoutes.find(e => e.path === route.path);
20
17
  if (!found) {
package/esm/tools/vite.js CHANGED
@@ -39,12 +39,12 @@ const serverConfig = {
39
39
  build: {
40
40
  ssr: reactServerEntry,
41
41
  outDir: serverOutPut,
42
- rollupOptions: Object.assign(isDev ? { input: reactClientEntry } : {}, // setting prebundle list by client-entry in dev
43
- {
42
+ rollupOptions: {
43
+ input: isDev ? reactClientEntry : reactServerEntry,
44
44
  output: {
45
45
  entryFileNames: 'Page.server.js'
46
46
  }
47
- })
47
+ }
48
48
  },
49
49
  define: {
50
50
  __isBrowser__: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssr-plugin-react",
3
- "version": "6.1.65",
3
+ "version": "6.1.68",
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": "4.0.1",
56
56
  "react-dev-utils": "^11.0.4",
57
57
  "serialize-javascript": "^6.0.0",
58
- "ssr-client-utils": "^6.1.62",
59
- "ssr-hoc-react": "^6.1.65",
60
- "ssr-server-utils": "^6.1.65",
61
- "ssr-webpack": "^6.1.65",
58
+ "ssr-client-utils": "^6.1.68",
59
+ "ssr-hoc-react": "^6.1.68",
60
+ "ssr-server-utils": "^6.1.68",
61
+ "ssr-webpack": "^6.1.68",
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.1.62"
77
+ "ssr-types-react": "^6.1.68"
78
78
  },
79
- "gitHead": "21a0f367b85a4aaab35fc35465ee62facaf2ff16"
79
+ "gitHead": "8d25fd2e480f1e6477ee3ec51f1c082a017099e8"
80
80
  }
@@ -1,5 +1,5 @@
1
1
  // @ts-expect-error
2
- import * as declareRoutes from '_build/ssr-temporary-routes'
2
+ import * as declareRoutes from '_build/ssr-declare-routes'
3
3
  // @ts-expect-error
4
4
  import * as ManualRoutes from '_build/ssr-manual-routes'
5
5
  import { ReactRoutesType } from 'ssr-types-react'
@@ -12,12 +12,9 @@ const Routes: ReactRoutesType = {
12
12
  ...ManualRoutesWithType
13
13
  }
14
14
  if (ManualRoutesWithType.FeRoutes) {
15
- // 如果存在相同 path,取声明式路由为最高优先级
16
- const combineRoutes = declareRoutesWithType.FeRoutes.map(route => {
17
- const found = ManualRoutesWithType.FeRoutes.find(e => e.path === route.path)
18
- return found ?? route
19
- })
20
- declareRoutesWithType.FeRoutes.forEach(route => {
15
+ // 声明式路由覆盖约定式路由同名path
16
+ const combineRoutes = declareRoutesWithType.FeRoutes.map(route => ManualRoutesWithType.FeRoutes.find(e => e.path === route.path) ?? route)
17
+ ManualRoutesWithType.FeRoutes.forEach(route => {
21
18
  // 补充声明式路由新增的配置
22
19
  const found = combineRoutes.find(e => e.path === route.path)
23
20
  if (!found) {
package/src/tools/vite.ts CHANGED
@@ -40,14 +40,12 @@ const serverConfig: UserConfig = {
40
40
  build: {
41
41
  ssr: reactServerEntry,
42
42
  outDir: serverOutPut,
43
- rollupOptions: Object.assign(
44
- isDev ? { input: reactClientEntry } : {}, // setting prebundle list by client-entry in dev
45
- {
46
- output: {
47
- entryFileNames: 'Page.server.js'
48
- }
43
+ rollupOptions: {
44
+ input: isDev ? reactClientEntry : reactServerEntry, // setting prebundle list by client-entry in dev
45
+ output: {
46
+ entryFileNames: 'Page.server.js'
49
47
  }
50
- )
48
+ }
51
49
  },
52
50
  define: {
53
51
  __isBrowser__: false,