@bun-native/solid 0.33.0 → 0.33.1

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
@@ -2,4 +2,4 @@
2
2
 
3
3
  SolidJS renderer for Bun Native desktop windows.
4
4
 
5
- Part of [Bun Native](https://github.com/0xPlayerOne/bun-native), an experimental developer preview. Version 0.33.0 was built from [fa8bef754122](https://github.com/0xPlayerOne/bun-native/tree/fa8bef754122621d4235eb06e30bb1085b4f7b1e) and published from GitHub Actions with npm provenance. Use the Bun revision pinned in that commit's toolchain.json. Start with the [getting-started guide](https://github.com/0xPlayerOne/bun-native/blob/fa8bef754122621d4235eb06e30bb1085b4f7b1e/docs/getting-started.md); `bun-native host install` fetches the matching release host. The license notice is in LICENSE.
5
+ Part of [Bun Native](https://github.com/0xPlayerOne/bun-native), an experimental developer preview. Version 0.33.1 was built from [c56fdd675365](https://github.com/0xPlayerOne/bun-native/tree/c56fdd6753653a10144a4167c1d3dfb3c38a0647) and published from GitHub Actions with npm provenance. Use the Bun revision pinned in that commit's toolchain.json. Start with the [getting-started guide](https://github.com/0xPlayerOne/bun-native/blob/c56fdd6753653a10144a4167c1d3dfb3c38a0647/docs/getting-started.md); `bun-native host install` fetches the matching release host. The license notice is in LICENSE.
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "commit": "fa8bef754122621d4235eb06e30bb1085b4f7b1e",
4
- "tree": "f805e2eb19a4e10fc29d1dc827cf5bc617b5773b",
3
+ "commit": "c56fdd6753653a10144a4167c1d3dfb3c38a0647",
4
+ "tree": "c6e81b3f9d041e11dd0413b5fdd7a50910383854",
5
5
  "files": {
6
6
  "package.json": {
7
- "bytes": 2164,
8
- "sha256": "db50b6f81f25c113a46f8c9b038bc548a92effaeb4ad9562e5e95044baa7b66f"
7
+ "bytes": 2115,
8
+ "sha256": "caf866d56f3cd7530d5735ecbf62512e9e22526bc44c75a4b48a18c26352c0b8"
9
9
  },
10
10
  "packages/solid/package.json": {
11
11
  "bytes": 310,
@@ -20,8 +20,8 @@
20
20
  "sha256": "0ea5386e11e9df63541c381d4794fe0edc0e8269158fa3ac6b6739d12f16c729"
21
21
  },
22
22
  "packages/solid/src/mount.ts": {
23
- "bytes": 1323,
24
- "sha256": "411fa124f9ef0a3aab4333ec6fe8aee57bc8ba4032565e2c1cb361d9d89c3ab2"
23
+ "bytes": 1936,
24
+ "sha256": "6395762b787d7929cf616b083d91b171df14e756196f33cf8195391049f2ce55"
25
25
  },
26
26
  "packages/solid/src/renderer.ts": {
27
27
  "bytes": 1292,
@@ -33,8 +33,8 @@
33
33
  }
34
34
  },
35
35
  "toolchain": {
36
- "bytes": 3012,
37
- "sha256": "00c3f707aae8abe9ca75cd2e162f5e1c7c34362a03675da39afead60d856066a"
36
+ "bytes": 3234,
37
+ "sha256": "9f4d9362cb4cc38c0f4e705295789a0cbfec46ffdd007e0541b9441a7c3003a7"
38
38
  },
39
39
  "dependencyLock": {
40
40
  "bytes": 28357,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bun-native/solid",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -18,9 +18,11 @@
18
18
  },
19
19
  "description": "SolidJS renderer for Bun Native desktop windows.",
20
20
  "dependencies": {
21
- "@bun-native/core": "0.33.0",
22
- "solid-js": "1.9.18",
23
- "@bun-native/renderer": "0.33.0"
21
+ "@bun-native/core": "0.33.1",
22
+ "@bun-native/renderer": "0.33.1"
23
+ },
24
+ "peerDependencies": {
25
+ "solid-js": "1.9.18"
24
26
  },
25
27
  "repository": {
26
28
  "type": "git",
package/src/mount.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NativeStateError, type NativeWindow } from '@bun-native/core'
2
2
  import { createRenderRoot, type RenderOptions, type RenderRoot } from '@bun-native/renderer'
3
- import { createMemo, createRoot, createSignal } from 'solid-js'
3
+ import { catchError, createMemo, createRoot, createSignal } from 'solid-js'
4
4
  import type { JSX } from './jsx.ts'
5
5
  import { renderer } from './renderer.ts'
6
6
 
@@ -32,10 +32,24 @@ export function render(
32
32
  assertReactiveRuntime()
33
33
  return createRenderRoot(
34
34
  window,
35
- ({ container, onCleanup }) => {
35
+ ({ container, onCleanup, fail }) => {
36
36
  createRoot((dispose) => {
37
37
  onCleanup(dispose)
38
- renderer.insert(container, component())
38
+ // An error from a later reactive update ends only this root, as in
39
+ // React, instead of escaping through whichever setter (usually a
40
+ // native listener) ran it and ending the application. An error while
41
+ // evaluating the component still rejects `ready` synchronously.
42
+ let mounted = false
43
+ let initial: { cause: unknown } | undefined
44
+ catchError(
45
+ () => renderer.insert(container, component()),
46
+ (cause) => {
47
+ if (mounted) fail(cause)
48
+ else initial ??= { cause }
49
+ }
50
+ )
51
+ if (initial) throw initial.cause
52
+ mounted = true
39
53
  })
40
54
  },
41
55
  options