@void/svelte 0.9.1 → 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
@@ -571,7 +571,7 @@ export async function renderPage(pageObj, assetTags) {
571
571
  }
572
572
  function generateClientEntry(scan, pagesDir, viewTransitions, prefetch, staticPageData) {
573
573
  return `
574
- import { hydrate } from "svelte";
574
+ import { hydrate, mount } from "svelte";
575
575
  import { writable } from "svelte/store";
576
576
  import App from "@void/svelte/App.svelte";
577
577
  import { setActionRouter } from "@void/svelte";
@@ -639,7 +639,8 @@ routeParams = initialPageData.params || {};
639
639
  paramsStore.set(routeParams);
640
640
 
641
641
  const appEl = document.getElementById("app");
642
- hydrate(App, {
642
+ if (!appEl) throw new Error("pages: Missing #app element for Void Svelte pages hydration.");
643
+ const appOptions = {
643
644
  target: appEl,
644
645
  props: {
645
646
  page: initialComponent,
@@ -662,7 +663,12 @@ hydrate(App, {
662
663
  navigation: navigationStore,
663
664
  },
664
665
  },
665
- });
666
+ };
667
+ if (appEl.getAttribute("data-void-ssr") === "false") {
668
+ mount(App, appOptions);
669
+ } else {
670
+ hydrate(App, appOptions);
671
+ }
666
672
 
667
673
  appEl.setAttribute("data-hydrated", "true");
668
674
  export { reactiveRouter as router };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@void/svelte",
3
- "version": "0.9.1",
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
  "svelte": "^5.55.5",
45
45
  "vite": "npm:@voidzero-dev/vite-plus-core@0.1.20",
46
46
  "vite-plus": "^0.1.20",
47
- "void": "0.9.1"
47
+ "void": "0.9.3"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "svelte": "^5.0.0",
51
51
  "vite": "^8.0.0",
52
- "void": "0.9.1"
52
+ "void": "0.9.3"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "vp pack",