@bleedingdev/modern-js-runtime 3.2.0-ultramodern.0 → 3.2.0-ultramodern.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.
Files changed (139) hide show
  1. package/package.json +9 -9
  2. package/dist/types/cache/index.d.ts +0 -1
  3. package/dist/types/cli/alias.d.ts +0 -7
  4. package/dist/types/cli/code.d.ts +0 -3
  5. package/dist/types/cli/constants.d.ts +0 -9
  6. package/dist/types/cli/entry.d.ts +0 -2
  7. package/dist/types/cli/index.d.ts +0 -11
  8. package/dist/types/cli/ssr/index.d.ts +0 -6
  9. package/dist/types/cli/ssr/loadable-bundler-plugin.d.ts +0 -31
  10. package/dist/types/cli/ssr/mode.d.ts +0 -15
  11. package/dist/types/cli/template.d.ts +0 -50
  12. package/dist/types/cli/template.server.d.ts +0 -20
  13. package/dist/types/common.d.ts +0 -8
  14. package/dist/types/core/browser/hydrate.d.ts +0 -5
  15. package/dist/types/core/browser/index.d.ts +0 -9
  16. package/dist/types/core/browser/withCallback.d.ts +0 -5
  17. package/dist/types/core/compat/hooks.d.ts +0 -4
  18. package/dist/types/core/compat/index.d.ts +0 -2
  19. package/dist/types/core/compat/requestContext.d.ts +0 -5
  20. package/dist/types/core/config.d.ts +0 -6
  21. package/dist/types/core/constants.d.ts +0 -6
  22. package/dist/types/core/context/index.d.ts +0 -50
  23. package/dist/types/core/context/monitors/default.d.ts +0 -2
  24. package/dist/types/core/context/monitors/index.d.ts +0 -1
  25. package/dist/types/core/context/monitors/index.server.d.ts +0 -2
  26. package/dist/types/core/context/request/index.d.ts +0 -1
  27. package/dist/types/core/context/request/index.server.d.ts +0 -1
  28. package/dist/types/core/context/response/index.d.ts +0 -4
  29. package/dist/types/core/context/response/index.server.d.ts +0 -7
  30. package/dist/types/core/context/runtime.d.ts +0 -42
  31. package/dist/types/core/context/serverPayload/index.d.ts +0 -4
  32. package/dist/types/core/context/serverPayload/index.server.d.ts +0 -31
  33. package/dist/types/core/index.d.ts +0 -5
  34. package/dist/types/core/plugin/index.d.ts +0 -4
  35. package/dist/types/core/plugin/types.d.ts +0 -10
  36. package/dist/types/core/react/index.d.ts +0 -2
  37. package/dist/types/core/react/wrapper.d.ts +0 -3
  38. package/dist/types/core/server/constants.d.ts +0 -4
  39. package/dist/types/core/server/helmet.d.ts +0 -3
  40. package/dist/types/core/server/index.d.ts +0 -4
  41. package/dist/types/core/server/react/index.d.ts +0 -2
  42. package/dist/types/core/server/react/no-ssr-cache/index.d.ts +0 -2
  43. package/dist/types/core/server/react/nossr/index.d.ts +0 -4
  44. package/dist/types/core/server/requestHandler.d.ts +0 -13
  45. package/dist/types/core/server/server.d.ts +0 -4
  46. package/dist/types/core/server/shared.d.ts +0 -8
  47. package/dist/types/core/server/stream/afterTemplate.d.ts +0 -13
  48. package/dist/types/core/server/stream/beforeTemplate.d.ts +0 -9
  49. package/dist/types/core/server/stream/createReadableStream.d.ts +0 -2
  50. package/dist/types/core/server/stream/createReadableStream.worker.d.ts +0 -2
  51. package/dist/types/core/server/stream/deferredScript.d.ts +0 -15
  52. package/dist/types/core/server/stream/index.d.ts +0 -1
  53. package/dist/types/core/server/stream/shared.d.ts +0 -33
  54. package/dist/types/core/server/stream/template.d.ts +0 -9
  55. package/dist/types/core/server/string/index.d.ts +0 -2
  56. package/dist/types/core/server/string/loadable.d.ts +0 -36
  57. package/dist/types/core/server/string/ssrData.d.ts +0 -20
  58. package/dist/types/core/server/string/types.d.ts +0 -12
  59. package/dist/types/core/server/tracer.d.ts +0 -17
  60. package/dist/types/core/server/utils.d.ts +0 -29
  61. package/dist/types/core/types.d.ts +0 -49
  62. package/dist/types/document/Body.d.ts +0 -2
  63. package/dist/types/document/Comment.d.ts +0 -5
  64. package/dist/types/document/DocumentContext.d.ts +0 -13
  65. package/dist/types/document/DocumentStructureContext.d.ts +0 -12
  66. package/dist/types/document/Head.d.ts +0 -5
  67. package/dist/types/document/Html.d.ts +0 -4
  68. package/dist/types/document/Links.d.ts +0 -2
  69. package/dist/types/document/Root.d.ts +0 -7
  70. package/dist/types/document/Script.d.ts +0 -4
  71. package/dist/types/document/Scripts.d.ts +0 -2
  72. package/dist/types/document/Style.d.ts +0 -5
  73. package/dist/types/document/Title.d.ts +0 -1
  74. package/dist/types/document/cli/index.d.ts +0 -5
  75. package/dist/types/document/constants.d.ts +0 -25
  76. package/dist/types/document/index.d.ts +0 -12
  77. package/dist/types/exports/config-routes.d.ts +0 -9
  78. package/dist/types/exports/head.d.ts +0 -4
  79. package/dist/types/exports/loadable.d.ts +0 -3
  80. package/dist/types/exports/tanstack-router.d.ts +0 -5
  81. package/dist/types/index.d.ts +0 -10
  82. package/dist/types/internal.d.ts +0 -2
  83. package/dist/types/react-server.d.ts +0 -3
  84. package/dist/types/router/cli/code/getClientRoutes/getRoutes.d.ts +0 -8
  85. package/dist/types/router/cli/code/getClientRoutes/index.d.ts +0 -1
  86. package/dist/types/router/cli/code/getClientRoutes/utils.d.ts +0 -4
  87. package/dist/types/router/cli/code/index.d.ts +0 -12
  88. package/dist/types/router/cli/code/inspect.d.ts +0 -22
  89. package/dist/types/router/cli/code/makeLegalIdentifier.d.ts +0 -1
  90. package/dist/types/router/cli/code/nestedRoutes.d.ts +0 -13
  91. package/dist/types/router/cli/code/tanstackTypes.d.ts +0 -10
  92. package/dist/types/router/cli/code/templates.d.ts +0 -28
  93. package/dist/types/router/cli/code/utils.d.ts +0 -12
  94. package/dist/types/router/cli/config-routes/converter.d.ts +0 -15
  95. package/dist/types/router/cli/config-routes/parseRouteConfig.d.ts +0 -32
  96. package/dist/types/router/cli/constants.d.ts +0 -31
  97. package/dist/types/router/cli/entry.d.ts +0 -18
  98. package/dist/types/router/cli/handler.d.ts +0 -28
  99. package/dist/types/router/cli/index.d.ts +0 -5
  100. package/dist/types/router/index.d.ts +0 -1
  101. package/dist/types/router/internal.d.ts +0 -2
  102. package/dist/types/router/runtime/CSSLinks.d.ts +0 -9
  103. package/dist/types/router/runtime/DefaultNotFound.d.ts +0 -2
  104. package/dist/types/router/runtime/DeferredDataScripts.d.ts +0 -2
  105. package/dist/types/router/runtime/DeferredDataScripts.node.d.ts +0 -11
  106. package/dist/types/router/runtime/PrefetchLink.d.ts +0 -27
  107. package/dist/types/router/runtime/constants.d.ts +0 -146
  108. package/dist/types/router/runtime/hooks.d.ts +0 -18
  109. package/dist/types/router/runtime/index.d.ts +0 -7
  110. package/dist/types/router/runtime/internal.d.ts +0 -11
  111. package/dist/types/router/runtime/lifecycle.d.ts +0 -25
  112. package/dist/types/router/runtime/plugin.d.ts +0 -9
  113. package/dist/types/router/runtime/plugin.node.d.ts +0 -7
  114. package/dist/types/router/runtime/routerHelper.d.ts +0 -5
  115. package/dist/types/router/runtime/rsc-router.d.ts +0 -20
  116. package/dist/types/router/runtime/rsc.d.ts +0 -1
  117. package/dist/types/router/runtime/server.d.ts +0 -1
  118. package/dist/types/router/runtime/tanstack/basepathRewrite.d.ts +0 -8
  119. package/dist/types/router/runtime/tanstack/dataMutation.d.ts +0 -29
  120. package/dist/types/router/runtime/tanstack/plugin.d.ts +0 -6
  121. package/dist/types/router/runtime/tanstack/plugin.node.d.ts +0 -6
  122. package/dist/types/router/runtime/tanstack/prefetchLink.d.ts +0 -11
  123. package/dist/types/router/runtime/tanstack/routeTree.d.ts +0 -8
  124. package/dist/types/router/runtime/tanstack/rsc/ClientSlot.d.ts +0 -5
  125. package/dist/types/router/runtime/tanstack/rsc/CompositeComponent.d.ts +0 -3
  126. package/dist/types/router/runtime/tanstack/rsc/ReplayableStream.d.ts +0 -24
  127. package/dist/types/router/runtime/tanstack/rsc/RscNodeRenderer.d.ts +0 -5
  128. package/dist/types/router/runtime/tanstack/rsc/SlotContext.d.ts +0 -11
  129. package/dist/types/router/runtime/tanstack/rsc/client.d.ts +0 -11
  130. package/dist/types/router/runtime/tanstack/rsc/createRscProxy.d.ts +0 -7
  131. package/dist/types/router/runtime/tanstack/rsc/index.d.ts +0 -2
  132. package/dist/types/router/runtime/tanstack/rsc/server.d.ts +0 -14
  133. package/dist/types/router/runtime/tanstack/rsc/slotUsageSanitizer.d.ts +0 -2
  134. package/dist/types/router/runtime/tanstack/rsc/symbols.d.ts +0 -46
  135. package/dist/types/router/runtime/types.d.ts +0 -119
  136. package/dist/types/router/runtime/utils.d.ts +0 -48
  137. package/dist/types/router/runtime/withRouter.d.ts +0 -10
  138. package/dist/types/rsc/client.d.ts +0 -2
  139. package/dist/types/rsc/server.d.ts +0 -1
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.2.0-ultramodern.0",
20
+ "version": "3.2.0-ultramodern.1",
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
@@ -227,12 +227,12 @@
227
227
  "isbot": "5.1.40",
228
228
  "react-helmet": "^6.1.0",
229
229
  "react-is": "^19.2.6",
230
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.0",
231
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.0",
232
- "@modern-js/render": "npm:@bleedingdev/modern-js-render@3.2.0-ultramodern.0",
233
- "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.0",
234
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.0",
235
- "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.0"
230
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.2.0-ultramodern.1",
231
+ "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.2.0-ultramodern.1",
232
+ "@modern-js/render": "npm:@bleedingdev/modern-js-render@3.2.0-ultramodern.1",
233
+ "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.2.0-ultramodern.1",
234
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.2.0-ultramodern.1",
235
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.2.0-ultramodern.1"
236
236
  },
237
237
  "peerDependencies": {
238
238
  "react": "^19.2.6",
@@ -251,8 +251,8 @@
251
251
  "@typescript/native-preview": "7.0.0-dev.20260516.1",
252
252
  "react": "^19.2.6",
253
253
  "react-dom": "^19.2.6",
254
- "@scripts/rstest-config": "2.66.0",
255
- "@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.0"
254
+ "@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.2.0-ultramodern.1",
255
+ "@scripts/rstest-config": "2.66.0"
256
256
  },
257
257
  "sideEffects": false,
258
258
  "publishConfig": {
@@ -1 +0,0 @@
1
- export * from '@modern-js/runtime-utils/cache';
@@ -1,7 +0,0 @@
1
- import type { Entrypoint } from '@modern-js/types';
2
- import type { RsbuildPlugin } from '@rsbuild/core';
3
- export declare const builderPluginAlias: ({ entrypoints, internalDirectory, metaName, }: {
4
- entrypoints: Entrypoint[];
5
- internalDirectory: string;
6
- metaName: string;
7
- }) => RsbuildPlugin;
@@ -1,3 +0,0 @@
1
- import type { AppToolsContext, AppToolsFeatureHooks, AppToolsNormalizedConfig } from '@modern-js/app-tools';
2
- import type { Entrypoint } from '@modern-js/types';
3
- export declare const generateCode: (entrypoints: Entrypoint[], appContext: AppToolsContext, config: AppToolsNormalizedConfig, hooks: AppToolsFeatureHooks) => Promise<void>;
@@ -1,9 +0,0 @@
1
- export declare const APP_FILE_NAME = "App";
2
- export declare const ENTRY_POINT_FILE_NAME = "index.jsx";
3
- export declare const SERVER_ENTRY_POINT_FILE_NAME = "index.server.jsx";
4
- export declare const INDEX_FILE_NAME = "index";
5
- export declare const ENTRY_BOOTSTRAP_FILE_NAME = "bootstrap.jsx";
6
- export declare const ENTRY_SERVER_BOOTSTRAP_FILE_NAME = "bootstrap.server.jsx";
7
- export declare const ENTRY_POINT_RUNTIME_REGISTER_FILE_NAME = "runtime-register.js";
8
- export declare const ENTRY_POINT_RUNTIME_GLOBAL_CONTEXT_FILE_NAME = "runtime-global-context";
9
- export declare const ENTRY_POINT_REGISTER_FILE_NAME = "register.js";
@@ -1,2 +0,0 @@
1
- export declare const hasApp: (dir: string) => string | false;
2
- export declare const isRuntimeEntry: (dir: string) => string | false;
@@ -1,11 +0,0 @@
1
- import type { AppTools, CliPlugin } from '@modern-js/app-tools';
2
- import { documentPlugin } from '../document/cli';
3
- import { routerPlugin } from '../router/cli';
4
- import { ssrPlugin } from './ssr';
5
- export { getEntrypointRoutesDir, handleFileChange, handleGeneratorEntryCode, handleModifyEntrypoints, isRouteEntry, } from '../router/cli';
6
- export { isRuntimeEntry } from './entry';
7
- export { documentPlugin, routerPlugin, ssrPlugin };
8
- export declare const runtimePlugin: (params?: {
9
- plugins?: CliPlugin<AppTools>[];
10
- }) => CliPlugin<AppTools>;
11
- export default runtimePlugin;
@@ -1,6 +0,0 @@
1
- import type { AppTools, CliPlugin } from '@modern-js/app-tools';
2
- import type { MergedEnvironmentConfig } from '@rsbuild/core';
3
- type EnvironmentConfigLike = Partial<Pick<MergedEnvironmentConfig, 'output' | 'source' | 'tools'>>;
4
- export declare const shouldUseModuleFederationNodeOutput: (config: EnvironmentConfigLike) => boolean;
5
- export declare const ssrPlugin: () => CliPlugin<AppTools>;
6
- export default ssrPlugin;
@@ -1,31 +0,0 @@
1
- /**
2
- * The following code is modified based on
3
- * https://github.com/gregberge/loadable-components
4
- *
5
- * MIT Licensed
6
- * Author Greg Bergé
7
- * Copyright 2019 Greg Bergé
8
- * https://github.com/gregberge/loadable-components/blob/main/LICENSE
9
- */
10
- import type { Rspack } from '@modern-js/app-tools';
11
- interface LoadablePluginOptions {
12
- filename: string;
13
- path?: string;
14
- writeToDisk?: any;
15
- outputAsset?: boolean;
16
- chunkLoadingGlobal?: string;
17
- }
18
- type Compiler = Rspack.Compiler;
19
- type Compilation = Rspack.Compilation;
20
- declare class LoadablePlugin {
21
- opts: LoadablePluginOptions;
22
- compiler: Compiler | null;
23
- constructor({ filename, path, writeToDisk, outputAsset, chunkLoadingGlobal, }?: LoadablePluginOptions);
24
- apply(compiler: Compiler): void;
25
- handleEmit(compilation: Compilation): {
26
- source(): string;
27
- size(): number;
28
- } | null;
29
- writeAssetsFile(manifest: string): void;
30
- }
31
- export default LoadablePlugin;
@@ -1,15 +0,0 @@
1
- import type { AppToolsNormalizedConfig } from '@modern-js/app-tools';
2
- export type SSRMode = 'string' | 'stream' | false;
3
- /**
4
- * Unified SSR mode resolution function.
5
- * Priority:
6
- * 1. If SSG is enabled, use SSG configuration (SSG takes precedence over SSR when both are configured)
7
- * 2. User's explicit server.ssr/server.ssrByEntries config
8
- * 3. Otherwise return false (no SSR)
9
- */
10
- export declare function resolveSSRMode(params: {
11
- entry?: string;
12
- config: AppToolsNormalizedConfig;
13
- appDirectory?: string;
14
- nestedRoutesEntry?: string;
15
- }): SSRMode;
@@ -1,50 +0,0 @@
1
- import type { RuntimePluginConfig } from '@modern-js/app-tools';
2
- export declare const entryForCSRWithRSC: ({ metaName, entryName, urlPath, mountId, isNestedRouter, }: {
3
- metaName: string;
4
- entryName: string;
5
- urlPath?: string;
6
- mountId?: string;
7
- isNestedRouter?: string;
8
- }) => string;
9
- export declare const index: ({ srcDirectory, internalSrcAlias, metaName, entry, entryName, customEntry, mountId, enableRsc, isNestedRouter, }: {
10
- srcDirectory: string;
11
- internalSrcAlias: string;
12
- metaName: string;
13
- entry: string;
14
- entryName: string;
15
- customEntry?: boolean;
16
- mountId?: string;
17
- enableRsc?: boolean;
18
- isNestedRouter?: boolean;
19
- }) => string;
20
- export declare const register: () => string;
21
- export declare const runtimeRegister: ({ entryName, srcDirectory, internalSrcAlias, metaName, runtimeConfigFile, runtimePlugins, }: {
22
- entryName: string;
23
- srcDirectory: string;
24
- internalSrcAlias: string;
25
- metaName: string;
26
- runtimeConfigFile: string | false;
27
- runtimePlugins: RuntimePluginConfig[];
28
- }) => string;
29
- export declare const runtimeGlobalContext: ({ entryName, srcDirectory, internalSrcAlias, metaName, entry, customEntry, basename, }: {
30
- entryName: string;
31
- srcDirectory: string;
32
- internalSrcAlias: string;
33
- metaName: string;
34
- entry: string;
35
- customEntry?: boolean;
36
- basename?: string;
37
- }) => string;
38
- export declare const runtimeGlobalContextForRSCServer: ({ metaName, }: {
39
- metaName: string;
40
- }) => string;
41
- export declare const runtimeGlobalContextForRSCClient: ({ metaName, customEntry, }: {
42
- metaName: string;
43
- customEntry?: boolean;
44
- }) => string;
45
- export declare const AppProxyForRSC: ({ srcDirectory, internalSrcAlias, entry, customEntry, }: {
46
- srcDirectory: string;
47
- internalSrcAlias: string;
48
- entry: string;
49
- customEntry?: boolean;
50
- }) => string;
@@ -1,20 +0,0 @@
1
- type ServerIndexOptinos = GenHandlerCodeOptions & {
2
- entryName: string;
3
- };
4
- export declare const serverIndex: (options: ServerIndexOptinos) => string;
5
- export declare const entryForCSRWithRSC: ({ metaName, entryName, }: {
6
- metaName: string;
7
- entryName: string;
8
- }) => string;
9
- type GenHandlerCodeOptions = {
10
- customServerEntry?: string | false;
11
- srcDirectory: string;
12
- internalSrcAlias: string;
13
- entry: string;
14
- enableRsc?: boolean;
15
- } & TransformServerEntryOptions;
16
- type TransformServerEntryOptions = {
17
- metaName?: string;
18
- mode: 'string' | 'stream';
19
- };
20
- export {};
@@ -1,8 +0,0 @@
1
- import type { RuntimePlugin } from './core/plugin';
2
- export declare const isBrowser: () => boolean;
3
- export interface RuntimeConfig {
4
- plugins?: RuntimePlugin[];
5
- [key: string]: any;
6
- }
7
- export declare const JSX_SHELL_STREAM_END_MARK = "<!--<?- SHELL_STREAM_END ?>-->";
8
- export declare const ESCAPED_SHELL_STREAM_END_MARK = "&lt;!--&lt;?- SHELL_STREAM_END ?&gt;--&gt;";
@@ -1,5 +0,0 @@
1
- import type React from 'react';
2
- import type { Root } from 'react-dom/client';
3
- import type { TRuntimeContext } from '../context/runtime';
4
- export declare const isReact18: () => boolean;
5
- export declare function hydrateRoot(App: React.ReactElement, context: TRuntimeContext, ModernRender: (App: React.ReactElement) => Promise<HTMLElement | Root>, ModernHydrate: (App: React.ReactElement, callback?: () => void) => Promise<HTMLElement | Root>): Promise<HTMLElement | Root>;
@@ -1,9 +0,0 @@
1
- import type React from 'react';
2
- export type RenderFunc = typeof render;
3
- export declare function render(App: React.ReactElement<{
4
- basename: string;
5
- }>, id?: HTMLElement | string): Promise<HTMLElement | import("react-dom/client").Root>;
6
- export declare function renderWithReact18(App: React.ReactElement, rootElement: HTMLElement): Promise<import("react-dom/client").Root>;
7
- export declare function renderWithReact17(App: React.ReactElement, rootElement: HTMLElement): Promise<HTMLElement>;
8
- export declare function hydrateWithReact18(App: React.ReactElement, rootElement: HTMLElement): Promise<import("react-dom/client").Root>;
9
- export declare function hydrateWithReact17(App: React.ReactElement, rootElement: HTMLElement, callback?: () => void): Promise<any>;
@@ -1,5 +0,0 @@
1
- import type React from 'react';
2
- export declare const WithCallback: React.FC<{
3
- callback: () => void;
4
- children: React.ReactElement;
5
- }>;
@@ -1,4 +0,0 @@
1
- import type { TInternalRuntimeContext } from '../context';
2
- export declare function transformHookRunner(hookRunnerName: string): string;
3
- export declare function handleSetupResult(setupResult: Record<string, (...args: any) => any>, api: Record<string, any>): void;
4
- export declare function getHookRunners(runtimeContext: TInternalRuntimeContext): Record<string, any>;
@@ -1,2 +0,0 @@
1
- import type { RuntimePlugin } from '../plugin/types';
2
- export declare const compatPlugin: () => RuntimePlugin;
@@ -1,5 +0,0 @@
1
- import type { TInternalRuntimeContext } from '../context';
2
- import type { RuntimePlugin } from '../plugin/types';
3
- import type { RequestContext } from '../types';
4
- export declare const makeRequestContext: (context: TInternalRuntimeContext) => RequestContext;
5
- export declare const requestContextPlugin: () => RuntimePlugin;
@@ -1,6 +0,0 @@
1
- import type { RuntimeConfig } from '../common';
2
- /**
3
- * This function helps you to autocomplete configuration types.
4
- * It accepts a direct config object, or a function that returns a config.
5
- */
6
- export declare const defineRuntimeConfig: (config: RuntimeConfig | ((entryName: string) => RuntimeConfig)) => RuntimeConfig | ((entryName: string) => RuntimeConfig);
@@ -1,6 +0,0 @@
1
- export declare enum RenderLevel {
2
- CLIENT_RENDER = 0,
3
- SERVER_RENDER = 2
4
- }
5
- export declare const SSR_DATA_JSON_ID = "__MODERN_SSR_DATA__";
6
- export declare const ROUTER_DATA_JSON_ID = "__MODERN_ROUTER_DATA__";
@@ -1,50 +0,0 @@
1
- import type { InternalRuntimeContext } from '@modern-js/plugin';
2
- import type { NestedRoute, PageRoute } from '@modern-js/types';
3
- import type React from 'react';
4
- import type { RuntimeExtends } from '../plugin/types';
5
- import type { ServerPayload } from './serverPayload/index';
6
- export { getInitialContext, InternalRuntimeContext, RuntimeContext, type TInternalRuntimeContext, type TRuntimeContext, } from './runtime';
7
- export type { PayloadRoute, ServerPayload } from './serverPayload/index';
8
- interface GlobalContext {
9
- entryName?: string;
10
- /**
11
- * App.tsx export default component
12
- */
13
- App?: React.ComponentType;
14
- /**
15
- * nest router and page router config
16
- */
17
- routes?: (NestedRoute | PageRoute)[];
18
- /**
19
- * nest router init function
20
- */
21
- appInit?: () => Promise<unknown>;
22
- /**
23
- * page router _app.tsx export layout app
24
- */
25
- layoutApp?: React.ComponentType;
26
- /**
27
- * Entry basename for routing
28
- */
29
- basename?: string;
30
- internalRuntimeContext?: InternalRuntimeContext<RuntimeExtends>;
31
- /**
32
- * RSCRoot
33
- */
34
- RSCRoot?: React.ComponentType;
35
- isRscClient?: boolean;
36
- serverPayload?: ServerPayload;
37
- enableRsc?: boolean;
38
- }
39
- export { getServerPayload, setServerPayload, } from './serverPayload/index';
40
- export declare function getGlobalIsRscClient(): boolean | undefined;
41
- export declare function getGlobalEnableRsc(): boolean | undefined;
42
- export declare function setGlobalContext(context: Omit<GlobalContext, 'internalRuntimeContext'>): void;
43
- export declare function getCurrentEntryName(): string | undefined;
44
- export declare function getGlobalRSCRoot(): React.ComponentType<{}> | undefined;
45
- export declare function setGlobalInternalRuntimeContext(context: InternalRuntimeContext<RuntimeExtends>): void;
46
- export declare function getGlobalInternalRuntimeContext(): InternalRuntimeContext<Required<import("@modern-js/plugin").RuntimePluginExtends<import("../plugin/types").RuntimeConfig, import("./runtime").TInternalRuntimeContext, {}, {}>>>;
47
- export declare function getGlobalApp(): React.ComponentType<{}> | undefined;
48
- export declare function getGlobalRoutes(): undefined | (NestedRoute | PageRoute)[];
49
- export declare function getGlobalLayoutApp(): React.ComponentType<{}> | undefined;
50
- export declare function getGlobalBasename(): string | undefined;
@@ -1,2 +0,0 @@
1
- import type { Monitors } from '@modern-js/types';
2
- export declare const defaultMonitors: Omit<Monitors, 'push'>;
@@ -1 +0,0 @@
1
- export declare const getMonitors: () => Omit<import("@modern-js/types").Monitors, "push">;
@@ -1,2 +0,0 @@
1
- import type { Monitors } from '@modern-js/types';
2
- export declare const getMonitors: () => Omit<Monitors, 'push'>;
@@ -1 +0,0 @@
1
- export declare const getRequest: () => Request;
@@ -1 +0,0 @@
1
- export declare const getRequest: () => Request;
@@ -1,4 +0,0 @@
1
- export declare const getResponseProxy: () => null;
2
- export declare const setHeaders: (headers: Record<string, string>) => void;
3
- export declare const setStatus: (status: number) => void;
4
- export declare const redirect: (url: string, init?: number | ResponseInit) => void;
@@ -1,7 +0,0 @@
1
- export declare const getResponseProxy: () => {
2
- headers: Record<string, string>;
3
- status: number;
4
- } | undefined;
5
- export declare const setHeaders: (headers: Record<string, string>) => void;
6
- export declare const setStatus: (status: number) => void;
7
- export declare const redirect: (url: string, init?: number | ResponseInit) => void;
@@ -1,42 +0,0 @@
1
- import type { RouteObject, StaticHandlerContext } from '@modern-js/runtime-utils/router';
2
- import type { InternalRouterRuntimeState, InternalRouterServerSnapshot, RouteManifest, RouterFramework } from '../../router/runtime/types';
3
- import type { RequestContext, SSRServerContext } from '../types';
4
- export interface TRuntimeContext {
5
- initialData?: Record<string, unknown>;
6
- isBrowser: boolean;
7
- routes?: RouteObject[];
8
- routerFramework?: RouterFramework;
9
- requestContext: RequestContext;
10
- /**
11
- * @deprecated Use `requestContext` instead
12
- */
13
- context: RequestContext;
14
- [key: string]: unknown;
15
- }
16
- /**
17
- * InternalRuntimeContext used internally and by plugins
18
- */
19
- export interface TInternalRuntimeContext extends TRuntimeContext {
20
- routeManifest?: RouteManifest;
21
- routerRuntime?: InternalRouterRuntimeState;
22
- routerInstance?: unknown;
23
- routerHydrationScript?: string;
24
- routerMatchedRouteIds?: string[];
25
- routerServerSnapshot?: InternalRouterServerSnapshot;
26
- routerContext?: StaticHandlerContext;
27
- unstable_getBlockNavState?: () => boolean;
28
- ssrContext?: SSRServerContext;
29
- _internalContext?: any;
30
- _internalRouterBaseName?: any;
31
- }
32
- export declare const InternalRuntimeContext: import("react").Context<TInternalRuntimeContext>;
33
- export declare const RuntimeContext: import("react").Context<TRuntimeContext>;
34
- /**
35
- * deprecated, use RuntimeContext instead
36
- */
37
- export declare const ReactRuntimeContext: import("react").Context<TRuntimeContext>;
38
- export declare const getInitialContext: (isBrowser?: boolean, routeManifest?: RouteManifest) => TInternalRuntimeContext;
39
- /**
40
- * @deprecated use use(RuntimeContext) instead
41
- */
42
- export declare const useRuntimeContext: () => TRuntimeContext;
@@ -1,4 +0,0 @@
1
- import type { PayloadRoute, ServerPayload } from './index.server';
2
- export type { PayloadRoute, ServerPayload };
3
- export declare const getServerPayload: () => ServerPayload | undefined;
4
- export declare const setServerPayload: (payload: ServerPayload) => void;
@@ -1,31 +0,0 @@
1
- import type { RouterState, ShouldRevalidateFunction } from '@modern-js/runtime-utils/router';
2
- export type PayloadRoute = {
3
- clientAction?: (...args: unknown[]) => unknown;
4
- clientLoader?: (...args: unknown[]) => unknown;
5
- element?: React.ReactNode;
6
- errorElement?: React.ReactNode;
7
- handle?: unknown;
8
- hasAction: boolean;
9
- hasErrorBoundary: boolean;
10
- hasLoader: boolean;
11
- hasClientLoader?: boolean;
12
- id: string;
13
- index?: boolean;
14
- params: Record<string, string>;
15
- parentId?: string;
16
- path?: string;
17
- pathname: string;
18
- pathnameBase: string;
19
- shouldRevalidate?: ShouldRevalidateFunction;
20
- };
21
- export type ServerPayload = {
22
- type: 'render';
23
- actionData: RouterState['actionData'];
24
- errors: RouterState['errors'];
25
- loaderData: RouterState['loaderData'];
26
- location: RouterState['location'];
27
- routes: PayloadRoute[];
28
- originalRoutes?: PayloadRoute[];
29
- };
30
- export declare const getServerPayload: () => ServerPayload | undefined;
31
- export declare const setServerPayload: (payload: ServerPayload) => void;
@@ -1,5 +0,0 @@
1
- export { defineRuntimeConfig } from './config';
2
- export type { TRuntimeContext } from './context/runtime';
3
- export { RuntimeContext, useRuntimeContext, } from './context/runtime';
4
- export type { RuntimePlugin } from './plugin';
5
- export type { SSRContainer, SSRData } from './types';
@@ -1,4 +0,0 @@
1
- import type { RuntimeConfig, RuntimePlugin } from './types';
2
- export type { RuntimePlugin };
3
- export declare function registerPlugin(internalPlugins: RuntimePlugin[], runtimeConfig?: RuntimeConfig): any;
4
- export declare function mergeConfig(config: Record<string, any>, ...otherConfig: Record<string, any>[]): Record<string, any>;
@@ -1,10 +0,0 @@
1
- import type { RuntimePlugin as BaseRuntimePlugin, RuntimePluginExtends } from '@modern-js/plugin';
2
- import type { Hooks } from '@modern-js/plugin/runtime';
3
- import type { RuntimeConfig as BaseRuntimeConfig } from '../../common';
4
- import type { TInternalRuntimeContext } from '../context/runtime';
5
- export type RuntimeHooks = Hooks<RuntimeConfig, TInternalRuntimeContext>;
6
- export type RuntimeExtends = Required<RuntimePluginExtends<RuntimeConfig, TInternalRuntimeContext, {}, {}>>;
7
- export type RuntimePlugin<Extends extends RuntimePluginExtends = {}> = BaseRuntimePlugin<RuntimeExtends & Extends>;
8
- export interface RuntimeConfig extends BaseRuntimeConfig {
9
- plugins?: RuntimePlugin[];
10
- }
@@ -1,2 +0,0 @@
1
- import type React from 'react';
2
- export declare function createRoot(UserApp?: React.ComponentType | null): React.ComponentType<any>;
@@ -1,3 +0,0 @@
1
- import type React from 'react';
2
- import { type TRuntimeContext } from '../context';
3
- export declare function wrapRuntimeContextProvider(App: React.ReactElement, contextValue: TRuntimeContext): React.JSX.Element;
@@ -1,4 +0,0 @@
1
- export declare const HTML_PLACEHOLDER = "<!--<?- html ?>-->";
2
- export declare const SSR_DATA_PLACEHOLDER = "<!--<?- SSRDataScript ?>-->";
3
- export declare const CHUNK_JS_PLACEHOLDER = "<!--<?- chunksMap.js ?>-->";
4
- export declare const CHUNK_CSS_PLACEHOLDER = "<!--<?- chunksMap.css ?>-->";
@@ -1,3 +0,0 @@
1
- import type { HelmetData } from 'react-helmet';
2
- export declare function createReplaceHelemt(helmetData?: HelmetData): (template: string) => string;
3
- export declare function helmetReplace(content: string, helmetData: HelmetData): string;
@@ -1,4 +0,0 @@
1
- import type { RuntimePlugin } from '../plugin';
2
- export { NoSSR, NoSSRCache } from './react';
3
- export declare const ssr: (_config: any) => RuntimePlugin;
4
- export default ssr;
@@ -1,2 +0,0 @@
1
- export { NoSSRCache } from './no-ssr-cache';
2
- export { NoSSR } from './nossr';
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const NoSSRCache: () => React.JSX.Element;
@@ -1,4 +0,0 @@
1
- import React, { type ReactElement } from 'react';
2
- export declare const NoSSR: (props?: React.PropsWithChildren<{
3
- fallback?: ReactElement | string;
4
- }>) => ReactElement | null;
@@ -1,13 +0,0 @@
1
- import type { RequestHandler, RequestHandlerOptions } from '@modern-js/app-tools';
2
- import React from 'react';
3
- import { type TInternalRuntimeContext } from '../context';
4
- export type { RequestHandlerConfig as HandleRequestConfig } from '@modern-js/app-tools';
5
- export type HandleRequestOptions = Exclude<RequestHandlerOptions, 'staticGenerate'> & {
6
- runtimeContext: TInternalRuntimeContext;
7
- };
8
- export type HandleRequest = (request: Request, ServerRoot: React.ComponentType, // App, routes,
9
- options: HandleRequestOptions) => Promise<Response>;
10
- export type CreateRequestHandler = (handleRequest: HandleRequest, options?: {
11
- enableRsc?: boolean;
12
- }) => Promise<RequestHandler>;
13
- export declare const createRequestHandler: CreateRequestHandler;
@@ -1,4 +0,0 @@
1
- export { type CreateRequestHandler, createRequestHandler, type HandleRequest, type HandleRequestConfig, type HandleRequestOptions, } from './requestHandler';
2
- export type { RenderOptions, RenderStreaming, RenderString } from './shared';
3
- export { renderStreaming } from './stream';
4
- export { renderString } from './string';
@@ -1,8 +0,0 @@
1
- import type { ServerUserConfig } from '@modern-js/app-tools';
2
- import type { HandleRequestOptions } from './requestHandler';
3
- export type RenderOptions = HandleRequestOptions;
4
- export type SSRConfig = NonNullable<ServerUserConfig['ssr']>;
5
- export type RenderStreaming = (request: Request, serverRoot: React.ReactElement, optinos: RenderOptions) => Promise<ReadableStream>;
6
- export type RenderString = (request: Request, serverRoot: React.ReactElement, optinos: RenderOptions) => Promise<string>;
7
- export type BuildHtmlCb = (template: string) => string | Promise<string>;
8
- export declare function buildHtml(template: string, callbacks: BuildHtmlCb[]): Promise<string>;
@@ -1,13 +0,0 @@
1
- import { type RenderLevel } from '../../constants';
2
- import type { TInternalRuntimeContext } from '../../context';
3
- import type { HandleRequestConfig } from '../requestHandler';
4
- import { type SSRConfig } from '../shared';
5
- export type BuildShellAfterTemplateOptions = {
6
- runtimeContext: TInternalRuntimeContext;
7
- renderLevel: RenderLevel;
8
- ssrConfig: SSRConfig;
9
- request: Request;
10
- entryName: string;
11
- config: HandleRequestConfig;
12
- };
13
- export declare function buildShellAfterTemplate(afterAppTemplate: string, options: BuildShellAfterTemplateOptions): Promise<string>;
@@ -1,9 +0,0 @@
1
- import type { TInternalRuntimeContext } from '../../context';
2
- import type { HandleRequestConfig } from '../requestHandler';
3
- export interface BuildShellBeforeTemplateOptions {
4
- runtimeContext: TInternalRuntimeContext;
5
- entryName: string;
6
- config: HandleRequestConfig;
7
- styledComponentsStyleTags?: string;
8
- }
9
- export declare function buildShellBeforeTemplate(beforeAppTemplate: string, options: BuildShellBeforeTemplateOptions): Promise<string>;
@@ -1,2 +0,0 @@
1
- import { type CreateReadableStreamFromElement } from './shared';
2
- export declare const createReadableStreamFromElement: CreateReadableStreamFromElement;
@@ -1,2 +0,0 @@
1
- import { type CreateReadableStreamFromElement } from './shared';
2
- export declare const createReadableStreamFromElement: CreateReadableStreamFromElement;
@@ -1,15 +0,0 @@
1
- import type { DeferredData } from '@modern-js/runtime-utils/browser';
2
- export type DeferredDataLike = Pick<DeferredData, 'data' | 'pendingKeys'> & {
3
- data?: Record<string, unknown>;
4
- pendingKeys?: string[];
5
- };
6
- export declare function escapeAttr(value: string): string;
7
- export declare function isRecord(v: unknown): v is Record<string, unknown>;
8
- export declare function isDeferredDataLike(v: unknown): v is DeferredDataLike;
9
- export declare function isPromiseLike(value: unknown): value is Promise<unknown>;
10
- export declare function toErrorInfo(error: unknown): {
11
- message: string;
12
- stack?: string;
13
- };
14
- export declare function buildDeferredDataScript(nonce: string | undefined, args: unknown[]): string;
15
- export declare function enqueueFromEntries(entries: Array<[string, unknown]>, nonce: string | undefined, emit: (script: string) => void): void;
@@ -1 +0,0 @@
1
- export declare const renderStreaming: import("../shared").RenderStreaming;