Skip to content

Commit

Permalink
chore: Initial migration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelfras committed Dec 24, 2024
1 parent a004277 commit 8da6be2
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

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
- upgrade Angular to version v18 and then to v19

## Update Angular to 17 and 18
## Update Angular to 18 and 19

### Update Angular to 17 and 3rd party deps to be compatible with Angular 18
### 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`):

Expand All @@ -17,22 +17,22 @@ 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.

### Run Spartacus update
### Update Angular to 19 and 3rd party deps to be compatible with Angular 19

After successfully updating the application to Angular 18, execute this command to initiate the Spartacus update process.
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 @spartacus/schematics@latest
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"
```

### Adjust Angular configuration
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.

Due to changes in Angular's application builder, for applications created starting from SPA 2211.19, you need to adjust the `angular.json` file to generate the `index.html` file in the `dist` folder. This is required for CCv2 to map `OCC_BACKEND_BASE_URL_VALUE` and `MEDIA_BACKEND_BASE_URL_VALUE` meta tags to the correct values. Unfortunately, this will contribute to pre-rendering to not work properly (which is a known issue)
### Run Spartacus update

```diff
- "index": "src/index.html"
+ "index": {
+ "input": "src/index.html",
+ "output": "index.html"
+ }
After successfully updating the application to Angular 19, execute this command to initiate the Spartacus update process.

```bash
ng update @spartacus/schematics@latest
```

0 comments on commit 8da6be2

Please sign in to comment.