-
Notifications
You must be signed in to change notification settings - Fork 973
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]: add angular 19 ssr e2e and fix hydration errors #3806
base: main
Are you sure you want to change the base?
Conversation
|
View your CI Pipeline Execution ↗ for commit 40407e4.
☁️ Nx Cloud last updated this comment at |
} | ||
return code; | ||
}, | ||
}, |
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.
Does this mean that we're not going to be hydrating ContentComponent
moving forward? Does this mean that SSR effectively won't work for the SDK? Or just that Hydration is not performed, but SSR succeeds as intended?
Essentially, I'm curious if this change here will break any SDK features.
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.
Content will be ssred but the ssred DOM structure won't be reused in the client and that will perform hydration again. This shouldn't break any SDK features but might affect site perf a bit
@@ -24,7 +24,7 @@ test.describe('Custom components', () => { | |||
packageName, | |||
sdk, | |||
}) => { | |||
test.skip(!['angular', 'react'].includes(sdk)); | |||
test.skip(!['angular-16', 'react'].includes(sdk)); |
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.
This looks like a wrong check: you're comparing a packageName
(angular-16
, etc.) to sdk
(should always be angular
for all 3 angular e2e servers)
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.
This is the case for many other checks changed in .spec.ts
files in this PR.
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.
ahh my bad, I might have used replace all. Thanks for the catch, have updated them
@@ -718,6 +718,25 @@ const ANGULAR_COMPONENT_REF_UPDATE_TEMPLATE_SSR = () => ({ | |||
}, | |||
}); | |||
|
|||
/** | |||
* Angular doesn't support hydration for components created dynamically. |
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.
can you link to any docs or code that expands on this?
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.
added
Description
Fixes the hydration error thrown from angular for using ngComponentOutlet, adds angular-19-ssr to e2e and an example of how users can override fetch to use HTTP client from angular that should help in caching HTTP requests
Jira
https://builder-io.atlassian.net/browse/ENG-7946
https://builder-io.atlassian.net/browse/ENG-7945
https://builder-io.atlassian.net/browse/ENG-7665
Screenshot
If relevant, add a screenshot or two of the changes you made.