Skip to content

Commit

Permalink
docs: notes on migrating to PWA with Angular 9 (#215)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcus Schmidt <MarSchmidt@intershop.com>
  • Loading branch information
dhhyi and marschmidt89 committed May 12, 2020
1 parent 94a7df2 commit 4d1e806
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/check-dead-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ glob('**/*.md')
!link.includes('github.com') &&
!link.includes('repository.intershop.de') &&
!link.includes('support.intershop.com') &&
!link.includes('azurewebsites.net') &&
!link.includes('github.com/intershop/intershop-pwa/commit')
)
.sort();
Expand Down
39 changes: 39 additions & 0 deletions docs/guides/migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,45 @@ kb_sync_latest_only

# Migrations

## 0.19.1 to 0.20

We upgraded from Angular 8 to version 9 and activated the new rendering engine Ivy with this (following the [official upgrade guide](https://update.angular.io/#8.0:9.0l3)).
This was a major upgrade and comes with some changes:

- The following changes are available for cherry-picking in one commit:

- Angular no longer supports the previously deprecated string syntax for lazy loaded modules. Change it to the [dynamic import format](https://angular.io/guide/deprecations#loadchildren-string-syntax).

- `server.ts` was partially rewritten to support SSR dev-server and serverless deployments. Building SSR is now supported by Angular CLI and explicit `webpack` builds were removed.

- `core-js` had a major upgrade to version 3, so `polyfill.ts` imports have changed.

- We temporarily replaced `@ngx-utils/cookies` with `ngx-utils-cookies-port` due to a [bug](https://github.com/ngx-utils/cookies/issues/20) when using Angular 9.1.

- `angular2-cookie-law` was replaced by `ngx-cookie-banner` for compatibility reasons. This comes with a styling overhaul.

- Further commits contain necessary refactoring:

- `TestBed.get` in tests was deprecated in favor of the new type-safe `TestBed.inject`.

- The empty generic type for NgRx `Store` is now the default and does not have to be supplied. The TSLint rule `ngrx-use-empty-store-type` was adapted to apply this refactoring.

- We removed lazy loading with `@wishtack/reactive-component-loader` and replaced it with the native Angular 9 approach. If you have customized or created extensions, you will have to adapt the following:

- Extension export modules are no longer imported and exported in `SharedModule`, instead export them in `ShellModule`.

- Instead of pointing to the extension module with `ReactiveComponentLoaderModule` in the extension exports module, use the new provider for `LAZY_FEATURE_MODULE` pointing to the _extension store module_, if available. All further lazy loading is done by lazy components and lazy loaded pages. With this, the extension module should no longer import the extension store module.

- Lazy components should no longer be part of the repository as they can be auto-generated on `npm install`. Use the new decorator `@GenerateLazyComponent()` via the `lazy-component` schematic to generate lazy components. We currently do not support creating lazy components for components with `@Output()` decorated fields.

- Previous work-arounds in `<extension>-store.ts` and `<extension>-store.module.ts` for adding reducers of selecting the feature state are no longer necessary and can be refactored to standard approaches.

- We performed a major upgrade to `prettier` which comes with new code formatting for parts of the code.

- We replaced VSCode extension `stylelint-plus` with the official extension. Update the recommended extensions.

- We overhauled the integration of utility libraries for our custom schematics and TSLint rules. These libraries now get built when `npm install`ing the PWA and transpiled JavaScript sources are no longer part of version control. Also, they mainly reuse libraries from the project root now.

## 0.18 to 0.19

We migrated from using [ngrx-router](https://github.com/amcdnl/ngrx-router) to the official and better supported [@ngrx/router-store](https://ngrx.io/guide/router-store).
Expand Down

0 comments on commit 4d1e806

Please sign in to comment.