Skip to content

Enable withIncrementalHydration() by default in for SSR Angular projects #65263

Description

@npapp-dev002

Command

new

Description

Currently, Angular SSR applications generated with the Angular CLI (ng new --ssr) do not enable withIncrementalHydration() by default. Developers need to manually update the server configuration to opt in to incremental hydration.

Incremental hydration is now the recommended, modern hydration strategy and provides significant UX and performance benefits compared to the legacy full hydration approach. Because of this, it would be beneficial for developers if new SSR projects used this configuration automatically.

Please enable provideClientHydration(withIncrementalHydration()) in all newly generated Angular SSR applications.

Describe the solution you'd like

Suggested change:

When running:

ng new my-app --ssr

the generated app.config.ts (and/or other relevant project scaffolding) should automatically include:

export const appConfig: ApplicationConfig = {
  providers: [
    provideClientHydration(withIncrementalHydration()),
  ]
};

instead of the current default provideClientHydration().

Describe alternatives you've considered

Developers can manually modify app.config.ts to include withIncrementalHydration(), but:

  • It is easy to overlook.
  • Tutorials and docs are inconsistent.
  • It adds friction to adopting SSR best practices.

Activity

  1. alan-agius4 commented on Nov 14, 2025

    @alan-agius4
    Contributor
  2. hybrist commented on Nov 14, 2025

    @hybrist
    Contributor

    FWIW, I was also surprised when I tried to follow the docs about @defer with hydrate triggers and it "didn't work" in a new project.

  3. thePunderWoman commented on Nov 14, 2025

    @thePunderWoman
    Contributor

    It's too late for us to do this in v21, but yeah, we should enable it by default.

  4. alan-agius4 commented on Nov 17, 2025

    @alan-agius4
    Contributor

    Following a chat with @thePunderWoman, it was mentioned that before doing this we'd likely want to do some changes to the framework such as enable it by default make it default, not just add it in the schematic.

  5. changed the title [-]Enable withIncrementalHydration() by default in new SSR Angular projects generated via Angular CLI[/-] [+]Enable withIncrementalHydration() by default in for SSR Angular projects[/+] on Nov 17, 2025
  6. modified the milestone: needsTriage on Nov 17, 2025
  7. changed the title [-]Enable withIncrementalHydration() by default in for SSR Angular projects[/-] [+]Enable `withIncrementalHydration()` by default in for SSR Angular projects[/+] on Nov 17, 2025
  8. SkyZeroZx commented on Mar 29, 2026

    @SkyZeroZx
    Contributor

    I've been testing this a bit, and I see that if we have withIncrementalHydration set to default, the bundle size will increase by approximately 23kb. I'm not sure if it would be worth the cost for all users, considering that there may be some who don't use it (in my case, some projects I've participated in).

    That said, I understand the importance. An alternative would be to perhaps have a other function / entry point?

    provideIncrementalHydration(), which could be the new default for incremental hydration.

    And we could keep provideClientHydration working as it does for those who don't need incremental hydration, as well as perhaps deprecating withIncrementalHydration.

  9. thePunderWoman commented on Apr 8, 2026

    @thePunderWoman
    Contributor

    @SkyZeroZx I think that provideIncrementalHydration() defeats the purpose of having it be the default behavior. We would also provide a way to opt out when making incremental hydration the default. We can also look into ways of improving tree shaking for incremental hydration.

  10. angular-automatic-lock-bot commented on May 10, 2026

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  11. locked and limited conversation to collaborators on May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions