@void/vue 0.9.2 → 0.9.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/README.md CHANGED
@@ -105,6 +105,10 @@ import { defineHandler } from 'void';
105
105
  export const loader = defineHandler(() => ({ title: 'Home' }));
106
106
  ```
107
107
 
108
+ Export `ssr = false` from a page's `.server.ts` file to skip server-rendered
109
+ component HTML for that route while still running its loader on the first
110
+ request.
111
+
108
112
  ## Tests
109
113
 
110
114
  - `test/unit/use-form.test.ts`
package/dist/plugin.mjs CHANGED
@@ -613,7 +613,7 @@ export async function renderPage(pageObj, assetTags) {
613
613
  }
614
614
  function generateClientEntry(scan, pagesDir, viewTransitions, prefetch, staticPageData) {
615
615
  return `
616
- import { createSSRApp, h, reactive, provide, shallowRef, nextTick, ref } from "vue";
616
+ import { createApp, createSSRApp, h, reactive, provide, shallowRef, nextTick, ref } from "vue";
617
617
  import { createDeferred, resolveDeferred, rejectDeferred } from "@void/vue/deferred";
618
618
  import { setActionRouter } from "@void/vue";
619
619
  import { createRouterFacade, createVoidRouter, idleNavigationState } from "void/pages-client";
@@ -685,7 +685,10 @@ currentProps.value = initialPageData.props;
685
685
  currentComponent.value = initialComponent;
686
686
  currentLayouts.value = initialLayouts;
687
687
 
688
- const app = createSSRApp({
688
+ const appEl = document.getElementById("app");
689
+ if (!appEl) throw new Error("pages: Missing #app element for Void Vue pages hydration.");
690
+ const createVoidApp = appEl?.getAttribute("data-void-ssr") === "false" ? createApp : createSSRApp;
691
+ const app = createVoidApp({
689
692
  setup() {
690
693
  provide("__void_shared", shared);
691
694
  provide("__void_errors", errors);
@@ -706,8 +709,8 @@ const app = createSSRApp({
706
709
  }
707
710
  });
708
711
 
709
- app.mount("#app");
710
- document.getElementById("app").setAttribute("data-hydrated", "true");
712
+ app.mount(appEl);
713
+ appEl.setAttribute("data-hydrated", "true");
711
714
  export { reactiveRouter as router };
712
715
  start();
713
716
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void/vue",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/voidzero-dev/void.git",
@@ -44,12 +44,12 @@
44
44
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.20",
45
45
  "vite-plus": "^0.1.20",
46
46
  "vue": "^3.5.34",
47
- "void": "0.9.2"
47
+ "void": "0.9.3"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "vite": "^8.0.0",
51
51
  "vue": "^3.5.0",
52
- "void": "0.9.2"
52
+ "void": "0.9.3"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "vp pack",