Skip to content

[Blazor] Generate AOT-safe binding metadata - #68297

Draft
javiercn wants to merge 6 commits into
javiercn-aot-stack-2-jsinteropfrom
javiercn-aot-stack-3-binding
Draft

[Blazor] Generate AOT-safe binding metadata#68297
javiercn wants to merge 6 commits into
javiercn-aot-stack-2-jsinteropfrom
javiercn-aot-stack-3-binding

Conversation

@javiercn

@javiercn javiercn commented Aug 8, 2026

Copy link
Copy Markdown
Member

Stack layer 3/6. Depends on #68296.

Review focus: binding conversion and expressions only.

This layer removes runtime generic converter closure for enum/array binding, walks binding expressions without compilation, and extends the existing metadata generator with bindable model descriptors and generated accessors. The generator emits only JsonTypeInfoResolver, JSInvokableMethods, and BindableTypes at this layer.

Validation:

  • BindConverterTest (41 passed)
  • FormDataMapperTests (282 passed)
  • BindingExpressionEvaluatorTest (9 passed)
  • bindable generator tests (5 passed)
  • Components WebAssembly linker build (0 warnings/errors)

javiercn and others added 6 commits August 9, 2026 23:37
Use non-generic enum parsing and reflectionless array conversion so runtime-selected binding no longer depends on emitted generic closures.

Behavior: changed: enum and array binding works without dynamic code

State: builds; tests in #2

Review hint: compare the dynamic-code-safe enum and array branches with their existing generic counterparts

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Compare the reflectionless enum and array paths with the existing JIT conversion behavior.

Behavior: preserved

State: complete

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Evaluate known binding expression shapes through the MemberInfo already carried by each expression node, preserving the existing fallback for unsupported shapes.

Behavior: preserved

State: builds; reflection walk tests in #4

Review hint: this commit deliberately has no bindable descriptor abstraction; every recognized hop uses expression metadata

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Cover nested members, fields carried by closures, arrays, indexers, edit-context anchoring, and compatibility with FieldIdentifier.Create.

Behavior: preserved

State: complete

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Introduce bindable member, indexer, and type descriptors at their first generated use. Registered metadata contexts now resolve descriptor graphs before the existing reflection fallback.

The existing application metadata generator emits only JsonTypeInfoResolver, JSInvokableMethods, and BindableTypes at this layer.

Behavior: changed: described form models use generated accessors while undescribed models retain reflection compatibility

State: builds; generated graph and resolver tests in #6

Review hint: generator changes are limited to bindable discovery, accessors, context registration, and descriptor-first expression evaluation

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Cover transitive and cyclic model discovery, private member accessors, indexers, descriptor-first expression walks, and per-provider resolver composition.

Behavior: preserved

State: complete

Review hint: generated tests exercise descriptors as runtime delegates, not only emitted source text

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@javiercn
javiercn force-pushed the javiercn-aot-stack-3-binding branch from e1ca242 to 5cce742 Compare August 9, 2026 21: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.

1 participant