Repository navigation
feat!: update to Angular 22 - #121
Conversation
Upgrade @angular/* packages and tooling to v22, TypeScript to ~6.0, and zone.js to ~0.16. Migrate DynamicComponentService to the createComponent API (ComponentFactory/ComponentFactoryResolver were removed in v22) and update the demo's lazy-load examples to direct dynamic imports. Drop the deprecated tsconfig `baseUrl`. Add an `ng update` migration (update-8-0-0) that scans consumer apps and flags DynamicComponentService.create() call sites relying on removed APIs. BREAKING CHANGE: requires Angular 22. DynamicComponentService.create() no longer accepts a ComponentFactory as its first argument or an NgModuleRef as its fourth argument; pass a component Type and an optional Injector. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
|
@SriramaDanturthi Thank you for putting this together! It looks great as an initial pass. Could you also bump the node version for CI in the workflows? For the PR builds, we need to add the following here: with:
NODE_VERSION: 25Same for these:
That should be all you need to do to get the build to pass, but feel free to make any other adjustments as you see fit. These workflows will be consolidated soon into the monorepo, but for now they are using the legacy shared workflows still... |
|
The demo app should be kept on latest-1 version instead of latest. |
|
Are the changes really v22 specific? Do we really need to bump the minimum version of the supported Angular cores? |
- Bump CI Node version to 25 in build-pr and build-release workflows - Downgrade demo app to Angular 21 (latest-1) per support policy; keep forge-angular library peerDependencies targeting Angular 22 - Add ^8.0.0 row to the README version compatibility matrix Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
- Replace deprecated Sass @import with meta.load-css in table-example styles (nested under ::ng-deep, so @use is not applicable) - Remove unused @angular/animations dependency, which is deprecated in Angular 21+ in favor of animate.enter/animate.leave Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
demo app downgraded to angular 21 and readme version is updated |
these are specific to angular 22 only |
I don't believe you understand what I'm asking. Is there a reason for the forced Angular v22 bump, that will prevent projects still on v20 from easily upgrading? The big change from the API surface area was removing deprecated Angular api usage, but your replacement api usage looks to have been available back in v20 as well. So could we NOT bump the minimum Angular version but just extend it. |
Lower forge-angular peerDependencies to >=21.0.0 <23.0.0 and update the README version matrix v8 row to match, so the library actually supports the current and previous major (21 and 22) as the support policy states. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
I believe its -1 and current not -2 and current reader also has same pattern. Am I missing something ? |
|
FYI, did a quick audit of |
This may be a larger discussion then for @DRiFTy17 and his team then. I understand the current pattern documented in the I just didn't see any significant reasons in this PR that would necessitate leaving v20 behind yet (since the replacement APIs exist in it). Maybe the next |
We support "current - 1" because Angular guarantees API compatibility following that pattern. They may continue to support older releases for a longer period of time, but that's separate from API compatibility. With that said, if our package is still compatible back to v20, then I'm all for keeping the minimum version as v20 to avoid disruption for consumers while introducing support for v22 at the same time. Our local demo site would need to stay on v20 in that case to ensure that we can test this package properly and avoid introducing new v22 APIs that could break v20 apps. On the flip side, we usually stick to the "current - 1" pattern to not only make sure we are taking advantage of the most recent APIs from Angular, but also to help nudge teams to keep their apps up to date. |
|
Is this good to merge ? |
I definitely get this, but speaking from a team that waits till the very end of the cycle, we'll lose 6 months (this time) of potential forge updates until we can schedule a full Angular upgrade. It's just a balancing act like always. |
@Alanoll I can understand that for sure! I don't want this package to be a bottleneck, or a blocker by any means. I would definitely prefer that we take the approach of broad support wherever possible. This package doesn't need to be on the bleeding edge unless it's holding up consumers from implementing a new feature of Angular. |
@SriramaDanturthi I would just like to make sure that everyone is in agreement before we merge this. For everyone else (@MikeMatusz, @Ross-Blakeney, @samrichardsontylertech, @Alanoll), could you please review once more and make any final comments and/or give it an approval if you're all set? |
Alanoll
left a comment
There was a problem hiding this comment.
Just leaving my comments about for the changes to continue v20 support.
if every one agrees to v20 i will update pr otherwise leave as is |
That would be my vote if you don't run into any issues with it. It will at least unblock everyone for the short term. Any objections @samrichardsontylertech, @MikeMatusz, @Ross-Blakeney? As a side note, we can certainly also create version branch of minimum v21 or v22 support if there is a real need to do so. It just introduces maintenance for multiple versions in this package which is cumbersome to keep up with, but it helps keep this package on the modern APIs as well without worrying about support for older versions... |
Its working in angular 20. but keep in mind this version has some braking changes we cant do 7.3.x it has to be 8.0.0 |
Extend the supported Angular range to v20-v22 instead of forcing a v22 minimum, per PR review consensus. The v8 code migrations (DynamicComponentService rewrite, dynamic-import demo lazy loading, schematic) all rely on APIs available since Angular 20, so no minimum bump is required. - peerDependencies: >=20.0.0 < 23.0.0 (was >=21.0.0) - Revert dev/demo workspace to Angular 20.3.x toolchain (TS 5.8, zone.js 0.15) so the package is built and tested against its minimum version - Revert CI node-version bumps that were only needed for the v22 toolchain - Update README version matrix and generalize migration wording Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
changed to v20 now please review again |
MikeMatusz
left a comment
There was a problem hiding this comment.
I don't know of any Angular 21 features we urgently need to adopt in this library, so as long as these built packages work fine in both Angular 20 and Angular 22 apps, I don't object to the larger window this time.
But as Kieran said, Angular doesn't guarantee compatibility across two major versions. Given the lack of automated or formalized manual testing in this library, I'm not sure the existence of the demo page alone really provides a strong enough guarantee that everything is working properly. It doesn't even have examples of every component, and definitely not every configuration, so there is some risk when we do this.
Probably would be interesting to know more statistics on what versions are in use and what cadences everyone uses. In Public Safety, we try to stay on the latest-1, though it definitely makes sense for foundational libraries like this to support upgrading as soon as possible. It's also possible to run the schematic for the previous version of forge-angular to pick up new Forge features as necessary. Adds a little overhead, but if we could automate, or do get enough dedicated resourcing, maybe it could be achievable to still support teams on latest - 2 if that represents a large enough group.
Regenerate the lock file with npm 10 (matching CI's Node 20 toolchain). npm 11 had dropped the optional peer entries conventional-commits-filter@5.0.0 and conventional-commits-parser@6.4.0, causing `npm ci` to fail with EUSAGE (lock out of sync) in the PR build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
build issues resolved please check |
|
I've been separated from Forge for so long, my opinion doesn't really count. Some observations that come to mind. This is more for an established and mature lib with governance. I have no idea how viable any of this is for the Forge community of devs.
Forge could aim to add some mechanics around this.
I have no idea how Forge is governed or managed. Just a shopping list of wider lib governance concepts. RealityAngular only guarantees API compat across one major, so not being able to prove ng20 support mechanically is the real risk here. That said, if folks are blocked we can't leave them blocked with no path forward. More a sign of the need for governance than anything. So it seems there is no choice today and ng20 is required to unblock teams. |
Dependency Review flagged ws@8.20.1 (GHSA-96hv-2xvq-fx4p, memory exhaustion DoS). Force the patched 8.21.0 across the transitive tree via npm overrides. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Dependency Review flagged two more high-severity transitive advisories after the ws fix: - vite@7.3.2 -> ^7.3.5 (GHSA-fx2h-pf6j-xcff, server.fs.deny bypass) - piscina@5.1.3 -> ^5.2.0 (GHSA-x9g3-xrwr-cwfg, prototype pollution RCE) Both pulled in via @angular/build. Verified the library still builds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@DRiFTy17 @Alanoll @MikeMatusz please take a look at this pr |
DRiFTy17
left a comment
There was a problem hiding this comment.
@SriramaDanturthi I apologize for the delay, I'm traveling currently, but these changes look good as far as version support for now to get you unblocked. We can cut another version soon with a minimum supported version bump to avoid the legacy API support, but for now I think this will suffice.
Unless anyone has any objections, I'm fine with merging this.
|
🚀 PR was released in |
PR Checklist
Please check if your PR fulfills the following requirements:
Describe the new behavior?
Updates
@tylertech/forge-angularto Angular 22 (v8.0.0).Dependencies & tooling
@angular/*,@angular/build,@angular/cli,@angular/compiler-cli,ng-packagr→^22.0.0typescript→~6.0,zone.js→~0.16peerDependencies→>=21.0.0 < 23.0.0Code migrations (required by Angular 22 API removals)
DynamicComponentServicerewritten to usecreateComponent/ViewContainerRef.createComponent—ComponentFactoryandComponentFactoryResolverwere removed in v22.Compiler+NgModuleFactoryto direct dynamicimport()of the standalone components; obsolete wrapperNgModules deleted.baseUrlfromtsconfig.json(hard error under TypeScript 6.0).Consumer migration
ng updatemigration (update-8-0-0) that scans consumer apps and reports anyDynamicComponentService.create()call sites relying on the removed APIs (file + line), so they can be fixed manually.DynamicComponentService.create()signature changed:create<T, K>(component: Type<T> | ComponentFactory<T>, target?, injector?, moduleRef?: NgModuleRef<K>)create<T>(component: Type<T>, target?, injector?)ComponentFactoryoverload and themoduleRefargument are gone. Pass a componentTypeand (optionally) a module-scopedInjector.Additional information
Consumers upgrade with:
bash ng update @angular/core@22 @angular/cli@22 ng update @tylertech/forge-angular The forge migration then lists any affected
DynamicComponentService.create()call sites to update.