[CPP-4503] Add async builder and plugin; update tests; update stencils#923
Open
aleksey-krauchuk-gotinder wants to merge 8 commits intoTinder:mainfrom
Open
[CPP-4503] Add async builder and plugin; update tests; update stencils#923aleksey-krauchuk-gotinder wants to merge 8 commits intoTinder:mainfrom
aleksey-krauchuk-gotinder wants to merge 8 commits intoTinder:mainfrom
Conversation
tinder-siddarthgandhi
approved these changes
Mar 26, 2026
tinder-stevenberard
previously approved these changes
Mar 26, 2026
Contributor
There was a problem hiding this comment.
Nice improvement! Can we please make sure creating a QuickStart project still works as expected
tinder-SamMarshall
approved these changes
Mar 26, 2026
Contributor
|
Looks great! |
Collaborator
Author
|
Thanks for the feedback!
|
tinder-emanharoutunian
previously approved these changes
Mar 27, 2026
Contributor
tinder-emanharoutunian
left a comment
There was a problem hiding this comment.
Thanks for implementing and validating!
4e5ea3f to
8715428
Compare
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.


CPP-4503
Summary
Adds
asyncoverloads toAbstractBuilderandPlugin, enabling builders toawaitasync dependencies during construction. This lays the groundwork for Swift Concurrency adoption across all Nodes.Changes
asyncvariants ofopen func build(...)toAbstractBuilderandPluginasyncvariants of thepublicconvenience methods (build(_:_:),create(state:),override())Why
preconditionFailureinstead of async-wraps-syncAn intuitive approach would be to have the async method's default implementation delegate to the sync one, so existing sync builders "just work" when called from an async context. However, Swift's overload resolution prevents this: when two methods share the same name and differ only by
async, callingbuild(component:dynamicBuildDependency:)from within an async context always resolves to the async overload — causing infinite recursion. There's no Swift syntax to force resolution to the sync overload from an async context.Instead, both
openmethods usepreconditionFailurein the base class. This is safe because:Why stencils remain synchronous
The original plan was to update all Stencil templates (Builder, Interface, Plugin, Flow, and their test templates) to generate
asyncmethods by default. However, this is blocked by a regression in Mockolo 2.6.0+ (uber/mockolo#328) where#if canImport(UIKit)directives are incorrectly evaluated during parsing, causing Mockolo to skip protocols guarded by those directives (e.g.ViewControllable). This breaks mock generation in the Genesis demo project, which relies on Mockolo.Mockolo 2.5.0 does not have this issue (it parsed all
#ifbranches), so the Genesis CI is pinned to 2.5.0 for now. However, 2.5.0 lacks async-aware mock generation needed for async templates.A fix is in progress upstream: uber/mockolo#346. Once merged, we can apply the async stencil changes (preserved as a patch in the repo) and remove the Mockolo version pin.
Tests
AsyncTestBuilderandAsyncTestPluginsubclasses with async build/create/override tests