@modern-js/runtime 2.64.0 → 2.64.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.
@@ -28,7 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var browser_exports = {};
30
30
  __export(browser_exports, {
31
- render: () => render
31
+ hydrateWithReact17: () => hydrateWithReact17,
32
+ hydrateWithReact18: () => hydrateWithReact18,
33
+ render: () => render,
34
+ renderWithReact17: () => renderWithReact17,
35
+ renderWithReact18: () => renderWithReact18
32
36
  });
33
37
  module.exports = __toCommonJS(browser_exports);
34
38
  var import_cookie = __toESM(require("cookie"));
@@ -156,5 +160,9 @@ async function hydrateWithReact17(App, rootElement, callback) {
156
160
  }
157
161
  // Annotate the CommonJS export names for ESM import in node:
158
162
  0 && (module.exports = {
159
- render
163
+ hydrateWithReact17,
164
+ hydrateWithReact18,
165
+ render,
166
+ renderWithReact17,
167
+ renderWithReact18
160
168
  });
@@ -33,8 +33,8 @@ const statePlugin = () => ({
33
33
  api._internalRuntimePlugins(({ entrypoint, plugins }) => {
34
34
  var _getEntryOptions;
35
35
  const { entryName, isMainEntry } = entrypoint;
36
- const userConfig = api.useResolvedConfigContext();
37
- const { packageName, metaName } = api.useAppContext();
36
+ const userConfig = api.getNormalizedConfig();
37
+ const { packageName, metaName } = api.getAppContext();
38
38
  const stateConfig = (_getEntryOptions = (0, import_utils.getEntryOptions)(entryName, isMainEntry, userConfig.runtime, userConfig.runtimeByEntries, packageName)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
39
39
  if (stateConfig) {
40
40
  plugins.push({
@@ -272,5 +272,9 @@ function _hydrateWithReact17() {
272
272
  return _hydrateWithReact17.apply(this, arguments);
273
273
  }
274
274
  export {
275
- render
275
+ hydrateWithReact17,
276
+ hydrateWithReact18,
277
+ render,
278
+ renderWithReact17,
279
+ renderWithReact18
276
280
  };
@@ -11,8 +11,8 @@ var statePlugin = function() {
11
11
  var entrypoint = param.entrypoint, plugins = param.plugins;
12
12
  var _getEntryOptions;
13
13
  var entryName = entrypoint.entryName, isMainEntry = entrypoint.isMainEntry;
14
- var userConfig = api.useResolvedConfigContext();
15
- var _api_useAppContext = api.useAppContext(), packageName = _api_useAppContext.packageName, metaName = _api_useAppContext.metaName;
14
+ var userConfig = api.getNormalizedConfig();
15
+ var _api_getAppContext = api.getAppContext(), packageName = _api_getAppContext.packageName, metaName = _api_getAppContext.metaName;
16
16
  var stateConfig = (_getEntryOptions = getEntryOptions(entryName, isMainEntry, userConfig.runtime, userConfig.runtimeByEntries, packageName)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
17
17
  if (stateConfig) {
18
18
  plugins.push({
@@ -122,5 +122,9 @@ async function hydrateWithReact17(App, rootElement, callback) {
122
122
  return root;
123
123
  }
124
124
  export {
125
- render
125
+ hydrateWithReact17,
126
+ hydrateWithReact18,
127
+ render,
128
+ renderWithReact17,
129
+ renderWithReact18
126
130
  };
@@ -9,8 +9,8 @@ const statePlugin = () => ({
9
9
  api._internalRuntimePlugins(({ entrypoint, plugins }) => {
10
10
  var _getEntryOptions;
11
11
  const { entryName, isMainEntry } = entrypoint;
12
- const userConfig = api.useResolvedConfigContext();
13
- const { packageName, metaName } = api.useAppContext();
12
+ const userConfig = api.getNormalizedConfig();
13
+ const { packageName, metaName } = api.getAppContext();
14
14
  const stateConfig = (_getEntryOptions = getEntryOptions(entryName, isMainEntry, userConfig.runtime, userConfig.runtimeByEntries, packageName)) === null || _getEntryOptions === void 0 ? void 0 : _getEntryOptions.state;
15
15
  if (stateConfig) {
16
16
  plugins.push({
@@ -1,4 +1,4 @@
1
- import type { RuntimePlugin } from '@modern-js/app-tools';
1
+ import type { RuntimePluginConfig } from '@modern-js/app-tools';
2
2
  export declare const index: ({ srcDirectory, internalSrcAlias, metaName, entry, entryName, customEntry, customBootstrap, mountId, }: {
3
3
  srcDirectory: string;
4
4
  internalSrcAlias: string;
@@ -16,7 +16,7 @@ export declare const runtimeRegister: ({ entryName, srcDirectory, internalSrcAli
16
16
  internalSrcAlias: string;
17
17
  metaName: string;
18
18
  runtimeConfigFile: string | false;
19
- runtimePlugins: RuntimePlugin[];
19
+ runtimePlugins: RuntimePluginConfig[];
20
20
  }) => string;
21
21
  export declare const runtimeGlobalContext: ({ srcDirectory, internalSrcAlias, metaName, entry, customEntry, }: {
22
22
  srcDirectory: string;
@@ -1,3 +1,7 @@
1
1
  import type React from 'react';
2
2
  export type RenderFunc = typeof render;
3
3
  export declare function render(App: React.ReactElement, id?: HTMLElement | string): Promise<HTMLElement | import("react-dom/client").Root>;
4
+ export declare function renderWithReact18(App: React.ReactElement, rootElement: HTMLElement): Promise<import("react-dom/client").Root>;
5
+ export declare function renderWithReact17(App: React.ReactElement, rootElement: HTMLElement): Promise<HTMLElement>;
6
+ export declare function hydrateWithReact18(App: React.ReactElement, rootElement: HTMLElement): Promise<import("react-dom/client").Root>;
7
+ export declare function hydrateWithReact17(App: React.ReactElement, rootElement: HTMLElement, callback?: () => void): Promise<any>;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.64.0",
18
+ "version": "2.64.1",
19
19
  "engines": {
20
20
  "node": ">=14.17.6"
21
21
  },
@@ -200,12 +200,12 @@
200
200
  "react-is": "^18",
201
201
  "react-side-effect": "^2.1.1",
202
202
  "styled-components": "^5.3.1",
203
- "@modern-js/plugin": "2.64.0",
204
- "@modern-js/plugin-data-loader": "2.64.0",
205
- "@modern-js/plugin-v2": "2.64.0",
206
- "@modern-js/runtime-utils": "2.64.0",
207
- "@modern-js/utils": "2.64.0",
208
- "@modern-js/types": "2.64.0"
203
+ "@modern-js/plugin": "2.64.1",
204
+ "@modern-js/plugin-v2": "2.64.1",
205
+ "@modern-js/plugin-data-loader": "2.64.1",
206
+ "@modern-js/types": "2.64.1",
207
+ "@modern-js/runtime-utils": "2.64.1",
208
+ "@modern-js/utils": "2.64.1"
209
209
  },
210
210
  "peerDependencies": {
211
211
  "react": ">=17",
@@ -229,9 +229,9 @@
229
229
  "ts-node": "^10.9.1",
230
230
  "typescript": "^5",
231
231
  "webpack": "^5.97.1",
232
- "@modern-js/app-tools": "2.64.0",
233
- "@scripts/build": "2.64.0",
234
- "@scripts/jest-config": "2.64.0"
232
+ "@modern-js/app-tools": "2.64.1",
233
+ "@scripts/build": "2.64.1",
234
+ "@scripts/jest-config": "2.64.1"
235
235
  },
236
236
  "sideEffects": false,
237
237
  "publishConfig": {