[DO NOT MERGE] test: regenerate bindings with rescript-bindgen #168 (@tag variants) - #138
Closed
jagguji wants to merge 1 commit into
Closed
[DO NOT MERGE] test: regenerate bindings with rescript-bindgen #168 (@tag variants)#138jagguji wants to merge 1 commit into
jagguji wants to merge 1 commit into
Conversation
Regenerated against the pkg.pr.new build of juspay/rescript-bindgen#168, which maps a nested discriminated union to a `@tag` variant instead of a flattened record. resolved: https://pkg.pr.new/@juspay/rescript-bindgen@168 version string: 1.3.0 (a pkg.pr.new build reports the version it branched from — the URL and hash below are what identify it) extract.mjs: 908a40b9cd780091 package.json is DELIBERATELY untouched: the candidate was installed with --no-save, so this branch is purely regenerated src/. That also means it must not be merged — src/ here cannot be reproduced from the pinned bindgen 1.3.0, which would break the "same blend version always produces byte-identical bindings" guarantee. A real adoption is a separate package.json bump PR once #168 ships. Changes (4 files, +28/-41): - DataTableTypes.rowAnimationConfig: record -> @tag variant. Closes the binding half of #134 — `Bezier` can no longer be built without its curve. - MenuV2Types.menuV2FlatRow: 6 `%identity` externals + 3 per-arm records -> one matchable variant; retires 3 `⚪ loose` `type_` fields. - BlendDesignSystemBindings.flattenMenuV2Groups: returns the variant. - 3360 -> 3356 shared types. Verified locally: generate exit 0, 219/226 usable, 0 broken (buckets identical to baseline), all 432 modules compile, and the #134 crash shape now fails to compile with "Some required record fields are missing: duration bezier". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
commit: |
jagguji
added a commit
that referenced
this pull request
Aug 6, 2026
…ate (@tag variants) (#139) * chore(deps): bump @juspay/rescript-bindgen to ^1.4.0-beta.0 + regenerate 1.4.0-beta.0 ships #167/#169: a nested discriminated union now maps to a `@tag` variant instead of a flattened record. - DataTableTypes.rowAnimationConfig: record -> @tag variant. Closes the binding half of #134 — `Bezier` can no longer be constructed without its curve, so the DataTable crash is now a compile error rather than something the library's runtime guard has to absorb. - MenuV2Types.menuV2FlatRow: 6 `%identity` externals + 3 per-arm records -> one matchable variant; retires 3 `⚪ loose` `type_` fields. Reading an arm was an unchecked cast; it is now compiler-verified. - BlendDesignSystemBindings.flattenMenuV2Groups returns the variant. - 3360 -> 3356 shared types. Buckets unchanged: 226 components, 219 usable, 7 review, 0 broken. All 305 modules compile. src/ is byte-identical to the pkg.pr.new build of #168 that was tested in #138, so the published beta reproduces exactly what was reviewed. BREAKING for consumers of both types — `rowAnimationConfig` is no longer a record, and `MenuV2FlatRow.t` with its from*/as* externals is gone. Known issue in this beta, NOT triggered by blend: a self-referential discriminated union (`type T = {kind:'leaf',…} | {kind:'branch', children: T[]}`) recurses without bound and the component is dropped from the output with only an `extract-error` line. blend has recursive types (MenuItemType.subMenu) and discriminated unions (MenuV2FlatRow) but never both in one type, so nothing here is affected. Verified still present in 1.4.0-beta.0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * chore: drop stray .claude worktree gitlink from the previous commit `git add -A` in the bump commit swept in `.claude/worktrees/feat+figma-code-connect` as an embedded-repository gitlink (mode 160000). That is local Claude Code state, not repository content, and a gitlink is unusable to anyone cloning. Net effect across the branch is nil — the squash merge sees only the intended 6 files. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Superseded by #139, which merged the same regeneration via the published |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Regenerated against the pkg.pr.new build of rescript-bindgen#168, which maps a nested discriminated union to a
@tagvariant instead of a flattened record.Which build produced this
The version string is not proof — a pkg.pr.new build reports the version it branched from, so
node_modulesreads1.3.0either way. The resolved URL and hash are what identify it. (An earlier local attempt silently used a stale preview whose hash was137c08b0…; same version string, different code.)The diff — 4 files, +28/−41
DataTableTypes.rowAnimationConfig— record →@tagvariant:MenuV2Types.menuV2FlatRow— 6%identityexternals and 3 per-arm records → one matchable variant, retiring 3⚪ loosetype_: stringfields. Reading an arm was previously an unchecked cast; it is now compiler-verified.BlendDesignSystemBindings.flattenMenuV2Groupsreturns the variant. Shared types 3360 → 3356.Verification
npm run generatenpm run buildBoth arms construct, and the runtime object is flat with the real tag — exactly what the library reads:
Pattern matching compiles to a bare tag check, no wrapper:
The #134 crash shape now fails to compile:
That is the binding half of #134 closed at compile time, rather than relying on the runtime guard in juspay/blend-design-system#1653.
Migration notes for testing
This is a breaking change for existing consumers of both types.
rowAnimationConfigwas a record; it is now a variant:MenuV2Types.MenuV2FlatRow.tand itsfrom*/as*externals are gone — replace the casts with aswitch.One ergonomic wrinkle worth knowing: pattern matching needs the type in scope, or the constructors don't resolve:
Without the annotation you get "The variant constructor Bezier can't be found." Normal ReScript behaviour for a variant declared in another module, but it will be the first thing anyone hits.
Known issue in the candidate, not surfaced here
rescript-bindgen#168 has an open blocker: a self-referential discriminated union (
type T = {kind:'leaf',…} | {kind:'branch', children: T[]}) recurses without bound and the component is dropped from the output entirely. blend has recursive types (MenuItemType.subMenu) and discriminated unions (MenuV2FlatRow) but never both in one type, so this regeneration cannot surface it. A green result here is not evidence that bug is fixed.🤖 Generated with Claude Code