-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(material/sidenav): enable hydration #28340
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
Conversation
528b7d9
to
04bba37
Compare
Updates to the latest version of Angular which includes angular/angular#53246. It is necessary to get hydration working for the sidenav.
Fixes that the sidenav was disabling hydration. This is problematic, because it essentially disables hydration for the entire app that is using the sidenav. The hydration errors had a couple of root causes: 1. Focus trap anchors throw off hydration. 2. We were moving the end sidenav manually so the visual order matches the DOM order for accessibility. Now this happens only on the client. Fixes angular#27848.
04bba37
to
2f187bf
Compare
</mat-sidenav> | ||
Main content | ||
<button (click)="sidenav.toggle()">Click me</button> | ||
<button (click)="startSidenav.toggle()">Toggle start</button> | ||
<button (click)="endSidenav.toggle()">Toggle end</button> | ||
</mat-sidenav-container> | ||
|
||
<h2>Slide-toggle</h2> |
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.
BTW: One thing I did play with in the past was to use Pupeteer and capture a screenshot of the SSR structure to ensure the initial "boilerplate" looks as expected. I wonder, do we also bother about this with these PRs or are we just ensuring no errors?
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.
We're just ensuring that there's no errors, but hydration errors actually aren't captured on the CI yet. Eventually it would be nice to add something (potentially Puppeteer or Webdriver) that opens the client-side-rendered page and checks that there are no JS errors.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes that the sidenav was disabling hydration. This is problematic, because it essentially disables hydration for the entire app that is using the sidenav. The hydration errors had a couple of root causes:
Fixes #27848.