@modern-js/plugin-router-v5 2.46.1 → 2.47.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.
@@ -58,7 +58,8 @@ const routerPlugin = ({ serverBase = [], history: customHistory, supportHtml5His
|
|
58
58
|
init({ context }, next) {
|
59
59
|
context.router = {
|
60
60
|
useRouteMatch: import_react_router_dom.useRouteMatch,
|
61
|
-
useLocation: import_react_router_dom.useLocation
|
61
|
+
useLocation: import_react_router_dom.useLocation,
|
62
|
+
useHistory: import_react_router_dom.useHistory
|
62
63
|
};
|
63
64
|
Object.defineProperty(context, "routes", {
|
64
65
|
get() {
|
@@ -3,7 +3,7 @@ import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
4
4
|
import { useContext } from "react";
|
5
5
|
import { createBrowserHistory, createHashHistory } from "history";
|
6
|
-
import { Router, StaticRouter, useRouteMatch, useLocation } from "react-router-dom";
|
6
|
+
import { Router, StaticRouter, useRouteMatch, useLocation, useHistory } from "react-router-dom";
|
7
7
|
import hoistNonReactStatics from "hoist-non-react-statics";
|
8
8
|
import { RuntimeReactContext, isBrowser } from "@modern-js/runtime";
|
9
9
|
import { parsedJSONFromElement } from "@modern-js/runtime-utils/parsed";
|
@@ -33,7 +33,8 @@ var routerPlugin = function(param) {
|
|
33
33
|
var context = param2.context;
|
34
34
|
context.router = {
|
35
35
|
useRouteMatch,
|
36
|
-
useLocation
|
36
|
+
useLocation,
|
37
|
+
useHistory
|
37
38
|
};
|
38
39
|
Object.defineProperty(context, "routes", {
|
39
40
|
get: function get() {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import { useContext } from "react";
|
3
3
|
import { createBrowserHistory, createHashHistory } from "history";
|
4
|
-
import { Router, StaticRouter, useRouteMatch, useLocation } from "react-router-dom";
|
4
|
+
import { Router, StaticRouter, useRouteMatch, useLocation, useHistory } from "react-router-dom";
|
5
5
|
import hoistNonReactStatics from "hoist-non-react-statics";
|
6
6
|
import { RuntimeReactContext, isBrowser } from "@modern-js/runtime";
|
7
7
|
import { parsedJSONFromElement } from "@modern-js/runtime-utils/parsed";
|
@@ -25,7 +25,8 @@ const routerPlugin = ({ serverBase = [], history: customHistory, supportHtml5His
|
|
25
25
|
init({ context }, next) {
|
26
26
|
context.router = {
|
27
27
|
useRouteMatch,
|
28
|
-
useLocation
|
28
|
+
useLocation,
|
29
|
+
useHistory
|
29
30
|
};
|
30
31
|
Object.defineProperty(context, "routes", {
|
31
32
|
get() {
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.47.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",
|
@@ -60,10 +60,10 @@
|
|
60
60
|
"hoist-non-react-statics": "^3.3.2",
|
61
61
|
"react-router-dom": "^5.3.4",
|
62
62
|
"@swc/helpers": "0.5.3",
|
63
|
-
"@modern-js/plugin": "2.
|
64
|
-
"@modern-js/
|
65
|
-
"@modern-js/runtime-utils": "2.
|
66
|
-
"@modern-js/
|
63
|
+
"@modern-js/plugin": "2.47.0",
|
64
|
+
"@modern-js/utils": "2.47.0",
|
65
|
+
"@modern-js/runtime-utils": "2.47.0",
|
66
|
+
"@modern-js/types": "2.47.0"
|
67
67
|
},
|
68
68
|
"peerDependencies": {
|
69
69
|
"react": ">=17",
|
@@ -79,11 +79,11 @@
|
|
79
79
|
"react-dom": "^18",
|
80
80
|
"ts-jest": "^29.1.0",
|
81
81
|
"typescript": "^5",
|
82
|
-
"@modern-js/
|
83
|
-
"@modern-js/
|
84
|
-
"@modern-js/
|
85
|
-
"@scripts/
|
86
|
-
"@scripts/
|
82
|
+
"@modern-js/core": "2.47.0",
|
83
|
+
"@modern-js/runtime": "2.47.0",
|
84
|
+
"@modern-js/app-tools": "2.47.0",
|
85
|
+
"@scripts/jest-config": "2.47.0",
|
86
|
+
"@scripts/build": "2.47.0"
|
87
87
|
},
|
88
88
|
"sideEffects": false,
|
89
89
|
"publishConfig": {
|