Skip to content

Migrate to zod 4.#7458

Merged
dglazkov merged 2 commits intomainfrom
migrate-to-zod-4
Jan 7, 2026
Merged

Migrate to zod 4.#7458
dglazkov merged 2 commits intomainfrom
migrate-to-zod-4

Conversation

@dglazkov
Copy link
Collaborator

@dglazkov dglazkov commented Jan 7, 2026

No description provided.

@dglazkov dglazkov merged commit 7bd69e5 into main Jan 7, 2026
3 checks passed
@dglazkov dglazkov deleted the migrate-to-zod-4 branch January 7, 2026 22:23
walker7734 pushed a commit that referenced this pull request Jan 12, 2026
walker7734 pushed a commit that referenced this pull request Jan 12, 2026
kevinpschaaf added a commit that referenced this pull request Jan 15, 2026
)

Fixes b/475312122

When the record button is clicked, the private `#recorder` field is set,
which is what changes the template from the "record" button to the
"stop" button. Since `#recorder` wasn't marked as `state()`, the
template wasn't re-rendered based on this assignment, and since clicking
the button immediately disables it, there was no way to stop recording.

Appears to have been a latent bug, exposed by
#7458 (found via
bisect). That PR resulted in `lit` being bumped from `3.3.1` to `3.3.2`,
which included a bugfix in the lit core library:
lit/lit#4999 "Fix a bug in change detection with
decorated standard private accessors".

The reason the fix in Lit broke Opal was because that in the same
microtask that `#recorder` was being set, the `#clearValues()` method
was being called which did set the `@state() #value` field to `null`.
Since `null` is the initial value, this should not have triggered a
re-render but did, because of the Lit bug above: Lit reading `newValue`
in `requestUpdate` incorrectly returned `undefined` for a private field,
hence setting to `null` always failed equality check and incorrectly
triggered an update (compensating for `#recorder` not being marked as
state). The fix to Lit means that nothing was triggering a re-render
after the record button was clicked. Thus ensuring that the `#recorder`
field was properly marked as `@state` is all that's needed.
kevinpschaaf added a commit that referenced this pull request Jan 16, 2026
)

Fixes b/475312122

When the record button is clicked, the private `#recorder` field is set,
which is what changes the template from the "record" button to the
"stop" button. Since `#recorder` wasn't marked as `state()`, the
template wasn't re-rendered based on this assignment, and since clicking
the button immediately disables it, there was no way to stop recording.

Appears to have been a latent bug, exposed by
#7458 (found via
bisect). That PR resulted in `lit` being bumped from `3.3.1` to `3.3.2`,
which included a bugfix in the lit core library:
lit/lit#4999 "Fix a bug in change detection with
decorated standard private accessors".

The reason the fix in Lit broke Opal was because that in the same
microtask that `#recorder` was being set, the `#clearValues()` method
was being called which did set the `@state() #value` field to `null`.
Since `null` is the initial value, this should not have triggered a
re-render but did, because of the Lit bug above: Lit reading `newValue`
in `requestUpdate` incorrectly returned `undefined` for a private field,
hence setting to `null` always failed equality check and incorrectly
triggered an update (compensating for `#recorder` not being marked as
state). The fix to Lit means that nothing was triggering a re-render
after the record button was clicked. Thus ensuring that the `#recorder`
field was properly marked as `@state` is all that's needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant