Uh oh!
There was an error while loading. Please reload this page.
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.
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.
I don't understand this, don't we symlink everything?
There was a problem hiding this comment.
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 📦
|
AbhiPrasad
commented
Feb 23, 2023
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 |
AbhiPrasad
commented
Feb 23, 2023
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) |
Lms24
commented
Feb 23, 2023
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? |
AbhiPrasad
commented
Feb 23, 2023
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. |
| /** | ||
| * Minimum Angular version this SDK supports | ||
| */ | ||
| export const ANGULAR_MINIMUM_VERSION = 10; |
There was a problem hiding this comment.
I don't understand this, don't we symlink everything?
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.ngccno longer needs to step in at initial build time to up-compile the SDK. Which is good becausengccwill 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.tswhich 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/angularpackage and rename this one or if both will continue to co-exist.ref #5268
ref #7265