@torpor/build 0.1.17 → 0.1.19

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @torpor/build
2
2
 
3
+ ## 0.1.19
4
+
5
+ ### Patch Changes
6
+
7
+ - 170c886: Debug: double hydration
8
+
9
+ ## 0.1.18
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [fb896c6]
14
+ - Updated dependencies [85bccf6]
15
+ - @torpor/view@0.0.14
16
+ - @torpor/unplugin@0.1.10
17
+
3
18
  ## 0.1.17
4
19
 
5
20
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@torpor/build",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "A framework for building sites and apps with Torpor",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -55,8 +55,8 @@
55
55
  "dotenv": "^16.5.0",
56
56
  "vite": "^6.3.5",
57
57
  "vite-tsconfig-paths": "^5.1.4",
58
- "@torpor/unplugin": "^0.1.9",
59
- "@torpor/view": "^0.0.13"
58
+ "@torpor/unplugin": "^0.1.10",
59
+ "@torpor/view": "^0.0.14"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@trivago/prettier-plugin-sort-imports": "^5.2.2",
@@ -1,4 +1,5 @@
1
1
  import manifest from "@torpor/build/manifest";
2
+ // @ts-ignore This errors in the Cloudflare build?
2
3
  import { $page } from "@torpor/build/state";
3
4
  import { hydrate, mount } from "@torpor/view";
4
5
  import { type Component, type SlotRender } from "@torpor/view";
@@ -39,8 +40,6 @@ async function navigateToLocation(location: Location, firstTime = false) {
39
40
  }
40
41
 
41
42
  async function navigate(url: URL, firstTime = false): Promise<boolean> {
42
- //console.log(`navigating to '${path}'${query.size ? ` with ${query}` : ""}`);
43
-
44
43
  const parent = document.getElementById("app");
45
44
  if (!parent) {
46
45
  // TODO: 500
@@ -51,6 +50,8 @@ async function navigate(url: URL, firstTime = false): Promise<boolean> {
51
50
  const path = url.pathname;
52
51
  const query = url.searchParams;
53
52
 
53
+ console.log(`navigating to '${path}'${query.size ? ` with ${query}` : ""}`);
54
+
54
55
  const route = router.match(path, query);
55
56
  if (!route) {
56
57
  // TODO: 404
@@ -137,12 +138,14 @@ async function navigate(url: URL, firstTime = false): Promise<boolean> {
137
138
  }
138
139
 
139
140
  if (firstTime) {
141
+ console.log("hydrating with node", parent, parent?.firstChild);
140
142
  hydrate(parent, component, $props, slots);
141
143
  } else {
142
144
  // TODO: Clear ranges, reuse layouts etc
143
145
  parent.textContent = "";
144
146
 
145
147
  try {
148
+ console.log("mounting");
146
149
  mount(parent, component, $props, slots);
147
150
  } catch (error) {
148
151
  // TODO: Show a proper Error component
@@ -1,4 +1,5 @@
1
1
  import manifest from "@torpor/build/manifest";
2
+ // @ts-ignore This errors in the Cloudflare build?
2
3
  import { $page } from "@torpor/build/state";
3
4
  import { type ServerComponent, type ServerSlotRender } from "@torpor/view";
4
5
  import notFound from "../response/notFound.ts";