- Notifications
You must be signed in to change notification settings - Fork26.4k
Description
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
Hey,
I've noticed that on each page load, after Angular initializes, all element attributes get re-rendered. This is easy to see with the "Rendering -> Paint flashing" option enabled in dev tools & console.logs from mutation observer.
I've added an app initializer that blocks rendering for 1 second and registers a mutation observer to track all attribute changes:
provideAppInitializer(()=>{returnnewPromise((resolve)=>{if(typeofwindow!=='undefined'){// mutation observer for console.logs}setTimeout(()=>{resolve(true);},1000);});})
2025-07-16.22.50.47.mov
According to thedocs:
Hydration is the process that restores the server-side rendered application on the client. This includes things like reusing the server rendered DOM structures, persisting the application state, transferring application data that was retrieved already by the server, and other processes.
Do I understand correctly that in this case, hydration simply doesn't work?
Please provide a link to a minimal reproduction of the bug
https://github.com/zip-fa/ng20-hydration-issue
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (runng version
)
Angular: 20.1.1... common, compiler, compiler-cli, core, forms, localize... platform-browser, platform-server, routerPackage Version------------------------------------------------------@angular-devkit/architect 0.2001.0@angular-devkit/core 20.1.1@angular-devkit/schematics 20.1.1@angular/build 20.1.1@angular/cli 20.1.1@angular/ssr 20.1.1@schematics/angular 20.1.1rxjs 7.8.2typescript 5.8.3
Anything else?
ng build && node dist/ng20-hydration-issue/server/server.mjs