@octanejs/vite-plugin 0.1.1 → 0.1.3
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/CHANGELOG.md +162 -0
- package/package.json +3 -3
- package/src/server/render-route.js +13 -14
- package/types/production.d.ts +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,167 @@
|
|
|
1
1
|
# @octanejs/vite-plugin
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3431ec3: SSR: the buffered renderers (`renderToString`/`renderToStaticMarkup` in
|
|
8
|
+
`octane/server`, `prerender` in `octane/static`) gain a `RenderOptions` argument:
|
|
9
|
+
`nonce` (CSP nonce stamped on the emitted inline `<style>` tags and the suspense seed
|
|
10
|
+
script — all renderers), plus `signal` (AbortSignal that rejects a suspended render
|
|
11
|
+
when the request dies) and `timeoutMs` (per-render override of the suspense settle
|
|
12
|
+
deadline) on the async `prerender`. `octane/server` now documents which exports are
|
|
13
|
+
the compiler's private ABI and exports the `executeServerFunction` RPC executor the
|
|
14
|
+
vite plugin's dev RPC handler loads via `ssrLoadModule('octane/server')` (previously a
|
|
15
|
+
missing export, so any `module server` call crashed). Wire format is devalue, matching
|
|
16
|
+
`@ripple-ts/adapter`'s client stub: devalue-encoded argument array in, devalue-encoded
|
|
17
|
+
`{ value }` envelope out. See the new `docs/ssr.md` for the full SSR guide and the
|
|
18
|
+
current gaps (streaming, selective hydration, production server build).
|
|
19
|
+
- Updated dependencies [71b5167]
|
|
20
|
+
- Updated dependencies [7b2acbd]
|
|
21
|
+
- Updated dependencies [a000fa2]
|
|
22
|
+
- Updated dependencies [71b5167]
|
|
23
|
+
- Updated dependencies [735f5ca]
|
|
24
|
+
- Updated dependencies [634c4b4]
|
|
25
|
+
- Updated dependencies [1987d47]
|
|
26
|
+
- Updated dependencies [fda2200]
|
|
27
|
+
- Updated dependencies [71b5167]
|
|
28
|
+
- Updated dependencies [fda2200]
|
|
29
|
+
- Updated dependencies [3431ec3]
|
|
30
|
+
- Updated dependencies [3afe217]
|
|
31
|
+
- Updated dependencies [1a1f1db]
|
|
32
|
+
- Updated dependencies [3431ec3]
|
|
33
|
+
- Updated dependencies [5e3858f]
|
|
34
|
+
- Updated dependencies [d2afbbb]
|
|
35
|
+
- Updated dependencies [1987d47]
|
|
36
|
+
- Updated dependencies [eb48930]
|
|
37
|
+
- Updated dependencies [3431ec3]
|
|
38
|
+
- Updated dependencies [87c5bc3]
|
|
39
|
+
- octane@0.1.3
|
|
40
|
+
|
|
41
|
+
## 0.1.2
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- b3a9191: Rename `hydrate` → `hydrateRoot` and adopt React 18's shape. The hydration entry is now `hydrateRoot(container, <App/>)` — container first — and returns a full `Root` (with `.render()` and `.unmount()`), symmetric with `createRoot`. Previously `hydrate(Component, container, props)` put the component first and returned only `{ unmount }`. After hydration the returned root's `.render()` performs a normal client update against the adopted DOM (no re-hydration). The vite-plugin's generated client entry now imports and calls `hydrateRoot`.
|
|
46
|
+
- 43d940d: Exclude `@octanejs/query` from esbuild pre-bundling (optimizeDeps.exclude + ssr.noExternal). It ships a `.tsrx` provider component, so — like `octane` itself — its source must flow through the octane `.tsrx` transform rather than being pre-bundled by esbuild.
|
|
47
|
+
- cb9ad82: Rename the project from `vyre` to `octane`. The runtime now publishes as `octane` and the Vite metaframework plugin as `@octanejs/vite-plugin`. Identifiers inherited from the Ripple fork were also renamed to Octane (e.g. `setIsRippleActEnvironment` → `setIsOctaneActEnvironment`, the metaframework `ripple()` plugin → `octane()`, and the `ripple.config.ts` convention → `octane.config.ts`). References to the upstream Ripple framework and its `@ripple-ts`/`@tsrx` packages are unchanged.
|
|
48
|
+
- fcac573: Unify the server-rendering ABI to props-first, matching the client. A component body is now invoked as `(props, scope, extra)` on the server (it used to be `(scope, props, extra)`). This makes a plain `function Foo(props)` used at a `<Foo/>` site work the same on the server as on the client — including components that return a non-JSX value (a primitive coerced to text, an early return, `null`). SSR markup is unchanged (only the invocation order flipped), so hydration is unaffected. The server layout/page wrappers in the vite-plugin were updated to match.
|
|
49
|
+
- 634fd52: Align the SSR API with React and reshape the render result to `{ html, css }`.
|
|
50
|
+
|
|
51
|
+
The octane-invented `render(Component, props) → { head, body, css }` is replaced by
|
|
52
|
+
React-aligned entry points:
|
|
53
|
+
|
|
54
|
+
- `octane/server` (mirrors `react-dom/server`):
|
|
55
|
+
- `renderToString(element, props?, options?)` — a single synchronous pass; a Suspense
|
|
56
|
+
boundary that suspends renders its `@pending` fallback (no awaiting).
|
|
57
|
+
- `renderToStaticMarkup(element, props?, options?)` — clean, non-hydratable HTML (no block
|
|
58
|
+
or head-adoption markers, no suspense seed script).
|
|
59
|
+
- `octane/static` (NEW subpath, mirrors `react-dom/static`):
|
|
60
|
+
- `prerender(element, props?, options?)` — the await-everything behaviour of the old
|
|
61
|
+
`render()`: all Suspense data resolves and success arms render, returning complete HTML.
|
|
62
|
+
|
|
63
|
+
All three return `{ html, css }`. The separate `head` field is gone — hoisted `<title>`/
|
|
64
|
+
`<meta>`/`<link>` fold into `html` (spliced into `<head>` when the render produced a
|
|
65
|
+
document, else prepended), matching React 19's resource hoisting. `css` remains a distinct
|
|
66
|
+
field (octane has scoped CSS that React core does not). `render` is removed; the vite
|
|
67
|
+
plugin's dev SSR now uses `prerender`.
|
|
68
|
+
|
|
69
|
+
- b3a9191: Fix the generated client hydration entry for routes with a layout. The layout's `children` ComponentBody was emitted with the old scope-first calling convention (`(s) => Component(s, { params })`), but octane's client runtime invokes a function child props-first as `({}, block, extra)` — so the page received the block as its props and rendered without its route data. The closure now calls `Component({ params }, scope, extra)`.
|
|
70
|
+
- Updated dependencies [c19f1aa]
|
|
71
|
+
- Updated dependencies [6983478]
|
|
72
|
+
- Updated dependencies [6983478]
|
|
73
|
+
- Updated dependencies [169c7c6]
|
|
74
|
+
- Updated dependencies [86ae0c5]
|
|
75
|
+
- Updated dependencies [357f841]
|
|
76
|
+
- Updated dependencies [6675ac7]
|
|
77
|
+
- Updated dependencies [f414710]
|
|
78
|
+
- Updated dependencies [894d51c]
|
|
79
|
+
- Updated dependencies [f44fb6b]
|
|
80
|
+
- Updated dependencies [056c441]
|
|
81
|
+
- Updated dependencies [aa9cc6e]
|
|
82
|
+
- Updated dependencies [0f57f20]
|
|
83
|
+
- Updated dependencies [f44fb6b]
|
|
84
|
+
- Updated dependencies [067efa3]
|
|
85
|
+
- Updated dependencies [f0c6c4d]
|
|
86
|
+
- Updated dependencies [dd24fd5]
|
|
87
|
+
- Updated dependencies [524939e]
|
|
88
|
+
- Updated dependencies [e8ee0a8]
|
|
89
|
+
- Updated dependencies [b680431]
|
|
90
|
+
- Updated dependencies [524939e]
|
|
91
|
+
- Updated dependencies [7f8dbc0]
|
|
92
|
+
- Updated dependencies [a13acd1]
|
|
93
|
+
- Updated dependencies [067efa3]
|
|
94
|
+
- Updated dependencies [524939e]
|
|
95
|
+
- Updated dependencies [894d51c]
|
|
96
|
+
- Updated dependencies [894d51c]
|
|
97
|
+
- Updated dependencies [1960647]
|
|
98
|
+
- Updated dependencies [e8ee0a8]
|
|
99
|
+
- Updated dependencies [93e2733]
|
|
100
|
+
- Updated dependencies [149800c]
|
|
101
|
+
- Updated dependencies [6983478]
|
|
102
|
+
- Updated dependencies [6983478]
|
|
103
|
+
- Updated dependencies [6983478]
|
|
104
|
+
- Updated dependencies [169c7c6]
|
|
105
|
+
- Updated dependencies [bbc3275]
|
|
106
|
+
- Updated dependencies [ed6afad]
|
|
107
|
+
- Updated dependencies [40bcb16]
|
|
108
|
+
- Updated dependencies [c842fb7]
|
|
109
|
+
- Updated dependencies [c62efa7]
|
|
110
|
+
- Updated dependencies [524939e]
|
|
111
|
+
- Updated dependencies [b3a9191]
|
|
112
|
+
- Updated dependencies [ffe32c4]
|
|
113
|
+
- Updated dependencies [e1f996b]
|
|
114
|
+
- Updated dependencies [6983478]
|
|
115
|
+
- Updated dependencies [fc36e15]
|
|
116
|
+
- Updated dependencies [524939e]
|
|
117
|
+
- Updated dependencies [405f06e]
|
|
118
|
+
- Updated dependencies [f50c829]
|
|
119
|
+
- Updated dependencies [b3a9191]
|
|
120
|
+
- Updated dependencies [dd24fd5]
|
|
121
|
+
- Updated dependencies [7042056]
|
|
122
|
+
- Updated dependencies [6983478]
|
|
123
|
+
- Updated dependencies [e031a7d]
|
|
124
|
+
- Updated dependencies [86ae0c5]
|
|
125
|
+
- Updated dependencies [a33cdd6]
|
|
126
|
+
- Updated dependencies [067efa3]
|
|
127
|
+
- Updated dependencies [fab1cb0]
|
|
128
|
+
- Updated dependencies [6983478]
|
|
129
|
+
- Updated dependencies [dd24fd5]
|
|
130
|
+
- Updated dependencies [149800c]
|
|
131
|
+
- Updated dependencies [6983478]
|
|
132
|
+
- Updated dependencies [cb9ad82]
|
|
133
|
+
- Updated dependencies [ea6352e]
|
|
134
|
+
- Updated dependencies [1987bd7]
|
|
135
|
+
- Updated dependencies [0c4d5a1]
|
|
136
|
+
- Updated dependencies [dd24fd5]
|
|
137
|
+
- Updated dependencies [fcac573]
|
|
138
|
+
- Updated dependencies [41aa22a]
|
|
139
|
+
- Updated dependencies [c842fb7]
|
|
140
|
+
- Updated dependencies [6983478]
|
|
141
|
+
- Updated dependencies [6983478]
|
|
142
|
+
- Updated dependencies [634fd52]
|
|
143
|
+
- Updated dependencies [149800c]
|
|
144
|
+
- Updated dependencies [aafaaa9]
|
|
145
|
+
- Updated dependencies [1987bd7]
|
|
146
|
+
- Updated dependencies [74cbff9]
|
|
147
|
+
- Updated dependencies [894d51c]
|
|
148
|
+
- Updated dependencies [0040cad]
|
|
149
|
+
- Updated dependencies [a3dce2f]
|
|
150
|
+
- Updated dependencies [3656e32]
|
|
151
|
+
- Updated dependencies [43d940d]
|
|
152
|
+
- Updated dependencies [a032c5c]
|
|
153
|
+
- Updated dependencies [7f8dbc0]
|
|
154
|
+
- Updated dependencies [c71d4f3]
|
|
155
|
+
- Updated dependencies [a3dce2f]
|
|
156
|
+
- Updated dependencies [c2f3f69]
|
|
157
|
+
- Updated dependencies [3656e32]
|
|
158
|
+
- Updated dependencies [1987bd7]
|
|
159
|
+
- Updated dependencies [f42e5b7]
|
|
160
|
+
- Updated dependencies [cc2bca1]
|
|
161
|
+
- Updated dependencies [6983478]
|
|
162
|
+
- Updated dependencies [1987bd7]
|
|
163
|
+
- octane@0.1.2
|
|
164
|
+
|
|
3
165
|
## 0.1.1
|
|
4
166
|
|
|
5
167
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/vite-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Vite metaframework plugin for the octane renderer (dev SSR + routing + hydrate)",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@ripple-ts/adapter": "^0.3.
|
|
38
|
-
"octane": "0.1.
|
|
37
|
+
"@ripple-ts/adapter": "^0.3.86",
|
|
38
|
+
"octane": "0.1.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^24.3.0",
|
|
@@ -15,14 +15,14 @@ import {
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* octane RenderResult —
|
|
18
|
+
* octane RenderResult — imported from 'octane/static' (the single source of
|
|
19
|
+
* truth) rather than re-declared, so the shape can't silently drift. `prerender`
|
|
20
|
+
* is ASYNC (awaits Suspense data) and returns `{ html, css }`: `html` has any
|
|
21
|
+
* hoisted `<head>` metadata folded in, and `css` is ALREADY a deduped
|
|
19
22
|
* `<style data-octane="hash">…</style>` string (NOT a Set<string> needing a
|
|
20
|
-
* `get_css_for_hashes` lookup like Ripple)
|
|
23
|
+
* `get_css_for_hashes` lookup like Ripple), so CSS handling here is identity.
|
|
21
24
|
*
|
|
22
|
-
* @typedef {
|
|
23
|
-
* @property {string} head
|
|
24
|
-
* @property {string} body
|
|
25
|
-
* @property {string} css
|
|
25
|
+
* @typedef {import('octane/static').RenderResult} RenderResult
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -43,10 +43,10 @@ export async function handleRenderRoute(route, context, vite, octaneConfig) {
|
|
|
43
43
|
/** @type {any} */ (globalThis).rpc_modules = new Map();
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// Load the octane
|
|
46
|
+
// Load the octane static renderer. The wrappers call components directly
|
|
47
47
|
// (no ssrComponent injection — the root must NOT be marker-wrapped), so
|
|
48
|
-
// only `
|
|
49
|
-
const {
|
|
48
|
+
// only `prerender` is needed here (await-all, complete HTML).
|
|
49
|
+
const { prerender } = await vite.ssrLoadModule('octane/static');
|
|
50
50
|
|
|
51
51
|
// Load the page component (compiled in server mode by octane()).
|
|
52
52
|
const entryPath = get_route_entry_path(route.entry);
|
|
@@ -81,11 +81,11 @@ export async function handleRenderRoute(route, context, vite, octaneConfig) {
|
|
|
81
81
|
RootComponent = createPropsWrapper(/** @type {any} */ (PageComponent), pageProps);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
// Render to HTML.
|
|
85
|
-
//
|
|
86
|
-
// <script data-octane-suspense> seed.
|
|
84
|
+
// Render to HTML. prerender() is async (awaits Suspense data) and returns
|
|
85
|
+
// { html, css }: `html` has any hoisted <head> metadata folded in and
|
|
86
|
+
// already contains any inline <script data-octane-suspense> seed.
|
|
87
87
|
/** @type {RenderResult} */
|
|
88
|
-
const {
|
|
88
|
+
const { html: body, css } = await prerender(RootComponent);
|
|
89
89
|
|
|
90
90
|
// CSS is already a ready <style> string (or '') — identity, no re-wrapping.
|
|
91
91
|
const cssContent = css || '';
|
|
@@ -104,7 +104,6 @@ export async function handleRenderRoute(route, context, vite, octaneConfig) {
|
|
|
104
104
|
params: context.params,
|
|
105
105
|
});
|
|
106
106
|
const headContent = [
|
|
107
|
-
head,
|
|
108
107
|
cssContent,
|
|
109
108
|
`<script id="__octane_data" type="application/json">${escapeScript(routeData)}</script>`,
|
|
110
109
|
]
|
package/types/production.d.ts
CHANGED
|
@@ -36,15 +36,14 @@ export interface ServerManifest {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* octane RenderResult —
|
|
40
|
-
*
|
|
41
|
-
*
|
|
39
|
+
* octane RenderResult — re-exported from 'octane/server' (the single source of
|
|
40
|
+
* truth) rather than re-declared, so the shape can't silently drift. Note
|
|
41
|
+
* `render()` is async and `css` is ALREADY a ready, deduped
|
|
42
|
+
* `<style data-octane="hash">…</style>` string (NOT a Set<string> needing a
|
|
43
|
+
* `getCss` lookup like Ripple).
|
|
42
44
|
*/
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
body: string;
|
|
46
|
-
css: string;
|
|
47
|
-
}
|
|
45
|
+
export type { RenderResult } from 'octane/server';
|
|
46
|
+
import type { RenderResult } from 'octane/server';
|
|
48
47
|
|
|
49
48
|
export interface HandlerOptions {
|
|
50
49
|
render: (component: Function, props?: unknown) => Promise<RenderResult>;
|