@bleedingdev/modern-js-renderer-octane 3.9.3-ultramodern.1 → 3.9.3-ultramodern.10

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 (100) hide show
  1. package/dist/cjs/client.js +56 -6
  2. package/dist/cjs/entry-application.js +7 -2
  3. package/dist/cjs/entry-client.js +3 -0
  4. package/dist/cjs/entry-server.js +13 -5
  5. package/dist/cjs/federation.js +108 -6
  6. package/dist/cjs/i18n/I18nProvider.js +6 -14
  7. package/dist/cjs/i18n/LocalizedLink.js +24 -33
  8. package/dist/cjs/i18n/index.js +0 -3
  9. package/dist/cjs/i18n-external-snapshot.js +645 -0
  10. package/dist/cjs/index.js +4 -4
  11. package/dist/cjs/manifest.js +2 -2
  12. package/dist/cjs/plugin/compiler.js +2 -5
  13. package/dist/cjs/plugin/create.js +27 -26
  14. package/dist/cjs/plugin/index.js +2 -2
  15. package/dist/cjs/plugin/profile.js +12 -10
  16. package/dist/cjs/router-client.js +1 -1
  17. package/dist/cjs/router-external-snapshot.js +291 -0
  18. package/dist/cjs/router-handler.js +11 -8
  19. package/dist/cjs/router-server.js +3 -11
  20. package/dist/cjs/router.js +1 -1
  21. package/dist/cjs/routes.js +20 -17
  22. package/dist/cjs/server.js +28 -7
  23. package/dist/cjs/worker-federation-context.js +63 -0
  24. package/dist/cjs/worker-federation-contexts.js +97 -0
  25. package/dist/cjs/worker-federation.js +97 -0
  26. package/dist/esm/client.mjs +56 -6
  27. package/dist/esm/entry-application.mjs +7 -2
  28. package/dist/esm/entry-client.mjs +3 -0
  29. package/dist/esm/entry-server.mjs +11 -6
  30. package/dist/esm/federation.mjs +110 -8
  31. package/dist/esm/i18n/I18nProvider.mjs +7 -15
  32. package/dist/esm/i18n/LocalizedLink.mjs +24 -30
  33. package/dist/esm/i18n/index.mjs +1 -1
  34. package/dist/esm/i18n-external-snapshot.mjs +576 -0
  35. package/dist/esm/index.mjs +4 -4
  36. package/dist/esm/manifest.mjs +2 -2
  37. package/dist/esm/router-client.mjs +1 -1
  38. package/dist/esm/router-external-snapshot.mjs +244 -0
  39. package/dist/esm/router-handler.mjs +11 -8
  40. package/dist/esm/router-server.mjs +0 -1
  41. package/dist/esm/router.mjs +2 -2
  42. package/dist/esm/routes.mjs +18 -18
  43. package/dist/esm/server.mjs +24 -3
  44. package/dist/esm/worker-federation-context.mjs +19 -0
  45. package/dist/esm/worker-federation-contexts.mjs +47 -0
  46. package/dist/esm/worker-federation.mjs +59 -0
  47. package/dist/esm-node/manifest.mjs +2 -2
  48. package/dist/esm-node/plugin/compiler.mjs +2 -5
  49. package/dist/esm-node/plugin/create.mjs +27 -26
  50. package/dist/esm-node/plugin/index.mjs +2 -2
  51. package/dist/esm-node/plugin/profile.mjs +12 -10
  52. package/dist/types/client.d.ts +5 -1
  53. package/dist/types/entry-client.d.ts +2 -0
  54. package/dist/types/entry-server.d.ts +4 -1
  55. package/dist/types/federation.d.ts +2 -0
  56. package/dist/types/i18n/LocalizedLink.d.ts +5 -32
  57. package/dist/types/i18n/context.d.ts +1 -1
  58. package/dist/types/i18n/index.d.ts +1 -1
  59. package/dist/types/i18n-external-snapshot.d.ts +43 -0
  60. package/dist/types/index.d.ts +4 -4
  61. package/dist/types/manifest.d.ts +2 -2
  62. package/dist/types/router-external-snapshot.d.ts +10 -0
  63. package/dist/types/router-server.d.ts +0 -2
  64. package/dist/types/routes.d.ts +2 -0
  65. package/dist/types/server.d.ts +6 -0
  66. package/dist/types/worker-federation-context.d.ts +34 -0
  67. package/dist/types/worker-federation-contexts.d.ts +25 -0
  68. package/dist/types/worker-federation.d.ts +20 -0
  69. package/package.json +84 -22
  70. package/src/client.ts +99 -16
  71. package/src/entry-application.ts +7 -3
  72. package/src/entry-client.ts +10 -0
  73. package/src/entry-server.ts +20 -9
  74. package/src/federation.ts +164 -15
  75. package/src/i18n/I18nProvider.ts +11 -20
  76. package/src/i18n/LocalizedLink.ts +46 -72
  77. package/src/i18n/context.ts +1 -1
  78. package/src/i18n/index.ts +1 -5
  79. package/src/i18n-external-snapshot.ts +803 -0
  80. package/src/index.ts +4 -4
  81. package/src/manifest.ts +2 -2
  82. package/src/plugin/compiler-manifest.cjs +27 -1
  83. package/src/plugin/compiler.ts +6 -14
  84. package/src/plugin/create.ts +27 -26
  85. package/src/plugin/index.ts +4 -2
  86. package/src/plugin/profile.ts +14 -10
  87. package/src/router-client.ts +1 -1
  88. package/src/router-external-snapshot.ts +363 -0
  89. package/src/router-handler.ts +11 -8
  90. package/src/router-server.ts +0 -2
  91. package/src/router.ts +2 -2
  92. package/src/routes.ts +37 -26
  93. package/src/server.ts +45 -5
  94. package/src/worker-federation-context.ts +51 -0
  95. package/src/worker-federation-contexts.ts +91 -0
  96. package/src/worker-federation.ts +120 -0
  97. package/dist/cjs/router-injection.js +0 -139
  98. package/dist/esm/router-injection.mjs +0 -101
  99. package/dist/types/router-injection.d.ts +0 -8
  100. package/src/router-injection.ts +0 -145
