@modern-js/runtime 2.22.2-alpha.0 → 2.22.2-alpha.1

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.
@@ -113,7 +113,8 @@ const routerPlugin = ({ serverBase = [], supportHtml5History = true, basename =
113
113
  const originSubscribe = router.subscribe;
114
114
  router.subscribe = (listener) => {
115
115
  const wrapedListener = (...args) => {
116
- const blockRoute = runtimeContext.unstable_blockRoute;
116
+ const getBlockNavState = runtimeContext.unstable_getBlockNavState;
117
+ const blockRoute = getBlockNavState ? getBlockNavState() : false;
117
118
  if (blockRoute) {
118
119
  return;
119
120
  }
@@ -98,7 +98,8 @@ export var routerPlugin = function(param) {
98
98
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
99
99
  args[_key] = arguments[_key];
100
100
  }
101
- var blockRoute = runtimeContext.unstable_blockRoute;
101
+ var getBlockNavState = runtimeContext.unstable_getBlockNavState;
102
+ var blockRoute = getBlockNavState ? getBlockNavState() : false;
102
103
  if (blockRoute) {
103
104
  return;
104
105
  }
@@ -86,7 +86,8 @@ export const routerPlugin = ({ serverBase = [], supportHtml5History = true, base
86
86
  const originSubscribe = router.subscribe;
87
87
  router.subscribe = (listener) => {
88
88
  const wrapedListener = (...args) => {
89
- const blockRoute = runtimeContext.unstable_blockRoute;
89
+ const getBlockNavState = runtimeContext.unstable_getBlockNavState;
90
+ const blockRoute = getBlockNavState ? getBlockNavState() : false;
90
91
  if (blockRoute) {
91
92
  return;
92
93
  }
@@ -20,7 +20,7 @@ export interface BaseRuntimeContext {
20
20
  /**
21
21
  * private
22
22
  */
23
- unstable_blockRoute?: boolean;
23
+ unstable_getBlockNavState?: () => boolean;
24
24
  }
25
25
  export interface RuntimeContext extends BaseRuntimeContext {
26
26
  [key: string]: any;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.22.2-alpha.0",
18
+ "version": "2.22.2-alpha.1",
19
19
  "engines": {
20
20
  "node": ">=14.17.6"
21
21
  },
@@ -169,9 +169,9 @@
169
169
  "redux-logger": "^3.0.6",
170
170
  "styled-components": "^5.3.1",
171
171
  "@swc/helpers": "0.5.1",
172
+ "@modern-js/plugin": "2.22.1",
172
173
  "@modern-js/types": "2.22.1",
173
- "@modern-js/utils": "2.22.1",
174
- "@modern-js/plugin": "2.22.1"
174
+ "@modern-js/utils": "2.22.1"
175
175
  },
176
176
  "peerDependencies": {
177
177
  "react": ">=17",
@@ -192,10 +192,10 @@
192
192
  "ts-jest": "^29.1.0",
193
193
  "typescript": "^5",
194
194
  "webpack": "^5.82.1",
195
- "@modern-js/core": "2.22.1",
196
- "@modern-js/server-core": "2.22.1",
197
195
  "@modern-js/app-tools": "2.22.1",
196
+ "@modern-js/core": "2.22.1",
198
197
  "@scripts/build": "2.22.1",
198
+ "@modern-js/server-core": "2.22.1",
199
199
  "@scripts/jest-config": "2.22.1"
200
200
  },
201
201
  "sideEffects": false,