This commit updates the docs examples to Angular v13.0.0-rc.0. In addition to updating the dependency versions, it also updates the projects' structure and configs to more closely match what a new v13 CLI app would look like. See, also, the [diff][1] between a basic v12.1.3 CLI app and a v13.0.0-rc.0 one. (NOTE: v12.1.3 was the last version for which we aligned the projects with how a new CLI app would look like.) Additionlly: - Since we now use RxJS v7 in docs examples, this commit removes the extra CI steps to explicitly test the docs examples against RxJS v7. - Since Angular v13 no longer supports IE, this commit removes an IE-specific section from `upgrade-setup.md`. [1]: https://github.com/cexbrayat/angular-cli-diff/compare/12.1.3..13.0.0-rc.0 PR Close #43880
4 KiB
Update example dependencies
Follow these steps to update the examples to the latest versions of Angular (and related dependencies):
-
In shared/package.json, bump all the
@angular/*and@nguniversal/*package versions to the version you want to update to and update their peer dependencies (such as@angular-devkit/*,rxjs,typescript,zone.js) and other dependencies (e.g.@types/*) to the latest compatible versions.NOTE: The angular-cli-diff repo can be a useful resource for discovering what dependency versions are used for a basic CLI app at a specific CLI version.
-
In the shared/ directory, run
yarnto update the dependencies in the shared/node_modules/ directory and the shared/yarn.lock file. -
In the shared/ directory, run
yarn sync-depsto update the dependency versions of thepackage.jsonfiles in each sub-folder of shared/boilerplate/ to match the ones in shared/package.json. -
Follow the steps in the following section to update the rest of the boilerplate files.
Update other boilerplate files
The Angular CLI default setup is updated using ng update.
Any necessary changes to boilerplate files will be done automatically through migration schematics.
NOTE: Migrations affecting source code files will not happen automatically, because
ng updatedoes not know about all the examples inaio/content/examples/. You have to make these changes (if any) manually. Again, the angular-cli-diff repo can be a useful resource for discovering changes between versions.
-
In the shared/boilerplate/cli/ directory, run the following commands to migrate the project to the current versions of Angular CLI and the Angular framework (updated in previous steps):
# Ensure dependencies are installed. yarn install # Migrate project to new versions. yarn ng update @angular/cli --allow-dirty --migrate-only --from=<previous-cli-version> yarn ng update @angular/core --allow-dirty --migrate-only --from=<previous-core-version>NOTE: In order for
ng updateto work, there must be anode_modules/directory with installed dependencies inside the shared/boilerplate/cli/ directory. Thisnode_modules/directory is only needed during the update operation and is otherwise ignored (both by git and by the example-boilerplate.js script) by means of the shared/boilerplate/.gitignore file. -
The previous command made any necessary changes to boilerplate files inside the
cli/directory, but the same changes need to be applied to the other CLI-based boilerplate directories. Inspect the changes incli/and manually apply the necessary ones to other CLI-based boilerplate directories. -
Also ensure that any relevant changes in the shared/boilerplate/cli/ directory are copied to the shared/example-scaffold/ directory, which is used when creating new examples (via
yarn create-example ...). Only files that would not be considered boilerplate should be added to theexample-scaffold/directory. -
Run the following command to list all the boilerplate files that are overridden in specific examples.
node aio/tools/examples/example-boilerplate.js list-overridesInspect each of these files to determine whether they need to be updated.
-
Inspect the changes and determine whether some of them need to be applied to the
systemjsboilerplate files. -
Inspect the changes and determine whether any updates to guides are necessary. For example, if a file is renamed or moved, any guides mentioning that file may need updating to refer to the new name/location.
-
Commit all changes to the repository.