Skip to content

Conversation

@josephsavona
Copy link
Member

invariant() was a pain to use - we always record a single location, but the API required passing a compiler detail. This PR replaces invariant() (keeping the name) with simpleInvariant()s signature, and updates call sites accordingly. I've noticed that agents consistently get invariant() wrong, which aligns with it being tedious to call when you're writing code by hand. The simplified API should help a bit.

@meta-cla meta-cla bot added the CLA Signed label Jan 23, 2026
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jan 23, 2026
@josephsavona josephsavona force-pushed the worktree-2026-01-22-15-23-27-quiet-glacier branch from b680308 to 2b41b48 Compare January 23, 2026 18:44
`invariant()` was a pain to use - we always record a single location, but the API required passing a compiler detail. This PR replaces `invariant()` (keeping the name) with `simpleInvariant()`s signature, and updates call sites accordingly. I've noticed that agents consistently get invariant() wrong, which aligns with it being tedious to call when you're writing code by hand. The simplified API should help a bit.
@josephsavona josephsavona force-pushed the worktree-2026-01-22-15-23-27-quiet-glacier branch from 2b41b48 to ce9c6d3 Compare January 23, 2026 18:52
@josephsavona josephsavona merged commit 006ae37 into facebook:main Jan 23, 2026
18 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 23, 2026
`invariant()` was a pain to use - we always record a single location,
but the API required passing a compiler detail. This PR replaces
`invariant()` (keeping the name) with `simpleInvariant()`s signature,
and updates call sites accordingly. I've noticed that agents
consistently get invariant() wrong, which aligns with it being tedious
to call when you're writing code by hand. The simplified API should help
a bit.

DiffTrain build for [006ae37](006ae37)
github-actions bot pushed a commit that referenced this pull request Jan 23, 2026
`invariant()` was a pain to use - we always record a single location,
but the API required passing a compiler detail. This PR replaces
`invariant()` (keeping the name) with `simpleInvariant()`s signature,
and updates call sites accordingly. I've noticed that agents
consistently get invariant() wrong, which aligns with it being tedious
to call when you're writing code by hand. The simplified API should help
a bit.

DiffTrain build for [006ae37](006ae37)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant