@bun-native/core 0.33.2 → 0.33.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
@@ -2,4 +2,4 @@
2
2
 
3
3
  The public TypeScript API of the Bun Native desktop framework.
4
4
 
5
- Part of [Bun Native](https://github.com/0xPlayerOne/bun-native), an experimental developer preview. Version 0.33.2 was built from [577f6fc5015b](https://github.com/0xPlayerOne/bun-native/tree/577f6fc5015b6eeef956efcc63f97e2a749d74ff) 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/577f6fc5015b6eeef956efcc63f97e2a749d74ff/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.3 was built from [bf02b4420333](https://github.com/0xPlayerOne/bun-native/tree/bf02b44203336646cf156e369cd57b84496a3a7d) 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/bf02b44203336646cf156e369cd57b84496a3a7d/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": "577f6fc5015b6eeef956efcc63f97e2a749d74ff",
4
- "tree": "c599e781af2ce0749d5e3a6d8700834690e872f4",
3
+ "commit": "bf02b44203336646cf156e369cd57b84496a3a7d",
4
+ "tree": "5943b16183fcc166a5694a7da25bd1d33a3788d4",
5
5
  "files": {
6
6
  "package.json": {
7
7
  "bytes": 2258,
8
- "sha256": "38e2f0f89b5f6c4ba80b3baefcdf0806dd73c684294153df74ab470fda6bf3f9"
8
+ "sha256": "52d4fbfcecc45b4c0da143af60977d68491559283dc78ee31ce720e51d001106"
9
9
  },
10
10
  "packages/core/package.json": {
11
11
  "bytes": 282,
@@ -92,8 +92,8 @@
92
92
  "sha256": "c460c4e1a2e9d337e79294bce333e53896381529af8f7e35b23e207c6e132b85"
93
93
  },
94
94
  "packages/core/src/tree.ts": {
95
- "bytes": 26849,
96
- "sha256": "625288cead96ed1705dcadbb7e88382c4b1e9db5999ec26550521095939bfc0f"
95
+ "bytes": 27068,
96
+ "sha256": "1fd82709389a24a22748d578a98b973e522d8ea60618bfb5e09611add9e8f5d0"
97
97
  },
98
98
  "packages/core/src/types.ts": {
99
99
  "bytes": 14315,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bun-native/core",
3
- "version": "0.33.2",
3
+ "version": "0.33.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "description": "The public TypeScript API of the Bun Native desktop framework.",
20
20
  "dependencies": {
21
- "@bun-native/protocol": "0.33.2",
22
- "@bun-native/runtime": "0.33.2"
21
+ "@bun-native/protocol": "0.33.3",
22
+ "@bun-native/runtime": "0.33.3"
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
package/src/tree.ts CHANGED
@@ -622,11 +622,17 @@ export class Transaction implements NativeBatch {
622
622
  */
623
623
  validate(): void {
624
624
  const { limits, nodes } = this
625
- if (this.text.oversized.size || this.textBytes() > limits.max_text_bytes_per_window)
626
- return this.walk()
627
- for (const node of nodes.writes.values())
628
- for (const size of textSizesOf(node.element))
625
+ if (this.text.oversized.size) return this.walk()
626
+ let bytes = this.text.bytes
627
+ for (const [id, node] of nodes.writes) {
628
+ bytes -= textBytesOf(nodes.base.get(id)?.element)
629
+ for (const size of textSizesOf(node.element)) {
629
630
  if (size > limits.max_text_bytes) return this.walk()
631
+ bytes += size
632
+ }
633
+ }
634
+ for (const id of nodes.deletes) bytes -= textBytesOf(nodes.base.get(id)?.element)
635
+ if (bytes > limits.max_text_bytes_per_window) return this.walk()
630
636
  const seen = new Set<number>()
631
637
  // Flat (id, depth) pairs.
632
638
  const pending: number[] = []