-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(angular): use sync host when generating code with angular cli schematics #15137
fix(angular): use sync host when generating code with angular cli schematics #15137
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine, left a question
const fsHost = new NxScopedHost(root); | ||
const fsHost = new NxScopeHostUsedForWrappedSchematics( | ||
root, | ||
new FsTree(root, verbose) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the original NxScopedHost still used anywhere? Maybe we can remove it and only keep the sync implementation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's used for executors. The read
operation is faster using the project graph and executors don't write back. So there's no issue with the async write implementation. That said, I plan to refactor/rename our existing host implementations, so they better represent what they are for. I'll do it in a follow-up PR later.
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Generating code with Angular CLI schematics throw
Expected a synchronous delegate but got an asynchronous one
. That error is handled in some cases, but it's not reliable and can't handle all scenarios. The host provided by the Angular CLI adapter has some async methods while the Angular DevKit expects them to be synchronous. This is a regression introduced in 15.7.0.Expected Behavior
Generating code with Angular CLI schematics should work correctly.
Related Issue(s)
Fixes #15124