-
Notifications
You must be signed in to change notification settings - Fork 1k
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-gen2]: new blocks getting added on top in case of components that use children #3977
base: main
Are you sure you want to change the base?
fix[angular-gen2]: new blocks getting added on top in case of components that use children #3977
Conversation
🦋 Changeset detectedLatest commit: c54a3ab The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
View your CI Pipeline Execution ↗ for commit c54a3ab.
☁️ Nx Cloud last updated this comment at |
// @ts-expect-error - 'changes' comes from Angular's ngOnChanges hook | ||
!changes['blockChildren']?.isFirstChange() && | ||
// @ts-expect-error - 'changes' comes from Angular's ngOnChanges hook | ||
JSON.stringify(changes['blockChildren']?.previousValue) !== |
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.
isn't this a massive cost, stringifying the entire block children on every ngOnChanges
?
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.
any way it can be avoided?
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.
yup, updated the logic to only check for changes in blockChildren, had to add the previousValue && currVal !== 0 as getter will send a new empty array every time the change detection runs
loom of the approach:
https://www.loom.com/share/5c3c3952775442099ef5dc6ba626d340
Description
A similar case to this: #3932 but happens inside ComponentRef where we render children separately as
<Blocks />
inside the template.Jira
https://builder-io.atlassian.net/browse/ENG-7718
Screenshot
If relevant, add a screenshot or two of the changes you made.