Skip to content

refactor(swift): Introduce DataContext type - #2247

Merged
pinieb merged 8 commits into
a2ui-project:mainfrom
pinieb:swift-data-context
Aug 17, 2026
Merged

refactor(swift): Introduce DataContext type#2247
pinieb merged 8 commits into
a2ui-project:mainfrom
pinieb:swift-data-context

Conversation

@pinieb

@pinieb pinieb commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Description

To bring the Swift renderer into closer alignment with the blueprints and to prepare for function support, this change introduces the DataContext type and updates the FunctionImplementation protocol to take a DataContext as a parameter to its evaluate() function.

@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 DataContext and FunctionHandler to manage scope and binding resolution during rendering, refactoring SurfaceViewModel to delegate dynamic value evaluation to this new context. It also updates the FunctionImplementation protocol to accept DataContext in its evaluate method and adds corresponding unit tests. The review feedback suggests optimizing dictionary resolution in DataContext to preserve key order using OrderedDictionary directly, and removing an unused Combine import.

Comment thread swift/core/Sources/A2UICore/State/DataContext.swift Outdated
Comment thread swift/core/Sources/A2UICore/State/DataContext.swift Outdated
@pinieb
pinieb force-pushed the swift-data-context branch from 255e80b to 6373cee Compare August 12, 2026 23:01
@pinieb
pinieb marked this pull request as ready for review August 12, 2026 23:02
@pinieb
pinieb force-pushed the swift-data-context branch from 80ec7c6 to 6596afd Compare August 13, 2026 21:35
@pinieb
pinieb merged commit 6bffecb into a2ui-project:main Aug 17, 2026
22 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI Aug 17, 2026
@andrewkolos

andrewkolos commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

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.

3 participants