-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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): Add Ivy-compatible Angular SDK package #7264
Conversation
/** | ||
* Minimum Angular version this SDK supports | ||
*/ | ||
export const ANGULAR_MINIMUM_VERSION = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to move this constant back to sdk.ts
so that we only have to duplicate that file. It's only used in in this file anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this, don't we symlink everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything but sdk.ts
. I should have explained this in the PR description, sorry. sdk.ts
differs in two ways for ivy:
- It sets the SDK name to
sentry.javascript.angular-ivy
- It adjusts the Angular version check with the minimum Angular version being v12 and a warning message that's better worded for angular-ivy
size-limit report 📦
|
cf95712
to
a8c3d58
Compare
Why symlink over just re-exporting |
You mean declare I also experimented with Generally, using the symlink approach seems to be the simplest option but I get that it's not nice and clean |
I think symlink is fine for now - we just have to enforce somehow that these will never get out of sync (symlinks are always updated when new files add/paths changes) |
Hmm yes, that's also my no1 concern with the symlinks. I guess, if they got accidentally removed, the package wouldn't build correctly anymore. The problematic part would be that we add files in angular and forget to symlink them to angular-ivy. We could write a script to automatically sync the symlinks before we build, wdyt? |
This makes the most sense to me. We could also run a test to just sanity check that the files in both folders are all symlinked and the same. |
52c5e92
to
77bee7e
Compare
aa096a7
to
211ac96
Compare
/** | ||
* Minimum Angular version this SDK supports | ||
*/ | ||
export const ANGULAR_MINIMUM_VERSION = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this, don't we symlink everything?
321f4d3
to
5255876
Compare
This PR adds a new SDK package to our monorepo:
@sentry/angular-ivy
.While this is technically a new SDK, its content and functionality is identical to
@sentry/angular
. Only the build configuration differs:compilationMode: partial
, enabeling a build format that is compatible with Angular's Ivy rendering engine.ngcc
no longer needs to step in at initial build time to up-compile the SDK. Which is good becausengcc
will be removed in Angular 16 (refactor(@ngtools/webpack): remove NGCC integration angular/angular-cli#24720)Because functionality-wise there's no difference to
@sentry/angular
, I opted to symlink the source files instead of duplicating them. The only exception issdk.ts
which needed some adaption for the new package, like setting the SDK name and adjusting the min version check. For the same reason, this new package currently doesn't contain tests. We'll need to reconsider this approach (symlinking and testing) if we ever need to make package-specific adjustments.Whenever we're ready for v8, we can decide if we're going to remove the current
@sentry/angular
package and rename this one or if both will continue to co-exist.ref #5268
ref #7265