@modern-js/runtime 2.69.0 → 2.69.2

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.
@@ -171,7 +171,7 @@ const documentPlugin = () => ({
171
171
  if (html.includes(import_constants.DOCUMENT_SCRIPT_PLACEHOLDER_START) && html.includes(import_constants.DOCUMENT_SCRIPT_PLACEHOLDER_END)) {
172
172
  const { nonce } = config.security || {};
173
173
  const nonceAttr = nonce ? `nonce=${nonce}` : "";
174
- html = html.replace(new RegExp(`${import_constants.DOCUMENT_SCRIPT_PLACEHOLDER_START}${import_constants.DOCUMENT_SCRIPT_ATTRIBUTES_START}(.*)${import_constants.DOCUMENT_SCRIPT_ATTRIBUTES_END}(.*?)${import_constants.DOCUMENT_SCRIPT_PLACEHOLDER_END}`, "g"), (_scriptStr, $1, $2) => `<script ${decodeURIComponent($1)} ${nonceAttr}>${decodeURIComponent($2)}</script>`);
174
+ html = html.replace(new RegExp(`${import_constants.DOCUMENT_SCRIPT_PLACEHOLDER_START}${import_constants.DOCUMENT_SCRIPT_ATTRIBUTES_START}(.*?)${import_constants.DOCUMENT_SCRIPT_ATTRIBUTES_END}(.*?)${import_constants.DOCUMENT_SCRIPT_PLACEHOLDER_END}`, "g"), (_scriptStr, $1, $2) => `<script ${decodeURIComponent($1)} ${nonceAttr}>${decodeURIComponent($2)}</script>`);
175
175
  }
176
176
  if (html.includes(import_constants.DOCUMENT_STYLE_PLACEHOLDER_START) && html.includes(import_constants.DOCUMENT_STYLE_PLACEHOLDER_END)) {
177
177
  html = html.replace(new RegExp(`${import_constants.DOCUMENT_STYLE_PLACEHOLDER_START}(.*?)${import_constants.DOCUMENT_STYLE_PLACEHOLDER_END}`, "g"), (_styleStr, $1) => `<style>${decodeURIComponent($1)}</style>`);
@@ -121,11 +121,7 @@ const routerPlugin = (userConfig = {}) => {
121
121
  basename,
122
122
  future
123
123
  });
124
- (0, import_react.useEffect)(() => {
125
- routesContainer.current = routes;
126
- }, [
127
- routes
128
- ]);
124
+ routesContainer.current = routes;
129
125
  beforeCreateRouter = false;
130
126
  const RouterContent = () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
131
127
  children: [
@@ -197,7 +197,7 @@ var documentPlugin = function() {
197
197
  if (html.includes(DOCUMENT_SCRIPT_PLACEHOLDER_START) && html.includes(DOCUMENT_SCRIPT_PLACEHOLDER_END)) {
198
198
  nonce = (config.security || {}).nonce;
199
199
  nonceAttr = nonce ? "nonce=".concat(nonce) : "";
200
- html = html.replace(new RegExp("".concat(DOCUMENT_SCRIPT_PLACEHOLDER_START).concat(DOCUMENT_SCRIPT_ATTRIBUTES_START, "(.*)").concat(DOCUMENT_SCRIPT_ATTRIBUTES_END, "(.*?)").concat(DOCUMENT_SCRIPT_PLACEHOLDER_END), "g"), function(_scriptStr, $1, $2) {
200
+ html = html.replace(new RegExp("".concat(DOCUMENT_SCRIPT_PLACEHOLDER_START).concat(DOCUMENT_SCRIPT_ATTRIBUTES_START, "(.*?)").concat(DOCUMENT_SCRIPT_ATTRIBUTES_END, "(.*?)").concat(DOCUMENT_SCRIPT_PLACEHOLDER_END), "g"), function(_scriptStr, $1, $2) {
201
201
  return "<script ".concat(decodeURIComponent($1), " ").concat(nonceAttr, ">").concat(decodeURIComponent($2), "</script>");
202
202
  });
203
203
  }
@@ -6,7 +6,7 @@ import { merge } from "@modern-js/runtime-utils/merge";
6
6
  import { RouterProvider, createBrowserRouter, createHashRouter, createRoutesFromElements, useHref, useLocation, useMatches } from "@modern-js/runtime-utils/router";
7
7
  import { normalizePathname } from "@modern-js/runtime-utils/url";
8
8
  import * as React from "react";
9
- import { useContext, useEffect, useMemo } from "react";
9
+ import { useContext, useMemo } from "react";
10
10
  import { RuntimeReactContext } from "../../core";
11
11
  import { getGlobalLayoutApp, getGlobalRoutes } from "../../core/context";
12
12
  import { getGlobalIsRscClient } from "../../core/context";
@@ -89,11 +89,7 @@ var routerPlugin = function() {
89
89
  basename,
90
90
  future
91
91
  }), router = _useRouterCreation.router, routes = _useRouterCreation.routes;
92
- useEffect(function() {
93
- routesContainer.current = routes;
94
- }, [
95
- routes
96
- ]);
92
+ routesContainer.current = routes;
97
93
  beforeCreateRouter = false;
98
94
  var RouterContent = function() {
99
95
  return /* @__PURE__ */ _jsxs(_Fragment, {
@@ -136,7 +136,7 @@ const documentPlugin = () => ({
136
136
  if (html.includes(DOCUMENT_SCRIPT_PLACEHOLDER_START) && html.includes(DOCUMENT_SCRIPT_PLACEHOLDER_END)) {
137
137
  const { nonce } = config.security || {};
138
138
  const nonceAttr = nonce ? `nonce=${nonce}` : "";
139
- html = html.replace(new RegExp(`${DOCUMENT_SCRIPT_PLACEHOLDER_START}${DOCUMENT_SCRIPT_ATTRIBUTES_START}(.*)${DOCUMENT_SCRIPT_ATTRIBUTES_END}(.*?)${DOCUMENT_SCRIPT_PLACEHOLDER_END}`, "g"), (_scriptStr, $1, $2) => `<script ${decodeURIComponent($1)} ${nonceAttr}>${decodeURIComponent($2)}</script>`);
139
+ html = html.replace(new RegExp(`${DOCUMENT_SCRIPT_PLACEHOLDER_START}${DOCUMENT_SCRIPT_ATTRIBUTES_START}(.*?)${DOCUMENT_SCRIPT_ATTRIBUTES_END}(.*?)${DOCUMENT_SCRIPT_PLACEHOLDER_END}`, "g"), (_scriptStr, $1, $2) => `<script ${decodeURIComponent($1)} ${nonceAttr}>${decodeURIComponent($2)}</script>`);
140
140
  }
141
141
  if (html.includes(DOCUMENT_STYLE_PLACEHOLDER_START) && html.includes(DOCUMENT_STYLE_PLACEHOLDER_END)) {
142
142
  html = html.replace(new RegExp(`${DOCUMENT_STYLE_PLACEHOLDER_START}(.*?)${DOCUMENT_STYLE_PLACEHOLDER_END}`, "g"), (_styleStr, $1) => `<style>${decodeURIComponent($1)}</style>`);
@@ -3,7 +3,7 @@ import { merge } from "@modern-js/runtime-utils/merge";
3
3
  import { RouterProvider, createBrowserRouter, createHashRouter, createRoutesFromElements, useHref, useLocation, useMatches } from "@modern-js/runtime-utils/router";
4
4
  import { normalizePathname } from "@modern-js/runtime-utils/url";
5
5
  import * as React from "react";
6
- import { useContext, useEffect, useMemo } from "react";
6
+ import { useContext, useMemo } from "react";
7
7
  import { RuntimeReactContext } from "../../core";
8
8
  import { getGlobalLayoutApp, getGlobalRoutes } from "../../core/context";
9
9
  import { getGlobalIsRscClient } from "../../core/context";
@@ -85,11 +85,7 @@ const routerPlugin = (userConfig = {}) => {
85
85
  basename,
86
86
  future
87
87
  });
88
- useEffect(() => {
89
- routesContainer.current = routes;
90
- }, [
91
- routes
92
- ]);
88
+ routesContainer.current = routes;
93
89
  beforeCreateRouter = false;
94
90
  const RouterContent = () => /* @__PURE__ */ _jsxs(_Fragment, {
95
91
  children: [
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.69.0",
18
+ "version": "2.69.2",
19
19
  "engines": {
20
20
  "node": ">=14.17.6"
21
21
  },
@@ -219,13 +219,13 @@
219
219
  "react-is": "^18",
220
220
  "react-side-effect": "^2.1.2",
221
221
  "styled-components": "^5.3.1",
222
- "@modern-js/plugin": "2.69.0",
223
- "@modern-js/plugin-data-loader": "2.69.0",
224
- "@modern-js/plugin-v2": "2.69.0",
225
- "@modern-js/render": "2.69.0",
226
- "@modern-js/types": "2.69.0",
227
- "@modern-js/runtime-utils": "2.69.0",
228
- "@modern-js/utils": "2.69.0"
222
+ "@modern-js/plugin": "2.69.2",
223
+ "@modern-js/plugin-v2": "2.69.2",
224
+ "@modern-js/plugin-data-loader": "2.69.2",
225
+ "@modern-js/render": "2.69.2",
226
+ "@modern-js/runtime-utils": "2.69.2",
227
+ "@modern-js/types": "2.69.2",
228
+ "@modern-js/utils": "2.69.2"
229
229
  },
230
230
  "peerDependencies": {
231
231
  "react": ">=17",
@@ -233,7 +233,7 @@
233
233
  },
234
234
  "devDependencies": {
235
235
  "@remix-run/web-fetch": "^4.1.3",
236
- "@rsbuild/core": "1.6.7",
236
+ "@rsbuild/core": "1.6.12",
237
237
  "@testing-library/react": "^13.4.0",
238
238
  "@types/cookie": "0.6.0",
239
239
  "@types/invariant": "^2.2.30",
@@ -248,11 +248,11 @@
248
248
  "ts-jest": "^29.1.0",
249
249
  "ts-node": "^10.9.1",
250
250
  "typescript": "^5",
251
- "webpack": "^5.102.1",
252
- "@scripts/build": "2.66.0",
253
- "@modern-js/app-tools": "2.69.0",
251
+ "webpack": "^5.103.0",
252
+ "@modern-js/app-tools": "2.69.2",
254
253
  "@scripts/jest-config": "2.66.0",
255
- "@modern-js/core": "2.69.0"
254
+ "@scripts/build": "2.66.0",
255
+ "@modern-js/core": "2.69.2"
256
256
  },
257
257
  "sideEffects": false,
258
258
  "publishConfig": {