@modern-js/plugin-router-v5 0.0.0-nightly-20230913160551 → 0.0.0-nightly-20230914160548
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.
@@ -16,7 +16,7 @@ const _history = require("history");
|
|
16
16
|
const _reactrouterdom = require("react-router-dom");
|
17
17
|
const _hoistnonreactstatics = /* @__PURE__ */ _interop_require_default._(require("hoist-non-react-statics"));
|
18
18
|
const _runtime = require("@modern-js/runtime");
|
19
|
-
const
|
19
|
+
const _browser = require("@modern-js/runtime-utils/browser");
|
20
20
|
const _utils = require("./utils");
|
21
21
|
const _hooks = require("./hooks");
|
22
22
|
const routerPlugin = ({ serverBase = [], history: customHistory, supportHtml5History = true, routesConfig, createRoutes, historyOptions = {} }) => {
|
@@ -26,7 +26,7 @@ const routerPlugin = ({ serverBase = [], history: customHistory, supportHtml5His
|
|
26
26
|
const select = (pathname) => serverBase.find((baseUrl) => pathname.search(baseUrl) === 0) || "/";
|
27
27
|
let routes = [];
|
28
28
|
if (isBrow) {
|
29
|
-
window._SERVER_DATA = (0,
|
29
|
+
window._SERVER_DATA = (0, _browser.parsedJSONFromElement)("__MODERN_SERVER_DATA__");
|
30
30
|
}
|
31
31
|
return {
|
32
32
|
name: "@modern-js/plugin-router",
|
@@ -6,7 +6,7 @@ import { createBrowserHistory, createHashHistory } from "history";
|
|
6
6
|
import { Router, StaticRouter, useRouteMatch, useLocation } from "react-router-dom";
|
7
7
|
import hoistNonReactStatics from "hoist-non-react-statics";
|
8
8
|
import { RuntimeReactContext, isBrowser } from "@modern-js/runtime";
|
9
|
-
import { parsedJSONFromElement } from "@modern-js/utils/
|
9
|
+
import { parsedJSONFromElement } from "@modern-js/runtime-utils/browser";
|
10
10
|
import { renderRoutes, getLocation, urlJoin } from "./utils";
|
11
11
|
import { modifyRoutesHook } from "./hooks";
|
12
12
|
export var routerPlugin = function(param) {
|
@@ -4,7 +4,7 @@ import { createBrowserHistory, createHashHistory } from "history";
|
|
4
4
|
import { Router, StaticRouter, useRouteMatch, useLocation } from "react-router-dom";
|
5
5
|
import hoistNonReactStatics from "hoist-non-react-statics";
|
6
6
|
import { RuntimeReactContext, isBrowser } from "@modern-js/runtime";
|
7
|
-
import { parsedJSONFromElement } from "@modern-js/utils/
|
7
|
+
import { parsedJSONFromElement } from "@modern-js/runtime-utils/browser";
|
8
8
|
import { renderRoutes, getLocation, urlJoin } from "./utils";
|
9
9
|
import { modifyRoutesHook } from "./hooks";
|
10
10
|
export const routerPlugin = ({ serverBase = [], history: customHistory, supportHtml5History = true, routesConfig, createRoutes, historyOptions = {} }) => {
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "0.0.0-nightly-
|
18
|
+
"version": "0.0.0-nightly-20230914160548",
|
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,9 +60,9 @@
|
|
60
60
|
"hoist-non-react-statics": "^3.3.2",
|
61
61
|
"react-router-dom": "^5.3.4",
|
62
62
|
"@swc/helpers": "0.5.1",
|
63
|
-
"@modern-js/plugin": "0.0.0-nightly-
|
64
|
-
"@modern-js/types": "0.0.0-nightly-
|
65
|
-
"@modern-js/utils": "0.0.0-nightly-
|
63
|
+
"@modern-js/plugin": "0.0.0-nightly-20230914160548",
|
64
|
+
"@modern-js/types": "0.0.0-nightly-20230914160548",
|
65
|
+
"@modern-js/utils": "0.0.0-nightly-20230914160548"
|
66
66
|
},
|
67
67
|
"peerDependencies": {
|
68
68
|
"react": ">=17",
|
@@ -78,12 +78,13 @@
|
|
78
78
|
"react-dom": "^18",
|
79
79
|
"ts-jest": "^29.1.0",
|
80
80
|
"typescript": "^5",
|
81
|
-
"@modern-js/app-tools": "0.0.0-nightly-
|
82
|
-
"@modern-js/core": "0.0.0-nightly-
|
83
|
-
"@modern-js/runtime": "0.0.0-nightly-
|
84
|
-
"@modern-js/utils": "0.0.0-nightly-
|
85
|
-
"@
|
86
|
-
"@scripts/
|
81
|
+
"@modern-js/app-tools": "0.0.0-nightly-20230914160548",
|
82
|
+
"@modern-js/core": "0.0.0-nightly-20230914160548",
|
83
|
+
"@modern-js/runtime": "0.0.0-nightly-20230914160548",
|
84
|
+
"@modern-js/utils": "0.0.0-nightly-20230914160548",
|
85
|
+
"@modern-js/runtime-utils": "0.0.0-nightly-20230914160548",
|
86
|
+
"@scripts/build": "0.0.0-nightly-20230914160548",
|
87
|
+
"@scripts/jest-config": "0.0.0-nightly-20230914160548"
|
87
88
|
},
|
88
89
|
"sideEffects": false,
|
89
90
|
"publishConfig": {
|