Repository navigation
refactor(dart/a2ui_core)!: align renderer/agent names, EventSource.subscribe, and PayloadValidator APIs - #3194
Merged
Merged
Conversation
…bscribe, and PayloadValidator APIs
… skip unsubscribed listeners in EventNotifier.emit
…ignment # Conflicts: # dart/a2ui_agent/CHANGELOG.md # dart/a2ui_core/CHANGELOG.md # dart/a2ui_core/lib/src/basic_catalog/basic_catalog.dart # dart/a2ui_core/lib/src/basic_catalog/function_support.dart # dart/a2ui_core/lib/src/core/catalog.dart # dart/a2ui_core/lib/src/validation/validator.dart # dart/a2ui_core/test/basic_catalog_test.dart
…ion keys, rename MinimalCatalog to TestCatalog
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces several breaking changes to align MessageProcessor and PayloadValidator usage with a2ui_core, including renaming A2uiClientAction/A2uiClientError to A2uiRendererAction/A2uiRendererError, renaming MessageProcessor.groupModel to MessageProcessor.model, and replacing EventListenable with EventSource and Subscription-based event handling. Feedback on these changes highlights a potential bug in EventNotifier when unsubscribing duplicate listeners, a type-checking issue with generic maps in MessageReader, and an inconsistency in fallback protocol versions between RpcHandler and ComponentContext.
…ns, RPC version fallback, and catalog combinators
nan-yu
reviewed
Oct 14, 2026
…yped signals, and make subscribeDynamicValue generic
nan-yu
approved these changes
Oct 14, 2026
…ignment # Conflicts: # dart/a2ui_core/CHANGELOG.md # dart/a2ui_core/lib/src/core/contexts.dart # dart/a2ui_core/lib/src/processing/processor.dart # dart/a2ui_core/lib/src/rendering/binder.dart # dart/a2ui_core/lib/src/validation/validator.dart # dart/a2ui_core/test/conformance/catalog_schema_conformance_test.dart # dart/a2ui_core/test/conformance/message_processor_conformance_test.dart # dart/a2ui_core/test/contexts_test.dart # dart/a2ui_core/test/processor_test.dart # dart/a2ui_core/test/validator_test.dart
andrewkolos
added a commit
that referenced
this pull request
Oct 14, 2026
…r-basic-catalog Main now has the adapter core (#3084, squash-merged) and a2ui_core's generated basic catalogs (#2998, #3129) and renderer renames (#3194). - Drop this branch's a2ui_core change, BasicCatalog.v0_9Api(): main's BasicCatalog.v0_9() now carries the components, so the basic catalog reads its schemas from there. - Pass the catalog's shared definitions along with its components. The generated component schemas reference #/$defs/CatalogComponentCommon, which a catalog without them cannot resolve. The README's custom catalog sample needs the same line. - Adopt the #3194 renames in write_back.dart, the test harness and the README. - Read Icon.name from the allOf envelope in icon_test.⚠️ Agent-generated
6 of 8 tasks
nan-yu
pushed a commit
that referenced
this pull request
Oct 14, 2026
* fix(a2ui_flutter): adopt a2ui_core's renderer renames #3194 renamed A2uiClientAction and A2uiClientError to A2uiRendererAction and A2uiRendererError, MessageProcessor.groupModel to model and getClientDataModel to getRendererDataModel, and replaced EventSource.addListener with subscribe. The adapter's tests and README still used the old names, so the package's tests no longer compiled on main.⚠️ Agent-generated * fix(a2ui_flutter): use the http Apache license URL #3205 standardized LICENSE files on http://www.apache.org/licenses/ and made the license check enforce it. a2ui_flutter's LICENSE, added in #3084, used https, so the static-checks job fails on main.⚠️ Agent-generated
andrewkolos
added a commit
that referenced
this pull request
Oct 15, 2026
* feat(a2ui_flutter): add the framework adapter core A2uiSurface renders a SurfaceModel through a NodeResolver, and NodeView renders each ComponentNode through its catalog entry, rebuilding when the node's props change. ComponentImplementation pairs a component schema with a widget builder, WidgetCatalog is a catalog of them, and ComponentProps reads a node's resolved properties, bindings and actions. A component that has not arrived shows a small progress indicator. * feat(a2ui_core): expose the v0.9 basic catalog's API BasicCatalog.v0_9Api() returns the published v0.9 basic catalog document parsed with Catalog.fromJson: its components, function signatures and theme schema, so a framework adapter can read the component schemas without embedding its own copy of the document. * feat(a2ui_flutter): add the v0.9 basic catalog package:a2ui_flutter/basic_catalog.dart implements the 18 components of the v0.9 basic catalog with Material widgets, with their schemas from a2ui_core's BasicCatalog.v0_9Api() and the functions of BasicCatalog.v0_9(). basicCatalog() builds the whole catalog under the basic catalog's id; BasicComponents holds each component for a catalog of the app's own. The components apply the surface theme's primaryColor as the primary color, and every specification example renders in a test. * fix(a2ui_flutter): key a node's subtree by its implementation A component whose catalogId changes is recreated with the same instance id, like one whose type changes. Keying the subtree by the type name kept the old implementation's state when only the catalog changed. Keying by the resolved implementation resets it in both cases. * test(a2ui_flutter): cover A2uiSurface.of and maybeOf * fix(a2ui_flutter): forward the basic catalog's protocol version and instructions * refactor(a2ui_flutter): rename WidgetCatalog to CatalogImplementation Pairs it with CatalogApi in a2ui_core, as ComponentImplementation and FunctionImplementation pair with ComponentApi and FunctionApi. 🤖 Agent-generated * refactor(a2ui_flutter): use CatalogImplementation in the basic catalog 🤖 Agent-generated * feat(a2ui_flutter): apply a component's accessibility label and description NodeView wraps every resolved component in a Semantics that carries the component's accessibility label as its label and its description as its hint, so basic and custom components both get them. Without either attribute the Semantics adds no node, and it stays in the tree so that adding one later keeps the component's state. 🤖 Agent-generated * fix(a2ui_flutter): adopt a2ui_core's renderer renames #3194 renamed A2uiClientAction and A2uiClientError to A2uiRendererAction and A2uiRendererError, MessageProcessor.groupModel to model and getClientDataModel to getRendererDataModel, and replaced EventSource.addListener with subscribe. The adapter's tests and README still used the old names, so the package's tests no longer compiled on main.⚠️ Agent-generated * fix(a2ui_flutter): use the http Apache license URL #3205 standardized LICENSE files on http://www.apache.org/licenses/ and made the license check enforce it. a2ui_flutter's LICENSE, added in #3084, used https, so the static-checks job fails on main.⚠️ Agent-generated * docs(a2ui_flutter): match the README's a2ui_core constraint to the pubspec The package now depends on a2ui_core ^0.3.0 (#3192), but the install sample still showed ^0.2.2.⚠️ Agent-generated * docs(a2ui_flutter): drop accessibility from the README's unsupported list NodeView applies a component's accessibility label and description, the two attributes v0.9 defines, since effca52.⚠️ Agent-generated
andrewkolos
added a commit
that referenced
this pull request
Oct 18, 2026
#3194 renamed A2uiClientError to A2uiRendererError and MessageProcessor.groupModel to model, and replaced EventSource.addListener with subscribe, so the gallery no longer analyzed against main. The demo catalog also passes the basic catalog's definitions, which the generated component schemas reference as #/$defs/CatalogComponentCommon. Without them every example failed to resolve its schemas and rendered nothing.⚠️ Agent-generated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refines the
a2ui_corepublic API surface across renderer/agent naming, event subscriptions,DataContextresolution methods, andPayloadValidator:A2uiClientActionandA2uiClientErrortoA2uiRendererActionandA2uiRendererError.MessageProcessor.groupModeltoMessageProcessor.modeland remove theMessageProcessor.processalias forprocessMessages.DataContext.resolveSync,resolveListenable, andresolveListenableWithPendingtoresolveDynamicValue,resolveSignal, andresolveSignalWithPending.DataContext.protocolVersionasA2uiProtocolVersion?and replaceDataContext.isV10withDataContext.usesDirectives.EventListenable<T>toEventSource<T>and replaceaddListener/removeListenerwithEventSource.subscribe(void Function(T) listener), returning aSubscriptionwith an idempotentunsubscribe()method.DataModel.subscribe<T>(String path, void Function(T?) onChange), returning aDataSubscription<T>that implementsSubscription.PayloadValidatorrules andcommon_types.jsondefinitions directly fromcatalog.protocolVersion, removingprotocolVersion,commonTypesSchema,checkVersion, andPayloadValidator.forVersion.MessageProcessor.commonTypesSchema, theversionparameter ofMessageProcessor.validatorFor(catalog),A2uiValidationError.details, andMinimalCatalogfromlib/(moving the test catalog helper totest/support/test_catalog.dartasTestCatalog).A2uiIntegrityError(INTEGRITY_ERROR) instead ofA2uiRecursionError(RECURSION_ERROR) on self-referential and cyclic component references, reservingA2uiRecursionErrorfor exceedingmaxDepthormaxFunctionCallDepth.createSurface.metadata.extensionskeys when parsingCreateSurfaceMessage.FunctionApi.descriptioninBasicCataloganda2ui_agentpayload validation, localizecommon_types.json#/$defs/...references inside function argument schemas when buildingCatalog.catalogSchema, and enforce import isolation forlib/src/basic_catalog/.a2ui_coreconformance test runners (validator_conformance_test.dart,message_processor_conformance_test.dart,expressions_conformance_test.dart,multi_catalog_conformance_test.dart) withvalidatestep routing,catalog_schemafixture loading, node resolution, and template-expandedComponentNodeindexing.Testing
dart analyze --fatal-infosacrossdart/a2ui_core,dart/a2ui_agent,dart/a2ui_agent/e2e_test, anddart/a2ui_clidart testacrossdart/a2ui_core(1,595 tests),dart/a2ui_agent(510 tests), anddart/a2ui_cli(31 tests)🤖 Agent-generated