Skip to content
New issue

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

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

Already on GitHub? # to your account

feat(angular): Add Angular 14 support #5253

Merged
merged 1 commit into from
Jun 14, 2022
Merged

feat(angular): Add Angular 14 support #5253

merged 1 commit into from
Jun 14, 2022

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jun 11, 2022

This PR adds Angular 14 peer dependencies to package.json to make our SDK compatible with the recently released version 14 of Angular. Tested on an NG14 sample projects - Errors, transaction and component instrumentation work as expected.

Fixes #5215

Bump peer dependencies to Angular 14
@Lms24 Lms24 mentioned this pull request Jun 11, 2022
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.44 KB (added)
@sentry/browser - ES5 CDN Bundle (minified) 60.21 KB (added)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.24 KB (added)
@sentry/browser - ES6 CDN Bundle (minified) 53.83 KB (added)
@sentry/browser - Webpack (gzipped + minified) 20 KB (added)
@sentry/browser - Webpack (minified) 65.2 KB (added)
@sentry/react - Webpack (gzipped + minified) 20.02 KB (added)
@sentry/nextjs Client - Webpack (gzipped + minified) 43.95 KB (added)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.56 KB (added)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.12 KB (added)

@alfaproject
Copy link

I'm not sure how you can be compatible with Angular 10 and Angular 14 at the same time without doing a compilation for View Engine and another for Ivy. Does that mean Angular 14 still ship ngcc to convert View Engine to Ivy?

@Lms24
Copy link
Member Author

Lms24 commented Jun 11, 2022

I'm not sure how you can be compatible with Angular 10 and Angular 14 at the same time without doing a compilation for View Engine and another for Ivy. Does that mean Angular 14 still ship ngcc to convert View Engine to Ivy?

Yes @alfaproject, upon compilation, the NG10-compiled SDK code is converted for NG14 compatibility (same as with 11-13). I know this is not the ideal solution but so far we haven't come up with a better one to enable Ivy support without conversion while maintaining compatibility with NG10. Very much open for suggestions and PRs though ;)

EDIT: For more information, take a look at #4644 and #4641 on how we're currently compiling the Sentry Angular SDK

@dzonatan
Copy link

Angular versions v2 to v11 are no longer under official support:
https://angular.io/guide/releases#support-policy-and-schedule

Just wondering what's the reason to keep this support on your side.

@nunoarruda
Copy link

Yeah, Sentry should adopt and take advantage of Ivy. It would also address the following warning:

⠸ Generating browser application bundles (phase: setup)...Processing legacy "View Engine" libraries:
- @sentry/angular [es2015/esm2015] (git://github.com/getsentry/sentry-javascript.git)
Encourage the library authors to publish an Ivy distribution.

Since Angular 12 or 13, most Angular libs upgraded to Ivy and published an Ivy distribution with a major version bump because it is a breaking change. Here are a few examples and discussions from other open-source projects:

mattlewis92/angular-calendar@29eb8c9
fullcalendar/fullcalendar-angular#386
danielsogl/awesome-cordova-plugins#4198

@Lms24
Copy link
Member Author

Lms24 commented Jun 14, 2022

Hi @dzonatan and @nunoarruda thanks for your input, you're heard, I can assure you that :)

Just wondering what's the reason to keep this support on your side

Our SDK philosophy is to be as backward-compatible as possible. When we first released @sentry/angular, we started with NG10 which means that we want to support this version as long as reasonably possible. (For instance, we only recently dropped Node 6 support in v7 (see #4851))

I know that a lot of people upgrade their Angular versions regularly but - let's face it - there's also still quite some usage from older, LTS-discontinued versions.

Sentry should adopt and take advantage of Ivy

I'd love to do that (and hence get rid of the warning) but given the above, we have to be sensible here. In any case, dropping support for an Angular version is a breaking change which means that we'll only be able to do this with the next major release of the SDK.

Tell you what though: I'll bring this up with our team to discuss how we're going to handle this in the future, given that NG10 and 11 are not even supported by the Angular team anymore. In the meantime, I'll merge this to get Angular 14 supported for now.

@Lms24 Lms24 merged commit f6c87dd into master Jun 14, 2022
@Lms24 Lms24 deleted the lms-ng14 branch June 14, 2022 08:10
@Lms24 Lms24 self-assigned this Jun 14, 2022
@askarby
Copy link

askarby commented Jun 17, 2022

Is there a way of "getting our hands" at the version of the library, supporting Angular 14 (ahead of the next major release). Your current @next-release points to 7.0.0-rc.0 (at least according to https://www.npmjs.com/package/@sentry/angular?activeTab=versions), maybe that could be updated to 8.0.0-alpha.0?

I'm aware that I could manually build a version from master, but not really sure that's a path I want to travel (at this moment).

From my point-of-view, support for Sentry on "Angular 14" is currently "dead in water"? (so we've temporarily removed it from our app, which is obviously not a long-term viable solution).

If I can do anything to "help out", regarding code-contributions, let me know... I just need someone to "point me in the direction of where to start" - thanks :)

@vladanpaunovic
Copy link
Contributor

Hey @askarby, we released https://github.com/getsentry/sentry-javascript/releases/tag/7.2.0 a few hours ago today.

Thanks a lot for your help offer, we highly appreciate it and will definitely need it in the future! 😄

Feel free to jump on a new version! :)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Angular 14 Support
6 participants