@modern-js/plugin-router-v5 2.17.0 → 2.18.0
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 +14 -0
- package/dist/esm/cli/index.js +6 -6
- package/dist/esm/runtime/plugin.js +5 -5
- package/dist/esm/runtime/utils.js +2 -2
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# @modern-js/plugin-router-v5
|
2
2
|
|
3
|
+
## 2.18.0
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- @modern-js/types@2.18.0
|
8
|
+
- @modern-js/utils@2.18.0
|
9
|
+
|
10
|
+
## 2.17.1
|
11
|
+
|
12
|
+
### Patch Changes
|
13
|
+
|
14
|
+
- @modern-js/types@2.17.1
|
15
|
+
- @modern-js/utils@2.17.1
|
16
|
+
|
3
17
|
## 2.17.0
|
4
18
|
|
5
19
|
### Patch Changes
|
package/dist/esm/cli/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
function _define_property(obj, key, value) {
|
2
2
|
if (key in obj) {
|
3
3
|
Object.defineProperty(obj, key, {
|
4
|
-
value,
|
4
|
+
value: value,
|
5
5
|
enumerable: true,
|
6
6
|
configurable: true,
|
7
7
|
writable: true
|
@@ -101,8 +101,8 @@ export default function() {
|
|
101
101
|
throw new Error("should enable runtime.router.mode for entry ".concat(entryName));
|
102
102
|
}
|
103
103
|
return {
|
104
|
-
entrypoint,
|
105
|
-
imports
|
104
|
+
entrypoint: entrypoint,
|
105
|
+
imports: imports
|
106
106
|
};
|
107
107
|
},
|
108
108
|
modifyEntryRuntimePlugins: function modifyEntryRuntimePlugins(param) {
|
@@ -122,15 +122,15 @@ export default function() {
|
|
122
122
|
plugins.push({
|
123
123
|
name: PLUGIN_IDENTIFIER,
|
124
124
|
options: JSON.stringify(_object_spread_props(_object_spread({
|
125
|
-
serverBase
|
125
|
+
serverBase: serverBase
|
126
126
|
}, runtimeConfig.router), {
|
127
127
|
routesConfig: fileSystemRoutes ? "{ ".concat(ROUTES_IDENTIFIER, ", globalApp: App }") : void 0
|
128
128
|
})).replace(/"routesConfig"\s*:\s*"((\S|\s)+)"/g, '"routesConfig": $1,')
|
129
129
|
});
|
130
130
|
}
|
131
131
|
return {
|
132
|
-
entrypoint,
|
133
|
-
plugins
|
132
|
+
entrypoint: entrypoint,
|
133
|
+
plugins: plugins
|
134
134
|
};
|
135
135
|
},
|
136
136
|
addRuntimeExports: function addRuntimeExports() {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
function _define_property(obj, key, value) {
|
2
2
|
if (key in obj) {
|
3
3
|
Object.defineProperty(obj, key, {
|
4
|
-
value,
|
4
|
+
value: value,
|
5
5
|
enumerable: true,
|
6
6
|
configurable: true,
|
7
7
|
writable: true
|
@@ -76,11 +76,11 @@ export var routerPlugin = function(param) {
|
|
76
76
|
init: function init(param2, next) {
|
77
77
|
var context = param2.context;
|
78
78
|
context.router = {
|
79
|
-
useRouteMatch,
|
80
|
-
useLocation
|
79
|
+
useRouteMatch: useRouteMatch,
|
80
|
+
useLocation: useLocation
|
81
81
|
};
|
82
82
|
return next({
|
83
|
-
context
|
83
|
+
context: context
|
84
84
|
});
|
85
85
|
},
|
86
86
|
hoc: function(param2, next) {
|
@@ -93,7 +93,7 @@ export var routerPlugin = function(param) {
|
|
93
93
|
var history = customHistory || (supportHtml5History ? createBrowserHistory(historyOptions) : createHashHistory(historyOptions));
|
94
94
|
return function(props) {
|
95
95
|
return /* @__PURE__ */ _jsx(Router, {
|
96
|
-
history,
|
96
|
+
history: history,
|
97
97
|
children: createRoutes ? /* @__PURE__ */ _jsx(App, _object_spread_props(_object_spread({}, props), {
|
98
98
|
Component: createRoutes()
|
99
99
|
})) : /* @__PURE__ */ _jsx(App, _object_spread_props(_object_spread({}, props), {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
function _define_property(obj, key, value) {
|
2
2
|
if (key in obj) {
|
3
3
|
Object.defineProperty(obj, key, {
|
4
|
-
value,
|
4
|
+
value: value,
|
5
5
|
enumerable: true,
|
6
6
|
configurable: true,
|
7
7
|
writable: true
|
@@ -75,7 +75,7 @@ export function renderRoutes(routesConfig) {
|
|
75
75
|
return /* @__PURE__ */ _jsx(Component, _object_spread({}, props));
|
76
76
|
}
|
77
77
|
return /* @__PURE__ */ _jsx(GlobalLayout, _object_spread({
|
78
|
-
Component
|
78
|
+
Component: Component
|
79
79
|
}, props));
|
80
80
|
};
|
81
81
|
var findMatchedRoute = function(pathname) {
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.18.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/types/cli/index.d.ts",
|
21
21
|
"main": "./dist/cjs/cli/index.js",
|
@@ -59,8 +59,8 @@
|
|
59
59
|
"history": "^4.7.9",
|
60
60
|
"hoist-non-react-statics": "^3.3.2",
|
61
61
|
"react-router-dom": "^5.3.4",
|
62
|
-
"@modern-js/types": "2.
|
63
|
-
"@modern-js/utils": "2.
|
62
|
+
"@modern-js/types": "2.18.0",
|
63
|
+
"@modern-js/utils": "2.18.0"
|
64
64
|
},
|
65
65
|
"peerDependencies": {
|
66
66
|
"react": ">=17",
|
@@ -78,12 +78,12 @@
|
|
78
78
|
"react-dom": "^18",
|
79
79
|
"ts-jest": "^29.0.4",
|
80
80
|
"typescript": "^4",
|
81
|
-
"@modern-js/app-tools": "2.
|
82
|
-
"@modern-js/core": "2.
|
83
|
-
"@modern-js/runtime": "2.
|
84
|
-
"@modern-js/utils": "2.
|
85
|
-
"@scripts/build": "2.
|
86
|
-
"@scripts/jest-config": "2.
|
81
|
+
"@modern-js/app-tools": "2.18.0",
|
82
|
+
"@modern-js/core": "2.18.0",
|
83
|
+
"@modern-js/runtime": "2.18.0",
|
84
|
+
"@modern-js/utils": "2.18.0",
|
85
|
+
"@scripts/build": "2.18.0",
|
86
|
+
"@scripts/jest-config": "2.18.0"
|
87
87
|
},
|
88
88
|
"sideEffects": false,
|
89
89
|
"modernConfig": {},
|