Skip to content

Angular material and angular SSR == slow performance / high CLS #28189

Closed
@elgerm

Description

@elgerm

Is this a regression?

  • No, but since angular ssr is a first class citizen now, it does matter more

Description

Using angular material with angular SSR will lead to degraded performance. Because it will render from server AND re-render in the browser. Leading to large layout shifts and generally slower performance than no ssr at all.

From what I see in the source code the following components are skipped from hydration:

  • drawer
  • sidenav
  • menu
  • tab-group
  • table
  • autocomplete
  • select
  • stepper
  • table
  • chip-listbox

Encapsulating components like sidenav, drawer and tab-group should not be skipping hydration.

Reproduction

Gifthub example repo: here
Steps to reproduce:

  1. Add SSR
  2. Add Material

Expected Behavior

no re-rendering

Actual Behavior

components don't get hydrated

Environment

  • Angular: 17
  • CDK/Material: 17
  • Browser(s): all of them

Metadata

Metadata

Assignees

Labels

needs triageThis issue needs to be triaged by the team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions