-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/GH-8499
- Loading branch information
Showing
147 changed files
with
4,257 additions
and
987 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Technical Changes in Spartacus 3.0 | ||
|
||
## Breaking Changes | ||
|
||
### Default Router options changed | ||
The Angular router can be initialized with so-called `ExtraOptions` in the `forRoot` method fo the `RouterModule`. See https://angular.io/api/router/ExtraOptions for more information on those options. | ||
|
||
The default `ExtraOptions` have changed with 3.0. Before 3.0, Spartacus set the `anchorScrolling` and `scrollPositionRestoration` options. In Spartacus 3.0, the `scrollPositionRestoration` has dropped and the `relativeLinkResolution` has been added. See the below table for the actual values and reasoning | ||
|
||
| Option | < 3.0 | > 3.0 | ||
| --- | --- | --- | ||
| `anchorScrolling` | `'enabled'` | `'enabled'` | ||
| `scrollPositionRestoration` | `'enabled'` | (removed) | ||
| `relativeLinkResolution` | n/a | `'corrected'` | ||
| | | | ||
|
||
The enabled `scrollPositionRestoration` was causing a bad experience in most cases, as it would scroll the page to the top on each route change. This is unexpected in a single page experience. | ||
|
||
The corrected `relativeLinkResolution` is used to opt-in to [a fix](https://github.com/angular/angular/issues/37355) that has been added in angular. This will become default from angular 11 onwards. | ||
|
||
|
||
The `RouterModule.forRoot()` method can actually only be called _once_ in an angular application. This makes the default options rather opinionated, which is why the default configurations are carefully selected in Spartacus. The options that have been added/removed can be provided in your custom application with the Angular `ROUTER_CONFIGURATION` injection token. For example: | ||
|
||
```typescript | ||
providers: [ | ||
{ | ||
provide: ROUTER_CONFIGURATION, | ||
useValue: { | ||
scrollPositionRestoration: 'enabled' | ||
} | ||
} | ||
] | ||
``` | ||
|
||
There's no automation (schematics) planned for this change. |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.