@@ -14,7 +14,7 @@ function generateOctaneAppSources(options) {
14
14
  {
15
15
  path: 'src/routes/layout.tsx',
16
16
  content: `import { Link, Outlet } from '@modern-js/renderer-octane/router';
17
- import Stable from '../components/Stable';
17
+ import Stable from '../components/stable';
18
18
  import './index.css';
19
19
 
20
20
  const appTitle = ${title};
@@ -45,7 +45,7 @@ ${options.capabilities.federation ? ' <Link to="/remotes">Federated app
45
45
  useOctaneRouteAction,
46
46
  } from '@modern-js/renderer-octane/router';
47
47
  import { useActionState } from 'octane';
48
- import Counter from '../components/Counter';
48
+ import Counter from '../components/counter';
49
49
 
50
50
  const appId = ${appId};
51
51
  const appTitle = ${title};
@@ -116,7 +116,7 @@ export const head: NonNullable<FileSystemRouteModule['head']> = () => ({
116
116
  `
117
117
  },
118
118
  {
119
- path: 'src/components/Counter.tsx',
119
+ path: 'src/components/counter.tsx',
120
120
  content: `import { useState } from 'octane';
121
121
 
122
122
  export default function Counter() {
@@ -134,7 +134,7 @@ export default function Counter() {
134
134
  `
135
135
  },
136
136
  {
137
- path: 'src/components/Stable.tsx',
137
+ path: 'src/components/stable.tsx',
138
138
  content: `import { useState } from 'octane';
139
139
 
140
140
  export default function Stable() {
@@ -161,34 +161,35 @@ export function loader({ request }: DataHandlerInput) {
161
161
  if (url.searchParams.get('case') === 'error')
162
162
  throw new Error('Native loader failure');
163
163
  if (url.searchParams.get('case') === 'redirect')
164
- return new Response(null, { status: 302, headers: { location: '/about' } });
164
+ return new Response(null, { headers: { location: '/about' }, status: 302 });
165
165
  return {
166
166
  message: 'Native loader value',
167
167
  privateValue: request.headers.get('x-conformance-private'),
168
168
  };
169
169
  }
170
170
 
171
- export async function action({ request }: DataHandlerInput) {
172
- const form = await request.formData();
173
- const name = form.get('name');
174
- if (typeof name !== 'string' || !name.trim())
175
- return Response.json(
176
- { fieldErrors: { name: 'Name required' } },
177
- { status: 422 },
178
- );
179
- if (form.get('intent') === 'redirect')
180
- return new Response(null, {
181
- status: 303,
182
- headers: {
183
- location: '/about',
184
- 'set-cookie': 'conformance-saved=1; Path=/; SameSite=Lax',
185
- },
186
- });
187
- if (form.get('intent') === 'throw') throw new Error('Native action failure');
188
- return {
189
- saved: name,
190
- privateValue: request.headers.get('x-conformance-private'),
191
- };
171
+ export function action({ request }: DataHandlerInput) {
172
+ return request.formData().then(form => {
173
+ const name = form.get('name');
174
+ if (typeof name !== 'string' || name.trim().length === 0)
175
+ return Response.json(
176
+ { fieldErrors: { name: 'Name required' } },
177
+ { status: 422 },
178
+ );
179
+ if (form.get('intent') === 'redirect')
180
+ return new Response(null, {
181
+ headers: {
182
+ location: '/about',
183
+ 'set-cookie': 'conformance-saved=1; Path=/; SameSite=Lax',
184
+ },
185
+ status: 303,
186
+ });
187
+ if (form.get('intent') === 'throw') throw new Error('Native action failure');
188
+ return {
189
+ saved: name,
190
+ privateValue: request.headers.get('x-conformance-private'),
191
+ };
192
+ });
192
193
  }
193
194
  `
194
195
  },
@@ -77,7 +77,7 @@ const rendererAdapter = defineRendererAdapter({
77
77
  create: {
78
78
  templates: {
79
79
  federation: true,
80
- workers: false
80
+ workers: true
81
81
  },
82
82
  dependencies: (profile, { typescriptVersion })=>({
83
83
  frameworkDependencies: [
@@ -86,7 +86,7 @@ const rendererAdapter = defineRendererAdapter({
86
86
  ],
87
87
  dependencies: nativeRendererDependencies(profile),
88
88
  devDependencies: {
89
- [profile.compiler.name]: profile.compiler.version,
89
+ [profile.compiler.name]: profile.dependencies[profile.compiler.name] ?? profile.compiler.version,
90
90
  typescript: typescriptVersion
91
91
  },
92
92
  typecheckCommand: 'octane-tsc --noEmit --project tsconfig.json',
@@ -2,7 +2,7 @@ const octaneProfile = {
2
2
  renderer: 'octane',
3
3
  status: 'preview',
4
4
  protocolVersion: 1,
5
- minimumNode: '26.10.0',
5
+ minimumNode: '26.12.0',
6
6
  hmr: {
7
7
  editedBoundary: 'may-reset',
8
8
  unaffectedComponents: 'preserved',
@@ -12,17 +12,17 @@ const octaneProfile = {
12
12
  },
13
13
  compiler: {
14
14
  name: '@octanejs/rspack-plugin',
15
- version: '0.1.55'
15
+ version: '0.2.4'
16
16
  },
17
17
  hydration: {
18
18
  name: 'octane',
19
- version: '0.7.1+ultramodern.1331985ea3b0'
19
+ version: '0.13.8'
20
20
  },
21
21
  router: {
22
22
  name: '@octanejs/tanstack-router',
23
- version: '0.1.60+ultramodern.0b9f76ee3003',
23
+ version: '0.2.10',
24
24
  coreName: '@tanstack/router-core',
25
- coreVersion: '1.171.15'
25
+ coreVersion: '1.171.38'
26
26
  },
27
27
  sourceExtensions: [
28
28
  '.tsx',
@@ -32,12 +32,14 @@ const octaneProfile = {
32
32
  ],
33
33
  jsxImportSource: 'octane',
34
34
  dependencies: {
35
- octane: 'https://github.com/bleedingdev/octane/releases/download/octane%400.7.1%2Bultramodern.1331985ea3b0/octane-0.7.1%2Bultramodern.1331985ea3b0.tgz',
36
- '@octanejs/tanstack-router': 'https://github.com/bleedingdev/octane/releases/download/%40octanejs%2Ftanstack-router%400.1.60%2Bultramodern.0b9f76ee3003/octanejs-tanstack-router-0.1.60%2Bultramodern.0b9f76ee3003.tgz',
37
- '@octanejs/rspack-plugin': '0.1.55',
35
+ '@tsrx/oxc': '0.20.0',
36
+ octane: 'https://github.com/BleedingDev/octane/releases/download/ultramodern-octane-2383d2ab1e70/octane-0.13.8.tgz',
37
+ '@octanejs/tanstack-router': 'https://github.com/BleedingDev/octane/releases/download/ultramodern-octane-2383d2ab1e70/octanejs-tanstack-router-0.2.10.tgz',
38
+ '@octanejs/rspack-plugin': 'https://github.com/BleedingDev/octane/releases/download/ultramodern-octane-2383d2ab1e70/octanejs-rspack-plugin-0.2.4.tgz',
39
+ '@tanstack/router-core': 'https://github.com/BleedingDev/router/releases/download/ultramodern-router-core-585d3233f7f5/tanstack-router-core-1.171.38.tgz',
38
40
  '@modern-js/renderer-octane': '3.8.3',
39
- seroval: '1.6.8',
40
- 'seroval-plugins': '1.6.8'
41
+ seroval: '1.6.9',
42
+ 'seroval-plugins': '1.6.9'
41
43
  },
42
44
  capabilities: {
43
45
  worker: true,
@@ -1,6 +1,7 @@
1
1
  import type { NativeFederationBinding } from '@modern-js/renderer-core/federation';
2
2
  import { type RendererIdentity } from '@modern-js/renderer-core/identity';
3
3
  import { type ComponentBody, type Root, type RootContainer, type RootOptions } from 'octane';
4
+ import { type OctaneWorkerFederationFactory, type OctaneWorkerFederationScope } from './worker-federation-context';
4
5
  export type { OctaneDocumentBootstrap } from './bootstrap';
5
6
  export { readOctaneDocumentBootstrap } from './bootstrap';
6
7
  export interface OctaneApplicationModule {
@@ -23,9 +24,12 @@ export interface OctaneApplicationOptions {
23
24
  readonly signal?: AbortSignal;
24
25
  /** Hydration installs the native signal bridge before invoking this importer. */
25
26
  readonly load: () => Promise<OctaneApplicationModule>;
26
- readonly options?: Omit<RootOptions, 'signalOwner'>;
27
+ readonly options?: Omit<RootOptions, 'signalOwner' | 'externalSnapshots'>;
27
28
  /** This browser compilation's native Module Federation runtime. */
28
29
  readonly federation?: NativeFederationBinding;
30
+ readonly workerFederation?: OctaneWorkerFederationScope | OctaneWorkerFederationFactory;
31
+ /** Trusted document bootstrap identity, also present for a CSR document. */
32
+ readonly documentId?: string;
29
33
  }
30
34
  export interface OctaneHydrationOptions extends OctaneApplicationOptions {
31
35
  readonly documentIdentity: RendererIdentity;
@@ -1,8 +1,10 @@
1
1
  import type { LocalisedUrlsOption } from '@modern-js/i18n-runtime-extensions/paths';
2
2
  import { type NativeClientEntryOptions, type NativeI18nInstance } from '@modern-js/renderer-core/entry-client';
3
+ import type { OctaneWorkerFederationFactory, OctaneWorkerFederationScope } from './worker-federation-context';
3
4
  export interface OctaneClientEntryOptions extends NativeClientEntryOptions<NativeI18nInstance, LocalisedUrlsOption> {
4
5
  /** The native client compilation hash, `__webpack_hash__`. */
5
6
  readonly nativeHydrationBuildId: string;
7
+ readonly workerFederation?: OctaneWorkerFederationScope | OctaneWorkerFederationFactory;
6
8
  }
7
9
  /** Start a generated Octane browser entry: mount, or hydrate the server document. */
8
10
  export declare function startNativeClient(options: OctaneClientEntryOptions): void;
@@ -6,6 +6,9 @@ import type { ResponsePolicy } from '@modern-js/renderer-core/session';
6
6
  * declares for the document itself are kept, as Solid document headers are.
7
7
  */
8
8
  export declare function withOctaneDocumentFields(policy: ResponsePolicy, responseHeaders: Headers): ResponsePolicy;
9
- export type OctaneServerEntryOptions = NativeServerEntryOptions<NativeI18nInstance, LocalisedUrlsOption>;
9
+ export { createNativeWorkerFederationRuntime } from './worker-federation';
10
+ export interface OctaneServerEntryOptions extends NativeServerEntryOptions<NativeI18nInstance, LocalisedUrlsOption> {
11
+ readonly workerFederationLocale?: string;
12
+ }
10
13
  /** The native transport handlers of a generated Octane server entry. */
11
14
  export declare function createNativeServerEntry(options: OctaneServerEntryOptions): NativeServerEntry;
@@ -8,6 +8,8 @@ export interface FederatedComponentOptions {
8
8
  readonly fallback?: () => OctaneNode;
9
9
  /** A positive load limit; the server defaults to 3000ms. */
10
10
  readonly timeout?: number;
11
+ /** Explicit registered server projections required by an application remote. */
12
+ readonly contextKeys?: readonly string[];
11
13
  }
12
14
  /**
13
15
  * Render a native Octane remote by its `remote/Expose` id or a browser loader.
@@ -1,41 +1,14 @@
1
1
  import { type OctaneNode } from 'octane';
2
- import { type LinkComponentProps } from '../router';
3
- export interface LocalizedLinkProps {
2
+ import { type AnyRouter, type LinkComponentProps } from '../router';
3
+ export interface LocalizedLinkProps extends Omit<LinkComponentProps<'a', AnyRouter, string, string>, 'to' | 'mask' | 'href' | 'publicHref' | '_fromLocation'> {
4
4
  /** A canonical, language-agnostic target, e.g. `/products/red-shoe`. */
5
5
  to: string;
6
6
  /** Localize for a specific language instead of the current one. */
7
7
  language?: string;
8
- children?: unknown;
9
- class?: string;
10
- activeProps?: LinkComponentProps<'a'>['activeProps'];
11
- inactiveProps?: LinkComponentProps<'a'>['inactiveProps'];
12
- activeOptions?: LinkComponentProps<'a'>['activeOptions'];
13
- replace?: boolean;
14
- preload?: LinkComponentProps<'a'>['preload'];
15
8
  }
16
9
  /**
17
- * A thin wrapper over the native Octane router `Link`
18
- * (`@octanejs/tanstack-router`'s precompiled `Link.tsrx`) that localizes a
19
- * canonical `to` for the current (or an explicit) language before handing it
20
- * to the real link — the same contract as `@modern-js/plugin-i18n`'s React
21
- * `Link`. It resolves the href itself via the shared pathname helpers, so it
22
- * works with or without the router's i18n `rewrite`. Every link, including
23
- * one to another language, is the native `Link`: navigation, preloading and
24
- * active state stay with the router.
25
- *
26
- * Under the i18n `rewrite` the router matches canonical paths and localizes
27
- * outgoing locations to the current language, so a link to another language
28
- * routes to the canonical `to` and publishes the target language's URL as a
29
- * route mask (the rewrite keeps a mask's explicit language). The entry's
30
- * router language synchronization (`syncWithRouter`) switches the i18next
31
- * instance from the navigated URL, as it does for history navigation.
32
- *
33
- * No JSX: built with `createElement`, matching this package's existing
34
- * style (see `src/routes.ts`).
10
+ * The native router owns client navigation, preloading and active state. Its mask
11
+ * keeps the canonical route while publishing the selected language URL;
12
+ * the entry's i18n router subscription synchronizes the instance on navigation.
35
13
  */
36
14
  export declare function LocalizedLink(props: LocalizedLinkProps): OctaneNode;
37
- /**
38
- * Language-invariant active check: `to="/products"` is active whether the
39
- * current location is `/en/products` or `/produkty` under a mapped locale.
40
- */
41
- export declare function useIsLocalizedActive(canonicalTarget: string): boolean;
@@ -3,7 +3,7 @@ export type { I18nContextValue, I18nInstanceLike } from './types';
3
3
  /**
4
4
  * Octane's `createContext<T>(defaultValue: T)` requires a default (unlike
5
5
  * Solid 2's default-less form), so a missing provider is detected by
6
- * checking for `null` in `useI18n`/`useIsLocalizedActive` instead — the same
6
+ * checking for `null` in `useI18n`/`LocalizedLink` instead — the same
7
7
  * guard shape `@modern-js/plugin-i18n`'s React `ModernI18nContext` uses.
8
8
  */
9
9
  export declare const I18nContext: import("octane").Context<I18nContextValue | null>;
@@ -3,7 +3,7 @@ export { createI18nSsrHandoffInlineData, I18N_SSR_HANDOFF_ELEMENT_ID, type I18nS
3
3
  export { type CreateI18nUrlRewriteOptions, createI18nUrlRewrite, type I18nLocationRewrite, } from '@modern-js/i18n-runtime-extensions/urlRewrite';
4
4
  export { I18nContext } from './context';
5
5
  export { I18nProvider, type I18nProviderProps } from './I18nProvider';
6
- export { LocalizedLink, type LocalizedLinkProps, useIsLocalizedActive, } from './LocalizedLink';
6
+ export { LocalizedLink, type LocalizedLinkProps } from './LocalizedLink';
7
7
  export { type OctaneLatestLanguageSyncOptions, useLatestLanguageSync, } from './languageSync';
8
8
  export type { I18nContextValue, I18nInstanceLike } from './types';
9
9
  export { type UseI18nReturn, useI18n } from './useI18n';
@@ -0,0 +1,43 @@
1
+ import { type NativeI18nRewriteSnapshot } from '@modern-js/i18n-runtime-extensions/native';
2
+ import type { LocalisedUrlsOption } from '@modern-js/i18n-runtime-extensions/paths';
3
+ import type { NativeLocationRewrite } from '@modern-js/renderer-core/router';
4
+ import { type i18n as I18nInstance, type Resource } from 'i18next';
5
+ import type { I18nContextValue, I18nInstanceLike } from './i18n/types';
6
+ export type I18nSnapshotJson = null | boolean | number | string | I18nSnapshotJson[] | I18nSnapshotOptions;
7
+ export interface I18nSnapshotOptions {
8
+ [key: string]: I18nSnapshotJson;
9
+ }
10
+ export interface OctaneI18nProfileId {
11
+ key: string;
12
+ version: string;
13
+ }
14
+ export interface OctaneI18nSnapshot {
15
+ version: 1;
16
+ profile: OctaneI18nProfileId;
17
+ language: string;
18
+ languages: string[];
19
+ localisedUrls?: LocalisedUrlsOption;
20
+ options: I18nSnapshotOptions;
21
+ resources: Resource;
22
+ }
23
+ /** Named profiles install their custom translation functions locally. */
24
+ export interface OctaneI18nSnapshotProfile extends OctaneI18nProfileId {
25
+ captureOptions(instance: I18nInstanceLike): Readonly<I18nSnapshotOptions>;
26
+ validateOptions(options: Readonly<I18nSnapshotOptions>): void;
27
+ create(input: {
28
+ language: string;
29
+ options: Readonly<I18nSnapshotOptions>;
30
+ resources: Resource;
31
+ signal?: AbortSignal;
32
+ }): I18nInstance | Promise<I18nInstance>;
33
+ dispose?(instance: I18nInstance): void;
34
+ }
35
+ export declare function captureOctaneI18nRewriteSnapshot(rewrite: NativeLocationRewrite): NativeI18nRewriteSnapshot;
36
+ export declare function restoreOctaneI18nRewriteSnapshot(value: unknown): NativeLocationRewrite;
37
+ export declare function registerOctaneI18nSnapshotProfile(profile: OctaneI18nSnapshotProfile): () => void;
38
+ export declare function associateOctaneI18nSnapshotProfile(instance: I18nInstanceLike, id: OctaneI18nProfileId): void;
39
+ /** Built-in translation behavior only. Custom per-call processors need a profile. */
40
+ export declare function captureOctaneI18nSnapshot(value: I18nContextValue): OctaneI18nSnapshot;
41
+ export declare function restoreOctaneI18nSnapshot(value: unknown, signal?: AbortSignal): Promise<I18nContextValue>;
42
+ export declare function disposeOctaneI18nSnapshot(value: I18nContextValue): void;
43
+ export declare function registerOctaneI18nWorkerContexts(): () => void;
@@ -2,8 +2,8 @@ export type { RendererIdentity } from '@modern-js/renderer-core/identity';
2
2
  export type { OctaneDocumentBootstrap } from './bootstrap';
3
3
  export declare const OCTANE_RUNTIME_PROFILE: Readonly<{
4
4
  renderer: "octane";
5
- runtime: "0.7.1+ultramodern.1331985ea3b0";
6
- router: "0.1.60+ultramodern.0b9f76ee3003";
7
- routerCore: "1.171.15";
8
- history: "1.162.0";
5
+ runtime: "0.13.8";
6
+ router: "0.2.10";
7
+ routerCore: "1.171.34";
8
+ history: "1.162.4";
9
9
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { NativeCompilerArtifacts } from '@modern-js/renderer-core/adapter';
2
2
  import { type RendererIdentity } from '@modern-js/renderer-core/identity';
3
- export declare const OCTANE_RUNTIME_VERSION = "0.7.1+ultramodern.1331985ea3b0";
4
- export declare const OCTANE_COMPILER_VERSION = "0.1.55";
3
+ export declare const OCTANE_RUNTIME_VERSION = "0.13.8";
4
+ export declare const OCTANE_COMPILER_VERSION = "0.2.4";
5
5
  export interface OctaneCompiledSource {
6
6
  readonly resource: string;
7
7
  readonly canonicalId: string;
@@ -0,0 +1,10 @@
1
+ import { type AnyRouter, type RouterRenderSnapshot } from '@octanejs/tanstack-router';
2
+ export declare const OCTANE_FILE_ROUTE_SNAPSHOT_PROFILE: Readonly<{
3
+ key: "ultramodern.file-routes";
4
+ version: "1";
5
+ }>;
6
+ /** Associate the genuine router produced by the generated file-route factory. */
7
+ export declare function associateOctaneFileRouteSnapshot(router: AnyRouter): void;
8
+ export declare function captureOctaneRouterSnapshot(router: AnyRouter): RouterRenderSnapshot;
9
+ /** Startup registration uses the actual physical native router/match Contexts. */
10
+ export declare function registerOctaneRouterWorkerContexts(): () => void;
@@ -3,8 +3,6 @@ import { type ServerRenderNode } from 'octane/server';
3
3
  export * from '@octanejs/tanstack-router/ssr/server';
4
4
  export type { OctaneRequestHandlerOptions } from './router-handler';
5
5
  export { createOctaneRequestHandler } from './router-handler';
6
- export type { OctaneRouterInjectionOptions } from './router-injection';
7
- export { createOctaneRouterInjection } from './router-injection';
8
6
  export type { OctaneRouterSerializationGuard, OctaneRouterSerializationOptions, } from './router-server-snapshot';
9
7
  export { prepareOctaneRouterSerialization } from './router-server-snapshot';
10
8
  /** Render the native provider using the released Start server root contract. */
@@ -1,6 +1,8 @@
1
1
  import type { DataOutcome, FileSystemRouteIR, PublicDataOutcome } from '@modern-js/renderer-core/data';
2
2
  import { type FileSystemRouteOptions } from '@modern-js/renderer-core/router';
3
3
  import { type AnyRoute, type AnyRouter, type ErrorRouteComponent, type NotFoundRouteComponent, type RouteComponent } from '@octanejs/tanstack-router';
4
+ /** Head callbacks execute on the host; only the factory's original binding is admitted. */
5
+ export declare function hasUnchangedOctaneFileRouteHead(route: AnyRoute): boolean;
4
6
  export type { FileSystemDataModule, FileSystemRouteOptions, } from '@modern-js/renderer-core/router';
5
7
  export { matchApplicationRouteIds, matchApplicationRoutes, RouteDataError, selectApplicationDataRoute, } from '@modern-js/renderer-core/router';
6
8
  /** Generated imports contain native view bindings, keyed by the structural id. */
@@ -1,6 +1,8 @@
1
1
  import { type DocumentAsset, type DocumentInlineData } from '@modern-js/renderer-core/document';
2
2
  import type { NativeFederationBinding } from '@modern-js/renderer-core/federation';
3
3
  import { type RequestSession, type ResponsePolicy } from '@modern-js/renderer-core/session';
4
+ import type { WorkerFederationTransport } from '@modern-js/renderer-core/worker-federation';
5
+ import type { AnyRouter } from '@octanejs/tanstack-router';
4
6
  import { type ServerRenderNode, type StreamOptions } from 'octane/server';
5
7
  export interface OctaneDocumentOptions {
6
8
  /** One identity for this response, shared with the client's signal receiver. */
@@ -27,8 +29,12 @@ export interface RenderOctaneApplicationOptions<Bindings extends object = object
27
29
  readonly props?: unknown;
28
30
  /** Native router serialization, owned by this request's router SSR context. */
29
31
  readonly injection?: StreamOptions['injection'];
32
+ readonly router?: AnyRouter;
33
+ readonly routerSerializationTimeoutMs?: number;
30
34
  /** This server compilation's native Module Federation runtime. */
31
35
  readonly federation?: NativeFederationBinding;
36
+ readonly workerFederation?: WorkerFederationTransport;
37
+ readonly workerFederationLocale?: string;
32
38
  }
33
39
  /** Deliver the CSR document; native browser mounting owns the empty root. */
34
40
  export declare function renderOctaneCSRDocument<Bindings extends object>(input: OctaneDocumentResponseOptions<Bindings>): Promise<Response>;
@@ -0,0 +1,34 @@
1
+ import type { WorkerFederationTransport } from '@modern-js/renderer-core/worker-federation';
2
+ import { FederationApplication, type OctaneFederationScope } from './federation-context';
3
+ export interface OctaneWorkerFederationScope {
4
+ readonly transport: WorkerFederationTransport;
5
+ /** Compiled entry fallback; localized providers supply their live language. */
6
+ readonly locale: string;
7
+ /** Own document disposal; each lazy admission also owns its waiter deadline. */
8
+ readonly signal?: AbortSignal;
9
+ }
10
+ export type OctaneWorkerFederationFactory = (signal: AbortSignal) => OctaneWorkerFederationScope;
11
+ /** Each native document owns its transport and captured publisher authorities. */
12
+ export declare const WorkerFederationContext: import("octane").Context<OctaneWorkerFederationScope | null>;
13
+ export declare function WorkerFederationRoot(props: {
14
+ readonly scope: OctaneWorkerFederationScope;
15
+ readonly children?: unknown;
16
+ }): import("octane").ElementDescriptor<{
17
+ value: OctaneWorkerFederationScope;
18
+ children: unknown;
19
+ }>;
20
+ /** Stable native root used for startup and application updates alike. */
21
+ export declare function WorkerFederationApplication(props: {
22
+ readonly scope: OctaneWorkerFederationScope;
23
+ readonly federation?: OctaneFederationScope;
24
+ readonly application: Parameters<typeof FederationApplication>[0]['application'];
25
+ }): import("octane").ElementDescriptor<{
26
+ scope: OctaneWorkerFederationScope;
27
+ children: import("octane").ElementDescriptor<unknown> | import("octane").ElementDescriptor<{
28
+ scope: OctaneFederationScope;
29
+ application: {
30
+ readonly default: import("octane").ComponentBody;
31
+ readonly props?: unknown;
32
+ };
33
+ }>;
34
+ }>;
@@ -0,0 +1,25 @@
1
+ import type { NativeLocationRewrite } from '@modern-js/renderer-core/router';
2
+ import { type Context, type ExternalSnapshotContextCodec } from 'octane';
3
+ export declare const OCTANE_WORKER_CONTEXT_KEYS: Readonly<{
4
+ readonly router: 'ultramodern.octane.router-context.v1';
5
+ readonly match: 'ultramodern.octane.match-context.v1';
6
+ readonly i18n: 'ultramodern.octane.i18n-context.v1';
7
+ }>;
8
+ type OctaneWorkerContextKey = (typeof OCTANE_WORKER_CONTEXT_KEYS)[keyof typeof OCTANE_WORKER_CONTEXT_KEYS];
9
+ export interface OctaneWorkerContextCodec<T> extends ExternalSnapshotContextCodec<T> {
10
+ readonly key: OctaneWorkerContextKey;
11
+ readonly dispose?: (value: T) => void | PromiseLike<void>;
12
+ readonly isProvided: (value: T) => boolean;
13
+ }
14
+ /** Optional renderer modules register their actual native context identities. */
15
+ export declare function registerOctaneWorkerContext<T>(context: Context<T>, codec: OctaneWorkerContextCodec<T>): () => void;
16
+ /** Read live providers on every render; explicit requirements retain native validation. */
17
+ export declare function useOctaneWorkerContextKeys(explicit?: readonly string[]): readonly string[];
18
+ export interface OctaneWorkerRouterRewrite {
19
+ readonly capture: (rewrite: NativeLocationRewrite) => unknown;
20
+ readonly restore: (descriptor: unknown) => NativeLocationRewrite;
21
+ }
22
+ /** The optional i18n owner supplies its own native rewrite provenance. */
23
+ export declare function registerOctaneWorkerRouterRewrite(codec: OctaneWorkerRouterRewrite): () => void;
24
+ export declare function getOctaneWorkerRouterRewrite(): OctaneWorkerRouterRewrite | undefined;
25
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { NativeWorkerDispatchOptions } from '@modern-js/renderer-core/server';
2
+ import { type AdmitWorkerRendererContract, createWorkerFederationHandler } from '@modern-js/renderer-core/worker-federation';
3
+ import { prepareExternalSnapshotRequest } from 'octane/server';
4
+ type NativeSnapshotRequest = Awaited<ReturnType<typeof prepareExternalSnapshotRequest>>;
5
+ type HandlerOptions = Parameters<typeof createWorkerFederationHandler<NativeSnapshotRequest>>[0];
6
+ /** The compiled registry pins its renderer publication and literal imports. */
7
+ export interface OctaneWorkerFederationRegistry {
8
+ initialize(options: Omit<HandlerOptions, 'publication' | 'exposes'> & {
9
+ publication: unknown;
10
+ }): (request: Request) => Promise<Response | undefined>;
11
+ }
12
+ /** Created per dispatch; no publisher or native snapshot cache crosses documents. */
13
+ export declare function createNativeWorkerFederationRuntime<Bindings extends object>(options: NativeWorkerDispatchOptions<Bindings>, compiler: {
14
+ readonly admitRendererContract: AdmitWorkerRendererContract;
15
+ readonly registry?: OctaneWorkerFederationRegistry;
16
+ }): {
17
+ transport: import("@modern-js/renderer-core/worker-federation").WorkerFederationTransport | undefined;
18
+ handleRequest: (request: Request) => Promise<Response | undefined>;
19
+ };
20
+ export {};