Skip to content

Commit 30d84c9

Browse files
jaggujiclaude
andauthored
Release v1.2.0 — fidelity release (version bump + changelog) (#66)
Release prep for **v1.2.0**. Bumps `package.json` 1.1.0 → **1.2.0** and consolidates the empty `[Unreleased]` into a complete `[1.2.0]` CHANGELOG section. No code changes — all the generator work already landed in #62. ## What's in 1.2.0 (all from #62) Driven by exhaustively validating generated bindings against `@juspay/blend-design-system@0.0.37-beta.6` (per-component review, several rounds). **Fixed** - Uncompilable output from recursive type groups (#61) - `key`/`ref` stripped from nested data records (#63) - Discriminated-union props dropped — Card/Badge/SelectItemV2 (#63) - First-party fields swallowed by the `domProps` spread (#63) - Multi-arg / tuple-returning fns bound as components (#63) - `React.Context<T>` faked as a component (#63) - Nullability/optionality flips — `T|null`→`Nullable.t`, `|undefined`→optional, required props no longer flipped (#63/#64/#65) - Numeric enums as string tags (#63), deep self-ref truncation (#63), `Error`→`JsError.t` (#63), intersection-of-arrays (#63), depth-truncated token ghosts (#63) - `ResponsiveText` required CSS props (#64); single-sig fn mis-modelled as overload — `Button.onClick` (#65) - Builtin type-name shadowing (#61) **Added** - Fixed-arity TS tuples → ReScript tuples (#65) **Changed** (regeneration produces a sizable one-time diff) - Shared types organized per home module — no giant catch-all (#61) - Descriptive, version-stable anonymous-record names (#63) ## Why 1.2.0 (not 1.1.1) CLI/API unchanged, but generated *output* changes substantially (module reorg + naming + tuples + ~16 fixes) → minor, mirroring how 1.1.0 was scoped. ## Closes Resolves #63 and #64 (fully fixed). #65's actionable items (B1/B2/B4/B5) are done; B3 is by-design and C1 (discriminated-union variant) is a tracked future enhancement. Fixes #63 Fixes #64 ## After merge — to publish ```bash git checkout main && git pull git tag v1.2.0 git push origin v1.2.0 # triggers publish-npm.yml (OIDC → npm `latest`) ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c530b59 commit 30d84c9

2 files changed

Lines changed: 62 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,67 @@ This project adheres to [Semantic Versioning](https://semver.org/).
77

88
_Nothing yet._
99

10+
## [1.2.0] — 2026-06-17
11+
12+
The "fidelity" release, driven by exhaustively validating generated bindings against
13+
`@juspay/blend-design-system@0.0.37-beta.6` (a per-component review of all 212 components,
14+
across several rounds). It fixes an **uncompilable-output** bug, **reorganizes shared types
15+
per component**, and resolves **~16 silent fidelity defects** (bindings that compiled but
16+
mis-typed a prop). No CLI/API changes. Generated *output* is more correct and more faithfully
17+
shaped — but module and anonymous-type **names differ from 1.1.0**, so a regeneration will
18+
produce a sizable (one-time) diff.
19+
20+
### Fixed
21+
- **Uncompilable output from recursive type groups** (#61). A parameterized type referenced
22+
before it acquired its type argument (e.g. `option<annotation>` where `annotation<'a>`) emitted
23+
uncompilable ReScript. A post-extraction fixpoint pass propagates type parameters across the
24+
group and re-syncs every reference, so no constructor is left under-applied.
25+
- **Generated type names never shadow a pervasive** (#61). An upstream interface named `Array`/
26+
`Option`/… (→ `array`/`option`) is suffixed (`array2`) so it can't shadow the builtin.
27+
- **`key` / `ref` stripped from nested data records** (#63). They're React-reserved only on a
28+
component's top-level props; a nested data record (Highcharts `colors: { key; color }[]`) keeps
29+
them.
30+
- **Discriminated-union props dropped** (#63). `Base & (A | B | C)` kept only the props common to
31+
all arms (`Card`/`Badge`/`SelectItemV2` were unusable) — all arms' props are now emitted, with
32+
arm-specific ones optional.
33+
- **First-party fields swallowed by the `...JsxDOM.domProps` spread** (#63). Own fields whose names
34+
collide with DOM attributes (`id`/`size`/`shape`) keep their real types (`AvatarData.id`).
35+
- **Multi-arg / tuple-returning functions bound as `@react.component`** (#63). They now bind as
36+
functions, so dropped arguments (`renderVariantFallbackValue`'s 2nd arg) are restored.
37+
- **`React.Context<T>` faked as a component** (#63). Binds as the context value `React.Context.t<T>`.
38+
- **Nullability / optionality flips** (#63, #64, #65). `T | null``Nullable.t<T>` for any single
39+
type **and** multi-type unions (`number | string | null`), including callback params/returns;
40+
`| undefined` (and indexed access into an optional first-party prop) → optional; required props
41+
(`TimelineHeader.title`, `ResponsiveText.fontSize`, …) are no longer flipped optional; merged-prop
42+
optionality is taken from the first-party signature (`UnitInput.value`).
43+
- **Numeric enums emitted as string tags** (#63). `enum { vertical = 0 }``@as(0)`, not `@as("0")`.
44+
- **Deep self-references truncated to `string`** (#63). A direct self-reference resolves past the
45+
depth bound (`SingleSelectV2ItemType.subMenu` is recursive), while the bound still protects the
46+
unbounded Highcharts graph.
47+
- **Global `Error` → unflagged `string`** (#63). Now the stdlib `JsError.t`.
48+
- **Intersection-of-array types built a bogus record** (#63). `Item[] & Array<Item & {…}>`
49+
(`NestedSelectDrawer.items`) is now `array<…>`, not a `{ ...JsxDOM.domProps }` record.
50+
- **Depth-truncated token ghosts** (#63). An all-`string` ghost is healed from a structurally-richer
51+
same-module twin (`MenuV2` color tokens).
52+
- **Single-signature functions mis-modelled as overloads** (#65). A function that is one first-party
53+
signature plus an inherited one (or an optional-param expansion) — `Button.onClick` — is a plain
54+
callback (`option<…> => unit`), not an opaque overload module; genuine overloads are unaffected.
55+
56+
### Added
57+
- **Fixed-arity TS tuples → ReScript tuples** (#65). `[number, number]``(float, float)`,
58+
`[string, number]``(string, float)`. Variadic/optional-element/1-tuples stay the flagged
59+
`string` fallback (ReScript tuples are fixed-arity).
60+
61+
### Changed
62+
- **Shared types are organized per home module** (#61). Anonymous-record structural dedup is scoped
63+
per component, so types live in the module the library declares them in instead of fusing dozens
64+
of unrelated components into one giant catch-all (`HighchartsSharedTypes` held 2409/2578 types for
65+
blend). Only genuine mutual recursion now merges into a `*SharedTypes` module.
66+
- **Descriptive, version-stable anonymous-record names** (#63). An anonymous `{…}` is named
67+
`<home><Prop>Config` (e.g. `avatarSizeConfig`) instead of a globally-numbered `<prop>Config`
68+
(`smConfig19`), so names say which component they belong to and unrelated upstream changes no
69+
longer renumber them.
70+
1071
## [1.1.0] — 2026-06-15
1172

1273
The "real-world packages" release: the generator now targets **general TypeScript

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@juspay/rescript-bindgen",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "Deterministic TypeScript -> ReScript binding generator. Reads .d.ts via the TypeScript compiler API and emits type-safe @react.component bindings — no AI, no %identity.",
55
"type": "module",
66
"main": "src/index.mjs",

0 commit comments

Comments
 (0)