Skip to content

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 21, 2024

Angular 19 was released. This PR adds support for the new major version by bumping peer dependencies and adding an Angular 19 e2e test app.

From reading the changelog and the updated APF specification, it doesn't seem like there are any changes of concern for our SDK. Noteable exception:

The APP_INITIALIZER token was DI token was deprecated in favour of provideAppinitializer.
This results in a slight update how to configure our SDK's TraceService in app.config.ts:

// Angular 18
export const appConfig: ApplicationConfig = {
  providers: [
    // other providers
    {
      provide: TraceService,
      deps: [Router],
    },
    {
      provide: APP_INITIALIZER,
      useFactory: () => () => {},
      deps: [TraceService],
      multi: true,
    },
  ],
};

// Angular 19
export const appConfig: ApplicationConfig = {
  providers: [
    // other providers
    {
      provide: TraceService,
      deps: [Router],
    },
    provideAppInitializer(() => {
      inject(TraceService);
    }),
  ],
};

I will update our docs accordingly.

closes #14386

@Lms24 Lms24 self-assigned this Nov 21, 2024
@Lms24 Lms24 changed the title feat: Support Angular 19 feat(angular): Support Angular 19 Nov 21, 2024
@Lms24 Lms24 requested review from lforst and s1gr1d November 21, 2024 12:44
@Lms24 Lms24 merged commit b3dad24 into develop Nov 21, 2024
120 of 123 checks passed
@Lms24 Lms24 deleted the lms/feat-angular-19 branch November 21, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[@sentry/angular] Update Angular to v19

2 participants