ssr-plugin-react 6.1.65 → 6.1.66

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,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.66](https://github.com/zhangyuang/ssr/compare/v6.1.65...v6.1.66) (2022-02-18)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * create-router ([ee9c3fa](https://github.com/zhangyuang/ssr/commit/ee9c3fa5fe14f8e324edcf5da64bf1dd8e041891))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [6.1.65](https://github.com/zhangyuang/ssr/compare/v6.1.62...v6.1.65) (2022-02-17)
7
18
 
8
19
 
@@ -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) {
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssr-plugin-react",
3
- "version": "6.1.65",
3
+ "version": "6.1.66",
4
4
  "description": "plugin-react for ssr",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -76,5 +76,5 @@
76
76
  "concurrently": "^5.1.0",
77
77
  "ssr-types-react": "^6.1.62"
78
78
  },
79
- "gitHead": "21a0f367b85a4aaab35fc35465ee62facaf2ff16"
79
+ "gitHead": "820d4b06b19190d48dc0bf29b11a40732f6ba40b"
80
80
  }
@@ -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) {