@octanejs/vite-plugin 0.1.56 → 0.1.57

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/vite-plugin",
3
- "version": "0.1.56",
3
+ "version": "0.1.57",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -47,17 +47,17 @@
47
47
  },
48
48
  "dependencies": {
49
49
  "@ripple-ts/adapter": "^0.4.0",
50
- "@octanejs/app-core": "0.0.52"
50
+ "@octanejs/app-core": "0.0.53"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "vite": "^8.0.16",
54
- "octane": "^0.3.0"
54
+ "octane": "^0.3.1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/jsdom": "30.0.0",
58
58
  "@types/node": "^24.13.3",
59
59
  "playwright": "^1.61.1",
60
60
  "vite": "^8.1.5",
61
- "octane": "0.3.0"
61
+ "octane": "0.3.1"
62
62
  }
63
63
  }
@@ -5,6 +5,7 @@ export {
5
5
  injectHydrationEntry,
6
6
  nonceAttribute,
7
7
  prepareStreamingHydrationTemplate,
8
+ serializeRouteData,
8
9
  splitSsrTemplate,
9
10
  validateSsrTemplate,
10
11
  } from '@octanejs/app-core/html';
@@ -9,6 +9,7 @@ import {
9
9
  injectHydrationEntry,
10
10
  nonceAttribute,
11
11
  prepareStreamingHydrationTemplate,
12
+ serializeRouteData,
12
13
  splitSsrTemplate,
13
14
  } from './html-template.js';
14
15
  import {
@@ -146,8 +147,7 @@ export async function handleRenderRoute(
146
147
  // params, the request url, and the optional preHydrate module the client
147
148
  // entry awaits before hydrateRoot. routeIndex stays for debugging /
148
149
  // Phase-2 static maps.
149
- const routeData = JSON.stringify({
150
- ...(clientBuild === undefined ? {} : { clientBuild, streamedSignals }),
150
+ const routeData = serializeRouteData({
151
151
  entry: entryPath,
152
152
  exportName: get_route_entry_export_name(route.entry) ?? null,
153
153
  layout: route.layout ?? null,
@@ -159,8 +159,10 @@ export async function handleRenderRoute(
159
159
  pending: serializeComponentEntry(pendingEntry),
160
160
  catch: serializeComponentEntry(catchEntry),
161
161
  },
162
+ clientBuild,
163
+ streamedSignals,
162
164
  });
163
- const headContent = `<script id="__octane_data" type="application/json"${nonceAttribute(nonce)}>${escapeScript(routeData)}</script>`;
165
+ const headContent = `<script id="__octane_data" type="application/json"${nonceAttribute(nonce)}>${routeData}</script>`;
164
166
 
165
167
  // Load and process index.html template.
166
168
  const templatePath = join(vite.config.root, 'index.html');
@@ -277,15 +279,6 @@ function getRenderRouteIndex(config, route) {
277
279
  return index === -1 ? undefined : index;
278
280
  }
279
281
 
280
- /**
281
- * Escape script content to prevent XSS in the inline JSON data block.
282
- * @param {string} str
283
- * @returns {string}
284
- */
285
- function escapeScript(str) {
286
- return str.replace(/</g, '\\u003c').replace(/>/g, '\\u003e');
287
- }
288
-
289
282
  /**
290
283
  * Generate an error HTML page for development.
291
284
  *