Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(angular): Support Angular 19 #14398

Merged
merged 2 commits into from
Nov 21, 2024
Merged

feat(angular): Support Angular 19 #14398

merged 2 commits into from
Nov 21, 2024

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