Phase 2: Upgrade Angular 17 to 18#13
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
- Run ng update schematics for @angular/core@18, @angular/cli@18, @angular/cdk@18, @angular/material@18 - Migrate HttpClientModule to provideHttpClient() (via ng update schematic) - Convert class-based VetResolver to functional vetResolver using ResolveFn<Vet> - Convert class-based SpecResolver to functional specResolver using ResolveFn<Specialty[]> - Update vets-routing.module.ts to use functional resolver references - Remove VetResolver from vets.module.ts providers - Remove SpecResolver from specialties.module.ts providers - Replace deprecated async() with waitForAsync() in 3 spec files - All services now use inject(HttpClient) instead of constructor injection (via schematic) - All 43 unit tests pass, production build succeeds
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades Angular from v17 to v18 via
ng updateschematics, converts deprecated class-based route resolvers to functional resolvers, and fixes removedasynctest helper usage.Angular & tooling upgrades (via
ng update):@angular/core,@angular/cli, and all@angular/*packages: 17.3.x → 18.2.x@angular/materialand@angular/cdk: 17.3.10 → 18.2.14@angular-devkit/build-angular: 17.3.17 → 18.2.21@angular/compiler-cli: 17.3.12 → 18.2.14HttpClientModule → provideHttpClient() migration (via schematic):
app.module.ts: ReplacedHttpClientModuleimport withprovideHttpClient(withInterceptorsFromDi())in providersHttpClientTestingModulewithprovideHttpClient(withInterceptorsFromDi())+provideHttpClientTesting()Class-based resolvers → functional resolvers (manual):
VetResolverclass →vetResolver: ResolveFn<Vet>usinginject(VetService)SpecResolverclass →specResolver: ResolveFn<Specialty[]>usinginject(SpecialtyService)vets-routing.module.tsroute config to reference the new functional exportsprovidersarrays invets.module.tsandspecialties.module.tsTest fixes:
asyncimport from@angular/core/testing(removed in v18) in 3 spec files; replaced call-site usages withwaitForAsyncProduction build and all 43 unit tests pass.
Review & Testing Checklist for Human
/vets/:id/editroute — both resolvers (vetResolver,specResolver) are used here. The conversion from class-based to functional resolvers is a manual change; verify that vet data and specialties list load correctly before the edit form renders.HttpClientModuletoprovideHttpClient(withInterceptorsFromDi()). Confirm that API calls (owner CRUD, pet CRUD, visit CRUD, vet CRUD) function correctly against a running backend.ng updateschematic produced inconsistent indentation in severalTestBed.configureTestingModule()blocks (e.g.,imports: []at 0-indent inside the config object). This is cosmetic but may warrant cleanup.Recommended test plan: Start the Spring PetClinic backend, run
ng serve, and exercise the vet edit flow (navigate to Vets → click edit on a vet → verify specialties dropdown loads → save). Also spot-check owner/pet/visit CRUD to confirm HttpClient migration didn't break anything.Notes
@angular-eslint/*packages remain at v17.5.3 — they were not updated in this phase sinceng update @angular-eslint/schematics@18was not run. This should be fine for now but may need updating in Phase 3 or a follow-up.HttpClientModule→provideHttpClient()migration was performed automatically by the Angular 18ng updateschematic (not deferred to Phase 3 as originally planned).Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/010af0d2621c4376ac0819869f987cf9