Skip to content

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

@npapp-dev002

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions