-
Notifications
You must be signed in to change notification settings - Fork 392
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
Upgrade to Angular 19 #19772
base: develop-next-major
Are you sure you want to change the base?
Upgrade to Angular 19 #19772
Changes from all commits
158766c
f95bd2c
54ca560
51ae9c4
71152c8
f77c7eb
1126c06
e3e935d
4048f17
34574a8
b1bc98c
6d1bf09
ccf37f2
c1fa528
3984894
85526ca
a004277
8da6be2
ef4ede7
89b2d08
1ec74e0
3fb0b3a
587ce7b
c304b34
c59ccf8
b5500cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,53 @@ | ||||||
# (EARLY NOTES) Migrating a custom app to use Spartacus with Angular v18 | ||||||
|
||||||
Before upgrading Spartacus to the new version with Angular 18, you need to first: | ||||||
- upgrade to the latest 2211.x of Spartacus | ||||||
- upgrade Angular to version v18 and then to v19 | ||||||
|
||||||
## Update Angular to 18 and 19 | ||||||
|
||||||
### Update Angular to 18 and 3rd party deps to be compatible with Angular 18 | ||||||
|
||||||
Follow the [Angular guidelines for upgrading from v17 to v18](https://angular.dev/update-guide?v=17.0-18.0&l=3) and bump the Angular version locally, and update other 3rd party dependencies from Angular ecosystem to versions compatible with Angular 18 (e.g. `@ng-select/ng-select@13`, `@ngrx/store@18`, `ngx-infinite-scroll@18`): | ||||||
|
||||||
```bash | ||||||
ng update @angular/core@18 @angular/cli@18 @ng-select/ng-select@13 @ngrx/store@18 ngx-infinite-scroll@18 --force | ||||||
git add . | ||||||
git commit -m "update angular 18 and 3rd party deps angular 18 compatible" | ||||||
``` | ||||||
Note: Do not select `use-application-builder` migration when migrating to Angular 18. Applications created before SPA 2211.19 doesn't support this builder. Applications created starting from 2211.19 already supports it. | ||||||
|
||||||
### Update Angular to 19 and 3rd party deps to be compatible with Angular 19 | ||||||
|
||||||
Follow the [Angular guidelines for upgrading from v18 to v19](https://angular.dev/update-guide?v=18.0-19.0&l=3) and bump the Angular version locally, and update other 3rd party dependencies from Angular ecosystem to versions compatible with Angular 19 (e.g. `@ng-select/ng-select@14`, `@ngrx/store@19`, `ngx-infinite-scroll@19`): | ||||||
|
||||||
```bash | ||||||
ng update @angular/cli@19 @angular/core@19 ngx-infinite-scroll@19 @ng-select/ng-select@14 @ngrx/store@19 angular-oauth2-oidc@19 --force | ||||||
git add . | ||||||
git commit -m "update angular 19 and 3rd party deps angular 19 compatible" | ||||||
``` | ||||||
|
||||||
Note: Unselect `use-application-builder` migration when migrating to Angular 19. Applications created before SPA 2211.19 doesn't support this builder. Applications created starting from 2211.19 already supports it. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [MEDIUM] Because it's easy to miss the small prompt during the installation, perhaps we might even attach 2 screenshots:
|
||||||
|
||||||
## Run Spartacus update | ||||||
|
||||||
After successfully updating the application to Angular 19, execute this command to initiate the Spartacus update process. | ||||||
|
||||||
```bash | ||||||
ng update @spartacus/schematics@latest | ||||||
``` | ||||||
|
||||||
### If using Server Side Rendering (SSR) and `application` builder | ||||||
|
||||||
For applications using `application` builder having SSR support, you need to adjust the `server.ts` file to be compatible with the output generated by the builder. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [MEDIUM]
Suggested change
|
||||||
|
||||||
```diff | ||||||
/* ... */ | ||||||
- const indexHtml = path.join(browserDistFolder, 'index.html'); | ||||||
+ const indexHtml = path.join(serverDistFolder, 'index.server.html'); | ||||||
``` | ||||||
|
||||||
|
||||||
|
||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
{ | ||
"extends": "../../.eslintrc.json", | ||
"ignorePatterns": ["schematics/**/*.d.ts"] | ||
"ignorePatterns": ["schematics/**/*.d.ts"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts"] | ||
} | ||
] | ||
} |
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.
[MINOR] (can be changed later, but before doc freeze)
I guess it should be: