Skip to content

fix(web_core): keep Record props as data in ResolveA2uiProp - #2939

Merged
josemontespg merged 1 commit into
mainfrom
web-core-record-props-data
Oct 1, 2026
Merged

josemontespg merged 1 commit into
mainfrom
web-core-record-props-data

Conversation

@josemontespg

Copy link
Copy Markdown
Collaborator

Summary

ResolveA2uiProp turns every prop whose type matches ActionLike into a () => Promise<void> thunk. Since #2859 added V1Action to ActionLike, whose function-call variant infers as the weak type {functionCall?: any}, every object type matches it, so props declared as z.record(z.unknown()) (or any Record<string, ...>) now resolve to an action thunk instead of their data type. The runtime binder is unaffected (it reads the zod schema), so this is a type-only regression, but it breaks tsc for catalogs that read such props, for example the iframe and MCP catalogs in #2797 and #2799.

Object types with a string index signature now resolve as data, as before #2859. Props shaped like an action ({event: ...}, {functionCall: ...}, V1Action) still resolve to the thunk.

Changes

  • typescript/web_core/src/resolution/generic-binder.ts: add HasStringIndex<T> and check it inside the ActionLike branch of ResolveA2uiProp before producing the thunk type.
  • typescript/web_core/CHANGELOG.md: Unreleased entry.

Verification

  • yarn --cwd typescript/web_core test (842 tests) and ./scripts/fix_format.sh --check pass locally.
  • The iframe and MCP catalog packages of the stack above typecheck again with this change.

@github-project-automation github-project-automation Bot moved this to Todo in A2UI Oct 1, 2026
@josemontespg
josemontespg force-pushed the web-core-record-props-data branch from c4a49e0 to 22be209 Compare October 1, 2026 20:07

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new helper type HasStringIndex in typescript/web_core/src/resolution/generic-binder.ts to identify object types with a string index signature (such as Record<string, unknown>). It also updates the ResolveA2uiProp type utility to handle these types separately from ActionLike types, resolving them to Exclude<T, DynamicTypes> instead of callable functions. There are no review comments, so I have no feedback to provide.

@josemontespg
josemontespg added this pull request to stack #2940 October 1, 2026 20:12
@josemontespg
josemontespg force-pushed the web-core-record-props-data branch from 22be209 to f7d9cd1 Compare October 1, 2026 20:43
@josemontespg
josemontespg marked this pull request as ready for review October 1, 2026 21:40
@josemontespg
josemontespg force-pushed the web-core-record-props-data branch from f7d9cd1 to 707cb39 Compare October 1, 2026 21:42
@josemontespg
josemontespg removed this pull request from stack #2940 October 1, 2026 21:56
@josemontespg
josemontespg added this pull request to stack #2946 October 1, 2026 21:56
@josemontespg
josemontespg force-pushed the web-core-record-props-data branch from 707cb39 to 3a7cb30 Compare October 1, 2026 22:14
@josemontespg
josemontespg merged commit 5f4224a into main Oct 1, 2026
36 checks passed
@josemontespg
josemontespg deleted the web-core-record-props-data branch October 1, 2026 22:40
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.

2 participants