@bleedingdev/modern-js-runtime 3.9.0-ultramodern.3 → 3.9.0-ultramodern.5

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 (160) hide show
  1. package/dist/cjs/cli/code.js +3 -1
  2. package/dist/cjs/cli/ssr/index.js +2 -74
  3. package/dist/cjs/core/browser/hydrate.js +6 -1
  4. package/dist/cjs/core/context/index.js +4 -43
  5. package/dist/cjs/core/context/public.js +4 -7
  6. package/dist/cjs/core/context/runtime.js +17 -5
  7. package/dist/cjs/core/react/wrapper.js +22 -65
  8. package/dist/cjs/core/server/helmet.js +5 -4
  9. package/dist/cjs/core/server/requestResponse.js +4 -4
  10. package/dist/cjs/core/server/routerCleanup.js +2 -2
  11. package/dist/cjs/core/server/shared.js +171 -4
  12. package/dist/cjs/core/server/stream/afterTemplate.js +21 -16
  13. package/dist/cjs/core/server/stream/beforeTemplate.js +34 -25
  14. package/dist/cjs/core/server/stream/beforeTemplate.worker.js +28 -21
  15. package/dist/cjs/core/server/stream/createReadableStream.js +208 -123
  16. package/dist/cjs/core/server/stream/createReadableStream.worker.js +159 -90
  17. package/dist/cjs/core/server/stream/deferredScript.js +3 -3
  18. package/dist/cjs/core/server/stream/shared.js +2 -2
  19. package/dist/cjs/core/server/string/index.js +100 -64
  20. package/dist/cjs/core/server/string/loadable.js +34 -19
  21. package/dist/cjs/core/server/string/ssrData.js +5 -12
  22. package/dist/cjs/core/server/utils.js +1 -2
  23. package/dist/cjs/exports/head.js +7 -14
  24. package/dist/cjs/router/runtime/PrefetchLink.js +67 -123
  25. package/dist/cjs/router/runtime/hooks.js +13 -2
  26. package/dist/cjs/router/runtime/internal.js +7 -45
  27. package/dist/cjs/router/runtime/plugin.js +2 -8
  28. package/dist/cjs/router/runtime/plugin.node.js +2 -30
  29. package/dist/cjs/router/runtime/redirect.js +1 -1
  30. package/dist/esm/cli/code.mjs +3 -1
  31. package/dist/esm/cli/ssr/index.mjs +3 -72
  32. package/dist/esm/core/browser/hydrate.mjs +7 -2
  33. package/dist/esm/core/context/index.mjs +2 -5
  34. package/dist/esm/core/context/public.mjs +1 -5
  35. package/dist/esm/core/context/runtime.mjs +13 -4
  36. package/dist/esm/core/react/wrapper.mjs +21 -67
  37. package/dist/esm/core/server/helmet.mjs +5 -4
  38. package/dist/esm/core/server/requestResponse.mjs +3 -3
  39. package/dist/esm/core/server/routerCleanup.mjs +1 -1
  40. package/dist/esm/core/server/shared.mjs +153 -1
  41. package/dist/esm/core/server/stream/afterTemplate.mjs +23 -18
  42. package/dist/esm/core/server/stream/beforeTemplate.mjs +37 -28
  43. package/dist/esm/core/server/stream/beforeTemplate.worker.mjs +31 -24
  44. package/dist/esm/core/server/stream/createReadableStream.mjs +207 -122
  45. package/dist/esm/core/server/stream/createReadableStream.worker.mjs +149 -90
  46. package/dist/esm/core/server/stream/deferredScript.mjs +3 -3
  47. package/dist/esm/core/server/stream/shared.mjs +2 -2
  48. package/dist/esm/core/server/string/index.mjs +104 -68
  49. package/dist/esm/core/server/string/loadable.mjs +34 -19
  50. package/dist/esm/core/server/string/ssrData.mjs +5 -12
  51. package/dist/esm/core/server/utils.mjs +1 -2
  52. package/dist/esm/exports/head.mjs +7 -14
  53. package/dist/esm/router/runtime/PrefetchLink.mjs +67 -123
  54. package/dist/esm/router/runtime/hooks.mjs +9 -1
  55. package/dist/esm/router/runtime/internal.mjs +2 -33
  56. package/dist/esm/router/runtime/plugin.mjs +1 -7
  57. package/dist/esm/router/runtime/plugin.node.mjs +1 -29
  58. package/dist/esm/router/runtime/redirect.mjs +1 -1
  59. package/dist/esm-node/cli/code.mjs +3 -1
  60. package/dist/esm-node/cli/ssr/index.mjs +3 -72
  61. package/dist/esm-node/core/browser/hydrate.mjs +7 -2
  62. package/dist/esm-node/core/context/index.mjs +2 -5
  63. package/dist/esm-node/core/context/public.mjs +1 -5
  64. package/dist/esm-node/core/context/runtime.mjs +13 -4
  65. package/dist/esm-node/core/react/wrapper.mjs +21 -67
  66. package/dist/esm-node/core/server/helmet.mjs +5 -4
  67. package/dist/esm-node/core/server/requestResponse.mjs +3 -3
  68. package/dist/esm-node/core/server/routerCleanup.mjs +1 -1
  69. package/dist/esm-node/core/server/shared.mjs +153 -1
  70. package/dist/esm-node/core/server/stream/afterTemplate.mjs +23 -18
  71. package/dist/esm-node/core/server/stream/beforeTemplate.mjs +37 -28
  72. package/dist/esm-node/core/server/stream/beforeTemplate.worker.mjs +31 -24
  73. package/dist/esm-node/core/server/stream/createReadableStream.mjs +207 -122
  74. package/dist/esm-node/core/server/stream/createReadableStream.worker.mjs +149 -90
  75. package/dist/esm-node/core/server/stream/deferredScript.mjs +3 -3
  76. package/dist/esm-node/core/server/stream/shared.mjs +2 -2
  77. package/dist/esm-node/core/server/string/index.mjs +104 -68
  78. package/dist/esm-node/core/server/string/loadable.mjs +34 -19
  79. package/dist/esm-node/core/server/string/ssrData.mjs +5 -12
  80. package/dist/esm-node/core/server/utils.mjs +1 -2
  81. package/dist/esm-node/exports/head.mjs +7 -14
  82. package/dist/esm-node/router/runtime/PrefetchLink.mjs +67 -123
  83. package/dist/esm-node/router/runtime/hooks.mjs +9 -1
  84. package/dist/esm-node/router/runtime/internal.mjs +2 -33
  85. package/dist/esm-node/router/runtime/plugin.mjs +1 -7
  86. package/dist/esm-node/router/runtime/plugin.node.mjs +1 -29
  87. package/dist/esm-node/router/runtime/redirect.mjs +1 -1
  88. package/dist/types/cli/ssr/index.d.ts +0 -3
  89. package/dist/types/core/context/index.d.ts +4 -6
  90. package/dist/types/core/context/public.d.ts +1 -23
  91. package/dist/types/core/context/runtime.d.ts +26 -2
  92. package/dist/types/core/react/wrapper.d.ts +6 -0
  93. package/dist/types/core/server/helmet.d.ts +4 -5
  94. package/dist/types/core/server/shared.d.ts +23 -0
  95. package/dist/types/core/server/stream/afterTemplate.d.ts +2 -1
  96. package/dist/types/core/server/stream/beforeTemplate.d.ts +4 -1
  97. package/dist/types/core/server/stream/beforeTemplate.worker.d.ts +4 -1
  98. package/dist/types/core/server/stream/shared.d.ts +1 -1
  99. package/dist/types/core/server/string/loadable.d.ts +6 -3
  100. package/dist/types/core/server/string/ssrData.d.ts +2 -1
  101. package/dist/types/core/server/string/types.d.ts +1 -5
  102. package/dist/types/exports/head.d.ts +2 -2
  103. package/dist/types/router/runtime/PrefetchLink.d.ts +27 -2
  104. package/dist/types/router/runtime/hooks.d.ts +19 -2
  105. package/dist/types/router/runtime/internal.d.ts +4 -21
  106. package/dist/types/router/runtime/types.d.ts +2 -43
  107. package/package.json +9 -38
  108. package/rstest.config.mts +32 -2
  109. package/dist/cjs/boundary-debugger/index.js +0 -317
  110. package/dist/cjs/core/context/extensions.js +0 -74
  111. package/dist/cjs/core/context/helmetContext.js +0 -54
  112. package/dist/cjs/core/server/federatedCss.js +0 -58
  113. package/dist/cjs/core/server/scriptOrder.js +0 -140
  114. package/dist/cjs/module-federation/consume-surface.js +0 -199
  115. package/dist/cjs/module-federation/distributed-ssr.js +0 -135
  116. package/dist/cjs/module-federation/index.js +0 -316
  117. package/dist/cjs/module-federation/last-known-good.js +0 -157
  118. package/dist/cjs/module-federation/manifest-recovery-runtime-plugin.js +0 -129
  119. package/dist/cjs/module-federation/surface-resolution-types.js +0 -61
  120. package/dist/cjs/router/runtime/lifecycle.js +0 -167
  121. package/dist/cjs/router/runtime/provider.js +0 -153
  122. package/dist/esm/boundary-debugger/index.mjs +0 -277
  123. package/dist/esm/core/context/extensions.mjs +0 -33
  124. package/dist/esm/core/context/helmetContext.mjs +0 -13
  125. package/dist/esm/core/server/federatedCss.mjs +0 -20
  126. package/dist/esm/core/server/scriptOrder.mjs +0 -90
  127. package/dist/esm/module-federation/consume-surface.mjs +0 -158
  128. package/dist/esm/module-federation/distributed-ssr.mjs +0 -82
  129. package/dist/esm/module-federation/index.mjs +0 -115
  130. package/dist/esm/module-federation/last-known-good.mjs +0 -113
  131. package/dist/esm/module-federation/manifest-recovery-runtime-plugin.mjs +0 -89
  132. package/dist/esm/module-federation/surface-resolution-types.mjs +0 -8
  133. package/dist/esm/router/runtime/lifecycle.mjs +0 -105
  134. package/dist/esm/router/runtime/provider.mjs +0 -100
  135. package/dist/esm-node/boundary-debugger/index.mjs +0 -278
  136. package/dist/esm-node/core/context/extensions.mjs +0 -34
  137. package/dist/esm-node/core/context/helmetContext.mjs +0 -14
  138. package/dist/esm-node/core/server/federatedCss.mjs +0 -21
  139. package/dist/esm-node/core/server/scriptOrder.mjs +0 -91
  140. package/dist/esm-node/module-federation/consume-surface.mjs +0 -159
  141. package/dist/esm-node/module-federation/distributed-ssr.mjs +0 -83
  142. package/dist/esm-node/module-federation/index.mjs +0 -116
  143. package/dist/esm-node/module-federation/last-known-good.mjs +0 -114
  144. package/dist/esm-node/module-federation/manifest-recovery-runtime-plugin.mjs +0 -90
  145. package/dist/esm-node/module-federation/surface-resolution-types.mjs +0 -9
  146. package/dist/esm-node/router/runtime/lifecycle.mjs +0 -106
  147. package/dist/esm-node/router/runtime/provider.mjs +0 -101
  148. package/dist/types/boundary-debugger/index.d.ts +0 -28
  149. package/dist/types/core/context/extensions.d.ts +0 -35
  150. package/dist/types/core/context/helmetContext.d.ts +0 -10
  151. package/dist/types/core/server/federatedCss.d.ts +0 -5
  152. package/dist/types/core/server/scriptOrder.d.ts +0 -25
  153. package/dist/types/module-federation/consume-surface.d.ts +0 -104
  154. package/dist/types/module-federation/distributed-ssr.d.ts +0 -61
  155. package/dist/types/module-federation/index.d.ts +0 -71
  156. package/dist/types/module-federation/last-known-good.d.ts +0 -52
  157. package/dist/types/module-federation/manifest-recovery-runtime-plugin.d.ts +0 -25
  158. package/dist/types/module-federation/surface-resolution-types.d.ts +0 -23
  159. package/dist/types/router/runtime/lifecycle.d.ts +0 -27
  160. package/dist/types/router/runtime/provider.d.ts +0 -78
