You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
juspay/blend-design-system publishes a pkg.pr.new preview for every PR / push to dev (via their ci.ymlpreview job). A ReScript consumer can grab that preview by installing:
Today's escape hatch: if the consumer writes their own bindings inline, they can use any new component / prop from that preview immediately. The bindings in @subham_/rescript-blend (this repo) are nice-to-have but not load-bearing.
The future we're moving toward: this package becomes the canonical source of ReScript bindings, and consumers stop writing local wrappers. The moment that happens, consuming an unreleased blend change requires a matching, unreleased binding — and we don't have a flow for that yet.
Problem
When a dev wants to test an unmerged blend PR from their ReScript app, they need two artefacts at matching versions:
The preview @juspay/blend-design-system@<blend-sha>
A preview of @juspay/rescript-blend where src/*.res has been regenerated against that blend SHA.
Without (2), any new component / prop in the blend preview is unreachable from ReScript — the app compiles against stale bindings that don't know the new API exists.
The existing sync-bindings.yml in this repo can generate the new bindings on workflow_dispatch, but it opens a PR and waits for human review and NPM release. That's fine for stable adoption (minutes → hours → days) but useless for "I want to try this blend PR right now."
Options
A. Manual generate + file: / yalc install
Dev clones blend-rescript, sets @juspay/blend-design-system to the pkg.pr.new URL in devDeps, runs npm run generate -- --all, then installs the resulting tree into their app via yalc or npm install file:../blend-rescript.
👍 Works today, no infra changes
👎 Every consumer repeats the toolchain setup (needs LITELLM_API_KEY etc.)
👎 Nothing in CI guarantees the generated bindings actually compile
B. workflow_dispatch → open PR → merge → wait for NPM release
The current sync-bindings.yml path. Review-gated, safe, but slow — not a fit for "I just want to try this PR."
C. Upstream dispatch → regenerate in CI → publish matching pkg.pr.new preview ⭐️
Add a step to blend-design-system's ci.yml that, after publishing its own preview, fires a repository_dispatch (blend-preview-published) into this repo with payload { blend_sha, blend_spec }.
This repo reacts:
Creates a branch preview/blend-<sha>.
npm install --no-save @juspay/blend-design-system@<blend_spec> — pins to that exact preview.
npm run generate -- --all — regenerate bindings.
rescript format -c + npm run build — gate on green.
Push the branch (does not open a PR — this is a preview, not a merge candidate).
pkg.pr.new GitHub App picks up the branch push and publishes https://pkg.pr.new/juspay/blend-rescript@<blend-rescript-sha>.
👎 Requires a PAT on the blend side (BLEND_RESCRIPT_PAT, Actions: Write, Contents: Read on juspay/blend-rescript)
👎 Uses the LiteLLM quota for every blend PR — meaningful cost if blend ships many PRs
D. Don't solve it
Tell consumers: if you need an unreleased blend API, write a one-file inline binding locally. Accepts that the "canonical bindings" story has a permanent escape hatch for unreleased blend.
👍 Zero work
👎 Defeats the purpose of making this repo canonical
Recommendation
C, but with two guardrails:
Preview-publish job runs only if the blend PR has a specific label (e.g. needs-rescript-preview). Default blend PRs skip it, which keeps LiteLLM cost bounded to the few PRs that actually need cross-language validation.
Generated preview branches named preview/blend-<sha> are auto-deleted by a nightly workflow if older than 14 days, so the repo doesn't accumulate hundreds of dead branches.
Opt-in via label vs. every blend PR? (Cost vs. coverage.)
Who owns the BLEND_RESCRIPT_PAT secret on the blend side?
Is auto-publishing previews off .res regenerated by an LLM acceptable without human review? (Arguments both ways — compile success is a strong signal, but runtime correctness isn't checked.)
Out of scope here
The in-repo bindings quality loop (already handled by sync-bindings.yml + 3-retry feedback).
Stable release adoption (already handled by the manual sync-bindings.yml + PR review path).
Context
juspay/blend-design-systempublishes apkg.pr.newpreview for every PR / push todev(via theirci.ymlpreviewjob). A ReScript consumer can grab that preview by installing:Today's escape hatch: if the consumer writes their own bindings inline, they can use any new component / prop from that preview immediately. The bindings in
@subham_/rescript-blend(this repo) are nice-to-have but not load-bearing.The future we're moving toward: this package becomes the canonical source of ReScript bindings, and consumers stop writing local wrappers. The moment that happens, consuming an unreleased blend change requires a matching, unreleased binding — and we don't have a flow for that yet.
Problem
When a dev wants to test an unmerged blend PR from their ReScript app, they need two artefacts at matching versions:
@juspay/blend-design-system@<blend-sha>@juspay/rescript-blendwheresrc/*.reshas been regenerated against that blend SHA.Without (2), any new component / prop in the blend preview is unreachable from ReScript — the app compiles against stale bindings that don't know the new API exists.
The existing
sync-bindings.ymlin this repo can generate the new bindings onworkflow_dispatch, but it opens a PR and waits for human review and NPM release. That's fine for stable adoption (minutes → hours → days) but useless for "I want to try this blend PR right now."Options
A. Manual generate +
file:/yalcinstallDev clones blend-rescript, sets
@juspay/blend-design-systemto the pkg.pr.new URL in devDeps, runsnpm run generate -- --all, then installs the resulting tree into their app viayalcornpm install file:../blend-rescript.LITELLM_API_KEYetc.)B.
workflow_dispatch→ open PR → merge → wait for NPM releaseThe current
sync-bindings.ymlpath. Review-gated, safe, but slow — not a fit for "I just want to try this PR."C. Upstream dispatch → regenerate in CI → publish matching
pkg.pr.newpreview ⭐️Add a step to blend-design-system's
ci.ymlthat, after publishing its own preview, fires arepository_dispatch(blend-preview-published) into this repo with payload{ blend_sha, blend_spec }.This repo reacts:
preview/blend-<sha>.npm install --no-save @juspay/blend-design-system@<blend_spec>— pins to that exact preview.npm run generate -- --all— regenerate bindings.rescript format -c+npm run build— gate on green.https://pkg.pr.new/juspay/blend-rescript@<blend-rescript-sha>.Dev then installs both URLs together:
BLEND_RESCRIPT_PAT,Actions: Write,Contents: Readonjuspay/blend-rescript)D. Don't solve it
Tell consumers: if you need an unreleased blend API, write a one-file inline binding locally. Accepts that the "canonical bindings" story has a permanent escape hatch for unreleased blend.
Recommendation
C, but with two guardrails:
needs-rescript-preview). Default blend PRs skip it, which keeps LiteLLM cost bounded to the few PRs that actually need cross-language validation.preview/blend-<sha>are auto-deleted by a nightly workflow if older than 14 days, so the repo doesn't accumulate hundreds of dead branches.What to decide before implementation
BLEND_RESCRIPT_PATsecret on the blend side?.resregenerated by an LLM acceptable without human review? (Arguments both ways — compile success is a strong signal, but runtime correctness isn't checked.)Out of scope here
sync-bindings.yml+ 3-retry feedback).sync-bindings.yml+ PR review path).