@octanejs/app-core 0.1.6 → 0.1.8

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/app-core",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -79,10 +79,10 @@
79
79
  "esbuild": "^0.28.1"
80
80
  },
81
81
  "peerDependencies": {
82
- "octane": "^0.13.0"
82
+ "octane": "^0.14.0"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@types/node": "^24.13.3",
86
- "octane": "0.13.0"
86
+ "octane": "0.14.0"
87
87
  }
88
88
  }
@@ -0,0 +1,15 @@
1
+ // @ts-check
2
+ export { hydrateRoot, initializeHydrationEventCapture, Suspense, ErrorBoundary } from 'octane';
3
+ import { createElementFromConfig } from 'octane/internal/client';
4
+
5
+ /**
6
+ * The generated entry resolves fallback exports to functions and supplies only
7
+ * `{ error, reset }` or `{}`. Their descriptors cannot select host form actions
8
+ * or Fragment refs; each fallback's own output installs the capabilities it uses.
9
+ * @template P
10
+ * @param {import('octane').ComponentBody<P>} component
11
+ * @param {P} props
12
+ */
13
+ export function createElement(component, props) {
14
+ return createElementFromConfig(undefined, component, props);
15
+ }
package/src/codegen.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // @ts-check
2
2
  import fs from 'node:fs';
3
3
  import path from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
4
5
 
5
6
  export { generateServerEntry, generateServerManifestEntry } from './server/server-entry.js';
6
7
 
@@ -329,7 +330,8 @@ async function bootstrapDocumentLifecycle() {
329
330
  * octane specifics:
330
331
  * - `initializeHydrationEventCapture()` runs before any async route work so
331
332
  * interaction boundaries can preserve intent that precedes `hydrateRoot()`.
332
- * - `import { hydrateRoot } from 'octane'` (NO `mount`).
333
+ * - The default entry runtime uses hydrateRoot and classified component
334
+ * descriptors for pending/catch fallbacks (NO `mount`).
333
335
  * - `hydrateRoot(container, body, props)` signature (container FIRST, React-18
334
336
  * shape) — no `{ target, props }` wrapper.
335
337
  * - The layout `children` is a props-first ComponentBody whose closure calls
@@ -361,7 +363,8 @@ async function bootstrapDocumentLifecycle() {
361
363
  * @returns {string}
362
364
  */
363
365
  export function create_client_entry_source(options = {}) {
364
- const runtimeModuleId = options.runtimeModuleId ?? 'octane';
366
+ const runtimeModuleId =
367
+ options.runtimeModuleId ?? fileURLToPath(new URL('./client-entry-runtime.js', import.meta.url));
365
368
  return (
366
369
  client_entry_prelude(
367
370
  options,
@@ -69,10 +69,10 @@ export function createLayoutWrapper(Layout, Page, pageProps) {
69
69
  export function createRootBoundaryWrapper(Content, boundary, runtime) {
70
70
  let body = Content;
71
71
 
72
- // Compose the catch boundary closest to the route. A Suspense boundary is
73
- // allowed to retain its pending shell when an unhandled server render error
74
- // reaches it, so putting Suspense inside ErrorBoundary would prevent the
75
- // configured catch component from observing ordinary route errors.
72
+ // Compose the catch boundary closest to the route. As in React, the server
73
+ // never renders it: a server route error reaches the Suspense boundary, which
74
+ // ships the pending shell for the browser to render the route, where the
75
+ // catch component observes a repeated error before Suspense would.
76
76
  if (boundary.catch) {
77
77
  const child = body;
78
78
  const Catch = boundary.catch;