@modern-js/plugin-router-v5 2.0.0-beta.5 → 2.0.0-beta.6

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.
@@ -23,12 +23,7 @@ import {
23
23
  createBrowserHistory,
24
24
  createHashHistory
25
25
  } from "history";
26
- import {
27
- Router,
28
- StaticRouter,
29
- useRouteMatch,
30
- useLocation
31
- } from "react-router-dom";
26
+ import { Router, StaticRouter } from "react-router-dom";
32
27
  import hoistNonReactStatics from "hoist-non-react-statics";
33
28
  import { RuntimeReactContext, isBrowser } from "@modern-js/runtime";
34
29
  import { renderRoutes, getLocation, urlJoin } from "./utils";
@@ -45,13 +40,6 @@ const routerPlugin = ({
45
40
  name: "@modern-js/plugin-router",
46
41
  setup: () => {
47
42
  return {
48
- init({ context }, next) {
49
- context.router = {
50
- useRouteMatch,
51
- useLocation
52
- };
53
- return next({ context });
54
- },
55
43
  hoc: ({ App }, next) => {
56
44
  const getRouteApp = () => {
57
45
  var _a;
@@ -63,13 +63,6 @@ const routerPlugin = ({
63
63
  name: "@modern-js/plugin-router",
64
64
  setup: () => {
65
65
  return {
66
- init({ context }, next) {
67
- context.router = {
68
- useRouteMatch: import_react_router_dom.useRouteMatch,
69
- useLocation: import_react_router_dom.useLocation
70
- };
71
- return next({ context });
72
- },
73
66
  hoc: ({ App }, next) => {
74
67
  const getRouteApp = () => {
75
68
  var _a;
@@ -53,7 +53,7 @@ function _objectSpreadProps(target, source) {
53
53
  import { jsx } from "react/jsx-runtime";
54
54
  import { useContext } from "react";
55
55
  import { createBrowserHistory, createHashHistory } from "history";
56
- import { Router, StaticRouter, useRouteMatch, useLocation } from "react-router-dom";
56
+ import { Router, StaticRouter } from "react-router-dom";
57
57
  import hoistNonReactStatics from "hoist-non-react-statics";
58
58
  import { RuntimeReactContext, isBrowser } from "@modern-js/runtime";
59
59
  import { renderRoutes, getLocation, urlJoin } from "./utils";
@@ -69,16 +69,6 @@ var routerPlugin = function(param) {
69
69
  name: "@modern-js/plugin-router",
70
70
  setup: function() {
71
71
  return {
72
- init: function init(param, next) {
73
- var context = param.context;
74
- context.router = {
75
- useRouteMatch: useRouteMatch,
76
- useLocation: useLocation
77
- };
78
- return next({
79
- context: context
80
- });
81
- },
82
72
  hoc: function(param, next) {
83
73
  var App = param.App;
84
74
  var getRouteApp = function() {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.0-beta.5",
14
+ "version": "2.0.0-beta.6",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/cli/index.d.ts",
17
17
  "main": "./dist/js/node/cli/index.js",
@@ -51,12 +51,12 @@
51
51
  "dependencies": {
52
52
  "history": "^4.7.9",
53
53
  "react-router-dom": "^5.1.2",
54
- "@modern-js/plugin": "2.0.0-beta.4",
55
- "@modern-js/utils": "2.0.0-beta.4",
56
- "@modern-js/types": "2.0.0-beta.4",
57
54
  "hoist-non-react-statics": "^3.3.2",
58
55
  "@types/history": "^4.7.9",
59
- "@types/react-router-dom": "^5.1.8"
56
+ "@types/react-router-dom": "^5.1.8",
57
+ "@modern-js/plugin": "2.0.0-beta.6",
58
+ "@modern-js/utils": "2.0.0-beta.6",
59
+ "@modern-js/types": "2.0.0-beta.6"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "react": ">=17",
@@ -68,19 +68,19 @@
68
68
  "ts-jest": "^27.0.4",
69
69
  "typescript": "^4",
70
70
  "jest": "^27",
71
- "@modern-js/runtime": "2.0.0-beta.5",
72
- "@modern-js/core": "2.0.0-beta.4",
73
- "@modern-js/utils": "2.0.0-beta.4",
74
71
  "@babel/core": "^7.18.0",
75
72
  "@babel/runtime": "^7.18.0",
76
73
  "@types/jest": "^27",
77
74
  "@types/node": "^14",
78
- "@scripts/build": "2.0.0-beta.4",
79
- "@modern-js/app-tools": "2.0.0-beta.4",
80
- "@scripts/jest-config": "2.0.0-beta.4",
81
75
  "@testing-library/react": "^13.4.0",
82
76
  "@testing-library/react-hooks": "^8.0.1",
83
- "@types/invariant": "^2.2.30"
77
+ "@types/invariant": "^2.2.30",
78
+ "@modern-js/runtime": "2.0.0-beta.6",
79
+ "@modern-js/core": "2.0.0-beta.6",
80
+ "@modern-js/utils": "2.0.0-beta.6",
81
+ "@scripts/build": "2.0.0-beta.6",
82
+ "@modern-js/app-tools": "2.0.0-beta.6",
83
+ "@scripts/jest-config": "2.0.0-beta.6"
84
84
  },
85
85
  "sideEffects": false,
86
86
  "modernConfig": {},