Sitelet https://web.archive.org/web/20220128021354/https://github.com/angular/angular/pull/43880
Skip to content
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

build(docs-infra): update docs examples to Angular v13.0.0-rc.0 #43880

Closed
wants to merge 4 commits into from

Conversation

@gkalpak
Copy link
Member

@gkalpak gkalpak commented Oct 18, 2021

This PR 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 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.
@google-cla google-cla bot added the cla: yes label Oct 18, 2021
@ngbot ngbot bot added this to the Backlog milestone Oct 18, 2021
@ngbot ngbot bot added this to the Backlog milestone Oct 18, 2021
@mary-poppins
Copy link

@mary-poppins mary-poppins commented Oct 18, 2021

@gkalpak gkalpak force-pushed the build-update-angular-examples branch from bd732c4 to 420b05d Oct 18, 2021
@mary-poppins
Copy link

@mary-poppins mary-poppins commented Oct 18, 2021

gkalpak added 3 commits Oct 19, 2021
This commit updates the version of Chrome used in non-bazel tests (via
Puppeteer) to the latest (v93).
… with RxJS v7

Due to how `debounceTime()` works in RxJS v7, Jasmine's mock clock was
not enough to trigger it. This commit fixes it by providing a similar
mock clock that is able to mock all of `Date.now()`, `setInterval()` and
`setTimeout()`.
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
@gkalpak gkalpak force-pushed the build-update-angular-examples branch from 420b05d to 488114f Oct 19, 2021
This commit enable the `noImplicitOverride` and
`noPropertyAccessFromIndexSignature` TypeScript compiler options for
docs examples to better align with the default configuration of new
Angular CLI apps. It also makes the necessary changes to the docs
examples source code.
@mary-poppins
Copy link

@mary-poppins mary-poppins commented Oct 19, 2021

@gkalpak gkalpak marked this pull request as ready for review Oct 19, 2021
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Thanks for updating AIO to use v13. This would also unblock further updates of https://angular.io/guide/dynamic-component-loader guide (and other examples) to use new ViewContainerRef.createComponent API.

"@angular/service-worker": "13.0.0-next.9",
"@angular/upgrade": "13.0.0-next.9",
"@nguniversal/express-engine": "~12.1.0",
"@angular/animations": "~13.0.0-next.0",
Copy link
Member

@crisbeto crisbeto Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says rc.0, but this downgrades to next.0.

Copy link
Member Author

@gkalpak gkalpak Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! I don't know what happened here 😱
I'll update the version to rc.1 (now that it's available) 😅

Copy link
Member Author

@gkalpak gkalpak Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, wait! I know what happened here 😁

Here I am aligning the package.json files with what a brand new 13.0.0-rc.0 CLI app would look like (see here).
In the lockfile, you can see that the actual versions used are indeed 13.0.0-rc.0.

The reason the versions in package.json were higher is that people often update the docs examples without following the instructions (just by updating the versions in package.json and the lockfile). But it is better to align with what a new CLI app would look like (even if that means having a broader version range in package.json).

import { docRegionTypeahead } from './typeahead';

describe('typeahead', () => {
let document: Document;
let ajax: jasmine.Spy;
let tick: MockClock['tick'];
Copy link
Member

@petebacondarwin petebacondarwin Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use fakeAsync instead of a hand-rolled solution?

Copy link
Member Author

@gkalpak gkalpak Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests do not use Angular/Zone.js. They are plain ol' RxJS (in Node.js).

Copy link
Member

@petebacondarwin petebacondarwin Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right. It seems surprising that RxJS does not provider something like this out of the box.

Copy link
Member Author

@gkalpak gkalpak Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it does and I couldn't figure it out 😅
I know they have a TestScheduler, but couldn't figure out how to use it without modifying/complicating the original code 🤷‍♂️

"@angular/platform-browser": "13.0.0-next.7",
"@angular/platform-browser-dynamic": "13.0.0-next.7",
"@angular/router": "13.0.0-next.7",
"@angular/animations": "~13.0.0-next.0",
Copy link
Member

@petebacondarwin petebacondarwin Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be rc.1 now.

Copy link
Member Author

@gkalpak gkalpak Oct 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I am aligning with what a new CLI@13.0.0-rc.0 app would look like (see also https://github.com/angular/angular/pull/43880/files#r736589285). This version range would also match the latest RC (if one were to run npm/yarn install without a lockfile), so I think it is fine.

I could update @angular/cli to 13.0.0-rc.1, but even that uses ~13.0.0-next.0 for Angular framework packages (see this diff). Given that we should update the docs examples to v13 once it is released as stable, I think there is little benefit in updating CLI from .rc.0 to .rc.1 at this point.

aio/tools/examples/shared/boilerplate/cli/tsconfig.json Outdated Show resolved Hide resolved
@petebacondarwin petebacondarwin removed this from the Backlog milestone Oct 29, 2021
@petebacondarwin petebacondarwin added this to the v13 milestone Oct 29, 2021
alxhub
alxhub approved these changes Oct 29, 2021
Copy link
Contributor

@alxhub alxhub left a comment

Approved-for: global-approvers

@gkalpak gkalpak removed the request for review from jelbourn Oct 29, 2021
alxhub
alxhub approved these changes Oct 29, 2021
Copy link
Contributor

@alxhub alxhub left a comment

Approved-for: global-approvers

alxhub
alxhub approved these changes Oct 29, 2021
Copy link
Contributor

@alxhub alxhub left a comment

Reviewed-for: global-approvers

@alxhub
Copy link
Contributor

@alxhub alxhub commented Oct 29, 2021

This PR was merged into the repository by commit 7b35a34.

@alxhub alxhub closed this in bc5e295 Oct 29, 2021
alxhub added a commit that referenced this issue Oct 29, 2021
… with RxJS v7 (#43880)

Due to how `debounceTime()` works in RxJS v7, Jasmine's mock clock was
not enough to trigger it. This commit fixes it by providing a similar
mock clock that is able to mock all of `Date.now()`, `setInterval()` and
`setTimeout()`.

PR Close #43880
alxhub added a commit that referenced this issue Oct 29, 2021
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
alxhub added a commit that referenced this issue Oct 29, 2021
…43880)

This commit enable the `noImplicitOverride` and
`noPropertyAccessFromIndexSignature` TypeScript compiler options for
docs examples to better align with the default configuration of new
Angular CLI apps. It also makes the necessary changes to the docs
examples source code.

PR Close #43880
alxhub added a commit that referenced this issue Oct 29, 2021
)

This commit updates the version of Chrome used in non-bazel tests (via
Puppeteer) to the latest (v93).

PR Close #43880
alxhub added a commit that referenced this issue Oct 29, 2021
… with RxJS v7 (#43880)

Due to how `debounceTime()` works in RxJS v7, Jasmine's mock clock was
not enough to trigger it. This commit fixes it by providing a similar
mock clock that is able to mock all of `Date.now()`, `setInterval()` and
`setTimeout()`.

PR Close #43880
alxhub added a commit that referenced this issue Oct 29, 2021
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
alxhub added a commit that referenced this issue Oct 29, 2021
…43880)

This commit enable the `noImplicitOverride` and
`noPropertyAccessFromIndexSignature` TypeScript compiler options for
docs examples to better align with the default configuration of new
Angular CLI apps. It also makes the necessary changes to the docs
examples source code.

PR Close #43880
@IgorMinar
Copy link
Contributor

@IgorMinar IgorMinar commented Oct 29, 2021

Thanks @gkalpak for doing this work!

@gkalpak gkalpak deleted the build-update-angular-examples branch Oct 29, 2021
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Nov 29, 2021

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

9 participants