@@ -1,5 +1,5 @@
1
1
  import type { ReactElement } from 'react';
2
- import type { TInternalRuntimeContext } from '../../context/index.js';
2
+ import type { createSSRRenderLifecycle } from '../shared.js';
3
3
  import type { ChunkSet, Collector } from './types.js';
4
4
  declare module '@loadable/server' {
5
5
  interface ChunkExtractor {
@@ -11,10 +11,9 @@ export interface LoadableCollectorOptions {
11
11
  nonce?: string;
12
12
  stats?: Record<string, any>;
13
13
  routeManifest?: Record<string, any>;
14
- runtimeContext: TInternalRuntimeContext;
15
14
  template: string;
16
15
  entryName: string;
17
- moduleFederationCssAssets?: string[];
16
+ lifecycle?: ReturnType<typeof createSSRRenderLifecycle>;
18
17
  chunkSet: ChunkSet;
19
18
  config: LoadableCollectorConfig;
20
19
  }
@@ -28,6 +27,10 @@ export interface LoadableCollectorConfig {
28
27
  export declare class LoadableCollector implements Collector {
29
28
  private options;
30
29
  private extractor?;
30
+ readonly stylesheetInfo: {
31
+ emittedAssets: string[];
32
+ attributes: Record<string, unknown>;
33
+ };
31
34
  constructor(options: LoadableCollectorOptions);
32
35
  private get existsAssets();
33
36
  collect(comopnent: ReactElement): ReactElement;
@@ -1,7 +1,7 @@
1
1
  import type { StaticHandlerContext } from '@modern-js/runtime-utils/router';
2
2
  import type { TInternalRuntimeContext } from '../../context/index.js';
3
3
  import type { SSRServerContext } from '../../types.js';
4
- import type { SSRConfig } from '../shared.js';
4
+ import type { createSSRRenderLifecycle, SSRConfig } from '../shared.js';
5
5
  import type { ChunkSet, Collector } from './types.js';
6
6
  export interface SSRDataCreatorOptions {
7
7
  runtimeContext: TInternalRuntimeContext;
@@ -10,6 +10,7 @@ export interface SSRDataCreatorOptions {
10
10
  ssrContext: SSRServerContext;
11
11
  ssrConfig?: SSRConfig;
12
12
  routerContext?: StaticHandlerContext;
13
+ lifecycle?: ReturnType<typeof createSSRRenderLifecycle>;
13
14
  nonce?: string;
14
15
  useJsonScript?: boolean;
15
16
  }
@@ -1,9 +1,5 @@
1
- import type { ReactElement } from 'react';
2
1
  import type { RenderLevel } from '../../constants.js';
3
- export interface Collector {
4
- collect?: (comopnent: ReactElement) => ReactElement;
5
- effect: () => void | Promise<void>;
6
- }
2
+ export type { Collector } from '@modern-js/plugin/runtime';
7
3
  export type ChunkSet = {
8
4
  renderLevel: RenderLevel;
9
5
  ssrScripts: string;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { Helmet as AsyncHelmet, HelmetData as AsyncHelmetData, type HelmetDatum, type HelmetHTMLBodyDatum, type HelmetHTMLElementDatum, type HelmetProps, HelmetProvider, type HelmetServerState, type HelmetTags } from 'react-helmet-async';
3
- export declare const Helmet: (props: React.PropsWithChildren<HelmetProps>) => React.CElement<React.PropsWithChildren<HelmetProps>, AsyncHelmet> | React.ReactElement<{}, string | React.JSXElementConstructor<any>> | null;
2
+ import { HelmetData as AsyncHelmetData, type HelmetDatum, type HelmetHTMLBodyDatum, type HelmetHTMLElementDatum, type HelmetProps, HelmetProvider, type HelmetServerState, type HelmetTags } from 'react-helmet-async';
3
+ export declare const Helmet: (props: React.PropsWithChildren<HelmetProps>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
4
4
  declare const head: {
5
5
  Helmet: typeof Helmet;
6
6
  HelmetData: typeof AsyncHelmetData;
@@ -1,4 +1,4 @@
1
- import { type LinkProps as RouterLinkProps, type NavLinkProps as RouterNavLinkProps } from '@modern-js/runtime-utils/router';
1
+ import { type RouteObject, type LinkProps as RouterLinkProps, type NavLinkProps as RouterNavLinkProps } from '@modern-js/runtime-utils/router';
2
2
  import React from 'react';
3
3
  /**
4
4
  * Modified from https://github.com/remix-run/remix/blob/9a0601bd704d2f3ee622e0ddacab9b611eb0c5bc/packages/remix-react/components.tsx#L218
@@ -16,7 +16,7 @@ import React from 'react';
16
16
  * - "viewport": Fetched when the link enters the viewport
17
17
  * - "none": Never fetched
18
18
  */
19
- type PrefetchBehavior = 'intent' | 'render' | 'viewport' | 'none';
19
+ type PrefetchBehavior = NonNullable<RouterLinkProps['prefetch']>;
20
20
  type PreloadBehavior = PrefetchBehavior | false;
21
21
  export interface LinkProps extends RouterLinkProps {
22
22
  prefetch?: PrefetchBehavior;
@@ -26,6 +26,31 @@ export interface NavLinkProps extends RouterNavLinkProps {
26
26
  prefetch?: PrefetchBehavior;
27
27
  preload?: PreloadBehavior;
28
28
  }
29
+ /** Optional scheduling capability supplied by a runtime integration. */
30
+ export interface LinkPrefetchPolicy {
31
+ observe(options: {
32
+ element: HTMLAnchorElement | null;
33
+ prefetch?: PrefetchBehavior;
34
+ preload?: PreloadBehavior;
35
+ notify: (state: {
36
+ code: boolean;
37
+ data: boolean;
38
+ }) => void;
39
+ }): {
40
+ onIntent: () => void;
41
+ onCancel: () => void;
42
+ dispose: () => void;
43
+ };
44
+ schedule(options: {
45
+ runtimeContext: object;
46
+ chunkLoader: object;
47
+ publicPath: string;
48
+ key: string;
49
+ run: () => Promise<unknown>;
50
+ }): () => void;
51
+ canWarmup: () => boolean;
52
+ allowData: (route: RouteObject) => boolean;
53
+ }
29
54
  declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
30
55
  declare const NavLink: React.ForwardRefExoticComponent<NavLinkProps & React.RefAttributes<HTMLAnchorElement>>;
31
56
  export { Link, NavLink };
@@ -1,6 +1,15 @@
1
1
  import type { RouteObject } from '@modern-js/runtime-utils/router';
2
- import type { TRuntimeContext } from '../../core/context/runtime.js';
3
- import type { RouterLifecycleContext } from './lifecycle.js';
2
+ import type { TInternalRuntimeContext, TRuntimeContext } from '../../core/context/runtime.js';
3
+ export type RouterLifecycleContext = {
4
+ framework: string;
5
+ phase: 'ssr-prepare' | 'client-create' | 'hydrate';
6
+ routes: RouteObject[];
7
+ runtimeContext: TInternalRuntimeContext;
8
+ basename?: string;
9
+ hydrationData?: unknown;
10
+ router?: unknown;
11
+ [key: string]: unknown;
12
+ };
4
13
  export type RouterSyncHook<Handler extends (...args: any[]) => any> = {
5
14
  call: (...args: Parameters<Handler>) => ReturnType<Handler>;
6
15
  [key: string]: unknown;
@@ -12,6 +21,14 @@ declare const onAfterCreateRouter: RouterSyncHook<(context: RouterLifecycleConte
12
21
  declare const onBeforeHydrateRouter: RouterSyncHook<(context: RouterLifecycleContext) => void>;
13
22
  declare const onAfterHydrateRouter: RouterSyncHook<(context: RouterLifecycleContext) => void>;
14
23
  export { modifyRoutes, onAfterCreateRouter, onAfterHydrateRouter, onBeforeCreateRouter, onBeforeCreateRoutes, onBeforeHydrateRouter, };
24
+ export declare const routerProviderRegistryHooks: {
25
+ modifyRoutes: RouterSyncHook<(routes: RouteObject[]) => RouteObject[]>;
26
+ onBeforeCreateRoutes: RouterSyncHook<(context: TRuntimeContext) => void>;
27
+ onBeforeCreateRouter: RouterSyncHook<(context: RouterLifecycleContext) => void>;
28
+ onAfterCreateRouter: RouterSyncHook<(context: RouterLifecycleContext) => void>;
29
+ onBeforeHydrateRouter: RouterSyncHook<(context: RouterLifecycleContext) => void>;
30
+ onAfterHydrateRouter: RouterSyncHook<(context: RouterLifecycleContext) => void>;
31
+ };
15
32
  export type RouterExtendsHooks = {
16
33
  modifyRoutes: typeof modifyRoutes;
17
34
  onBeforeCreateRoutes: typeof onBeforeCreateRoutes;
@@ -1,22 +1,5 @@
1
- import type { RuntimePlugin } from '../../common.js';
2
- import type { RouterExtendsHooks } from './hooks.js';
3
- import type { RouterProviderRegistration } from './provider.js';
4
- import type { RouterConfig, SingleRouteConfig } from './types.js';
5
- type LocalRouterProvider = Omit<RouterProviderRegistration, 'isDefault'>;
6
- export type RouterPluginFactory = (userConfig?: Partial<RouterConfig>) => RuntimePlugin<{
7
- extendHooks: RouterExtendsHooks;
8
- }>;
9
- /**
10
- * Create one router wrapper and its provider realm for a runtime entry. Optional
11
- * providers are supplied by the entry-owning integration (for example the
12
- * TanStack runtime/router module), so independently bundled apps never resolve
13
- * factories from another app's module graph.
14
- */
15
- export declare const createRouterPlugin: (localProviders?: readonly LocalRouterProvider[]) => RouterPluginFactory;
16
- export declare const routerPlugin: RouterPluginFactory;
17
- export default routerPlugin;
18
- export type { RouterExtendsHooks } from './hooks.js';
19
- export { modifyRoutes } from './plugin.js';
20
- export { createRouterProviderRealm, type RouterProviderFactory, type RouterProviderPlugin, type RouterProviderRealm, type RouterProviderRegistration, registerRouterProvider, resolveRouterProvider, } from './provider.js';
1
+ export { type RouterExtendsHooks, type RouterLifecycleContext, routerProviderRegistryHooks, } from './hooks.js';
2
+ export type { LinkPrefetchPolicy } from './PrefetchLink.js';
3
+ export { modifyRoutes, routerPlugin, routerPlugin as default } from './plugin.js';
4
+ export type { RouterConfig, SingleRouteConfig } from './types.js';
21
5
  export { renderRoutes } from './utils.js';
22
- export type { RouterConfig, SingleRouteConfig };
@@ -20,15 +20,11 @@ export type SingleRouteConfig = RouteProps & {
20
20
  */
21
21
  component?: React.ComponentType;
22
22
  };
23
- export type BuiltInRouterFramework = 'react-router' | 'tanstack';
24
- export type RouterFramework = BuiltInRouterFramework | (string & {});
25
23
  export type RouterConfig = {
26
24
  /**
27
- * Select the router implementation used by Modern.js conventional routing.
28
- * - `react-router` (default): React Router based integration
29
- * - `tanstack`: TanStack Router integration
25
+ * Router implementation identifier for integrations that provide selection.
30
26
  */
31
- framework?: RouterFramework;
27
+ framework?: string;
32
28
  routesConfig: {
33
29
  globalApp?: React.ComponentType<any>;
34
30
  routes?: ModernRoute[];
@@ -50,46 +46,9 @@ export type RouterConfig = {
50
46
  unstable_reloadOnURLMismatch?: boolean;
51
47
  };
52
48
  export type Routes = RouterConfig['routesConfig']['routes'];
53
- export interface RouterRouteMatchSnapshot {
54
- routeId: string;
55
- assetRouteId?: string;
56
- pathname?: string;
57
- params?: Record<string, string>;
58
- }
59
49
  export interface RouteManifest {
60
50
  routeAssets: RouteAssets;
61
51
  }
62
- export interface InternalRouterServerSnapshot {
63
- framework?: RouterFramework;
64
- basename?: string;
65
- statusCode?: number;
66
- errors?: Record<string, unknown>;
67
- routerData?: {
68
- loaderData?: Record<string, unknown>;
69
- errors?: Record<string, unknown>;
70
- };
71
- hydrationScript?: string;
72
- hydrationScripts?: string[];
73
- matchedRouteIds?: string[];
74
- matches?: RouterRouteMatchSnapshot[];
75
- }
76
- export interface InternalRouterRuntimeState {
77
- framework: RouterFramework;
78
- basename?: string;
79
- instance?: unknown;
80
- hydrationScript?: string;
81
- hydrationScripts?: string[];
82
- matchedRouteIds?: string[];
83
- matches?: RouterRouteMatchSnapshot[];
84
- serverSnapshot?: InternalRouterServerSnapshot;
85
- cleanup?: () => void | Promise<void>;
86
- }
87
- export interface RouterServerPrepareResult {
88
- state: InternalRouterRuntimeState;
89
- snapshot?: InternalRouterServerSnapshot;
90
- redirect?: Response;
91
- cleanup?: () => void | Promise<void>;
92
- }
93
52
  export interface RouteAssets {
94
53
  [routeId: string]: {
95
54
  chunkIds?: (string | number)[];
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.9.0-ultramodern.3",
20
+ "version": "3.9.0-ultramodern.5",
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
@@ -69,26 +69,6 @@
69
69
  "types": "./dist/types/exports/head.d.ts",
70
70
  "default": "./dist/esm/exports/head.mjs"
71
71
  },
72
- "./boundary-debugger": {
73
- "types": "./dist/types/boundary-debugger/index.d.ts",
74
- "default": "./dist/esm/boundary-debugger/index.mjs"
75
- },
76
- "./module-federation": {
77
- "types": "./dist/types/module-federation/index.d.ts",
78
- "default": "./dist/esm/module-federation/index.mjs"
79
- },
80
- "./module-federation/distributed-ssr": {
81
- "types": "./dist/types/module-federation/distributed-ssr.d.ts",
82
- "default": "./dist/esm/module-federation/distributed-ssr.mjs"
83
- },
84
- "./module-federation/manifest-recovery-runtime-plugin": {
85
- "types": "./dist/types/module-federation/manifest-recovery-runtime-plugin.d.ts",
86
- "node": {
87
- "import": "./dist/esm/module-federation/manifest-recovery-runtime-plugin.mjs",
88
- "require": "./dist/cjs/module-federation/manifest-recovery-runtime-plugin.js"
89
- },
90
- "default": "./dist/esm/module-federation/manifest-recovery-runtime-plugin.mjs"
91
- },
92
72
  "./ssr": {
93
73
  "types": "./dist/types/core/server/index.d.ts",
94
74
  "default": "./dist/esm/core/server/index.mjs"
@@ -196,15 +176,6 @@
196
176
  "head": [
197
177
  "./dist/types/exports/head.d.ts"
198
178
  ],
199
- "boundary-debugger": [
200
- "./dist/types/boundary-debugger/index.d.ts"
201
- ],
202
- "module-federation": [
203
- "./dist/types/module-federation/index.d.ts"
204
- ],
205
- "module-federation/manifest-recovery-runtime-plugin": [
206
- "./dist/types/module-federation/manifest-recovery-runtime-plugin.d.ts"
207
- ],
208
179
  "document": [
209
180
  "./dist/types/document/index.d.ts"
210
181
  ],
@@ -246,13 +217,13 @@
246
217
  "dependencies": {
247
218
  "@loadable/component": "5.16.7",
248
219
  "@loadable/server": "5.16.7",
249
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.3",
250
- "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.0-ultramodern.3",
251
- "@modern-js/render": "npm:@bleedingdev/modern-js-render@3.9.0-ultramodern.3",
252
- "@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.0-ultramodern.3",
253
- "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.3",
254
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.3",
255
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.3",
220
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.9.0-ultramodern.5",
221
+ "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.9.0-ultramodern.5",
222
+ "@modern-js/render": "npm:@bleedingdev/modern-js-render@3.9.0-ultramodern.5",
223
+ "@modern-js/runtime-extensions": "npm:@bleedingdev/modern-js-runtime-extensions@3.9.0-ultramodern.5",
224
+ "@modern-js/runtime-utils": "npm:@bleedingdev/modern-js-runtime-utils@3.9.0-ultramodern.5",
225
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.9.0-ultramodern.5",
226
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.9.0-ultramodern.5",
256
227
  "@swc/core": "1.16.2",
257
228
  "@swc/helpers": "^0.5.23",
258
229
  "@swc/plugin-loadable-components": "^13.0.0",
@@ -273,7 +244,7 @@
273
244
  "react-dom": "^19.2.8"
274
245
  },
275
246
  "devDependencies": {
276
- "@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.9.0-ultramodern.3",
247
+ "@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.9.0-ultramodern.5",
277
248
  "@remix-run/web-fetch": "^4.4.2",
278
249
  "@rsbuild/core": "2.2.3",
279
250
  "@rslib/core": "1.0.0",
package/rstest.config.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import path from 'node:path';
1
2
  import type { ProjectConfig } from '@rstest/core';
2
3
  import { withTestPreset } from '@scripts/rstest-config';
3
4
 
@@ -23,7 +24,7 @@ export default {
23
24
  name: 'plugin-runtime-node',
24
25
  testEnvironment: 'node',
25
26
  exclude: [
26
- 'tests/boundary-debugger/client.test.tsx',
27
+ 'tests/ssr/serverRender/workerLifecycle.test.tsx',
27
28
  'tests/router/plugin.client.test.tsx',
28
29
  'tests/router/prefetch.test.tsx',
29
30
  'tests/router/prefetch-realm-isolation.test.tsx',
@@ -48,11 +49,40 @@ export default {
48
49
  },
49
50
  ],
50
51
  }),
52
+ withTestPreset({
53
+ name: 'plugin-runtime-worker-lifecycle',
54
+ testEnvironment: 'node',
55
+ extends: commonConfig,
56
+ include: ['tests/ssr/serverRender/workerLifecycle.test.tsx'],
57
+ resolve: {
58
+ alias: {
59
+ '@modern-js/render/ssr': path.join(
60
+ __dirname,
61
+ '../render/src/server/ssr/index.ts',
62
+ ),
63
+ 'react-server-dom-rspack/client.browser': path.join(
64
+ __dirname,
65
+ 'tests/fixtures/rsc-client.ts',
66
+ ),
67
+ 'react-server-dom-rspack/client.edge': path.join(
68
+ __dirname,
69
+ 'tests/fixtures/rsc-client.ts',
70
+ ),
71
+ '@modern-js/render/rsc': path.join(
72
+ __dirname,
73
+ 'tests/fixtures/rsc-server.ts',
74
+ ),
75
+ '@modern-js/render/rsc-worker': path.join(
76
+ __dirname,
77
+ 'tests/fixtures/rsc-server.ts',
78
+ ),
79
+ },
80
+ },
81
+ }),
51
82
  withTestPreset({
52
83
  name: 'plugin-runtime-client',
53
84
  testEnvironment: 'happy-dom',
54
85
  include: [
55
- 'tests/boundary-debugger/client.test.tsx',
56
86
  'tests/router/plugin.client.test.tsx',
57
87
  'tests/router/prefetch.test.tsx',
58
88
  'tests/router/prefetch-realm-isolation.test.tsx',