openpencil/patches/kiwi-schema@0.5.0.patch
Danila Poyarkov ec90f35df8 PoC 2 & 3: Yoga WASM layout + Kiwi codec
Yoga WASM (yoga-layout v3.2.1):
- Vertical/horizontal auto-layout with gap, padding, alignment ✅
- Nested frames with flex-grow ✅
- Space-between distribution ✅
- 1000-node layout in 3ms ✅

Kiwi binary codec (from figma-use multiplayer module):
- 194-definition Figma schema (2178 lines) compiles in 6ms
- Encode 4 nodes → 237 bytes Zstd-compressed
- Full round-trip: encode → Zstd compress → decompress → decode ✅
- Patch kiwi-schema to allow sparse field IDs (Figma uses IDs > 312)

Extracted files: schema.ts, codec.ts, protocol.ts, client.ts, index.ts
2026-02-27 17:16:21 +03:00

14 lines
608 B
Diff

diff --git a/kiwi.js b/kiwi.js
index 26a46b6a2efbbdb9623a5275751eaaa10378e617..5a57b99fd2fd5fe087fc1c556672c58aa63b57ec 100644
--- a/kiwi.js
+++ b/kiwi.js
@@ -2167,7 +2167,7 @@ function verify(root) {
if (field.value <= 0) {
error("The id for field " + quote(field.name) + " must be positive", field.line, field.column);
}
- if (field.value > fields.length) {
+ if (false && field.value > fields.length) {
error("The id for field " + quote(field.name) + " cannot be larger than " + fields.length, field.line, field.column);
}
values.push(field.value);