Skip to content
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

build(deps): update to Angular v19 #845

Merged
merged 9 commits into from
Nov 26, 2024

Conversation

davidlj95
Copy link
Owner

@davidlj95 davidlj95 commented Nov 25, 2024

Updates to Angular v19

Configures Renovate to just update Angular v19 minors. Plus keep dependencies compatible with it

Ran all migrations:

  • Standalone defaults to true: many changes around
  • SSR node entrypoint: server.ts
  • Migrate to ESBuild: already migrated. Though ran it anyway. Output says tsconfig.json changed (though already changed, hmmm). Eventually no changes in diff.
  • App initializers: no changes

Changes needed:

  • makeItemFactory doesn't properly infer after upgrading to Typescript 5.6. Adding manual types to solve it.
  • Unit tests imports: started failing due to something like Error: Unexpected "MockOfExperienceItemComponent" found in the "declarations" array of the "TestBed.configureTestingModule" call, "MockOfExperienceItemComponent" is marked as standalone and can't be declared in any NgModule - did you intend to import it instead (by adding it to the "imports" array)?. This is because imports were overridden with TestBed.configureTestingModule. However, what it does is it adds those to the root app injector, doesn't overwrite component imports. So in order to provide a fix, componentTestSetup internal util is updated to use overrideComponent to replace imports in there.
  • Scripts Typescript issues. Errors raised about import types + change assert to with for importing JSON files.
  • Build issue: @types/node was updated as otherwise a type in Angular SSR was invalid Type 'Http2ServerResponse' is not generic angular/angular-cli#28965
  • Unexisting files: seems that ng build no longer works neither ng test when asset files do not exist. So generating them.
  • Tab component: due to timing change on when signal effects are executed, tabs component onTabsChanged is now executed before setupIntersectionObserver. Refactors code to set elements to observe in a separate function and runs it as part of setupIntersectionObserver.
  • Cypress: doesn't support v19 yet. feat: support Angular 19 with Cypress Component Testing cypress-io/cypress#30675 However, if changing inline component template in cy.mount by declaring a specific component, it works. Also removes unneeded WebStorm inspection disable comment about unused alias as it now works
  • Build: index.html is not outputted. So copying index.csr.html as index.html for now.

Also will need some changes in next PRs too:

Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.77%. Comparing base (3d92091) to head (14be4bf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #845      +/-   ##
==========================================
+ Coverage   95.76%   95.77%   +0.01%     
==========================================
  Files         122      122              
  Lines         614      616       +2     
  Branches       76       76              
==========================================
+ Hits          588      590       +2     
  Misses         20       20              
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@davidlj95 davidlj95 force-pushed the stacked/build-deps-update-to-angular-v19 branch from 2d74f0f to 14be4bf Compare November 26, 2024 14:35
@davidlj95 davidlj95 merged commit f0bc0c0 into main Nov 26, 2024
16 checks passed
@davidlj95 davidlj95 deleted the stacked/build-deps-update-to-angular-v19 branch November 26, 2024 14:49
Copy link

🚀 This pull request is included in v2.63.0. See v2.63.0 for release notes.

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

Successfully merging this pull request may close these issues.

1 participant