WIP - build(docs-infra): update docs examples to latest v9 and Ivy#34374
WIP - build(docs-infra): update docs examples to latest v9 and Ivy#34374gkalpak wants to merge 17 commits intoangular:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
|
You can preview c6f5e72 at https://pr34374-c6f5e72.ngbuilds.io/. |
|
You can preview d3acac0 at https://pr34374-d3acac0.ngbuilds.io/. |
d3acac0 to
8b02ec3
Compare
|
You can preview 8b02ec3 at https://pr34374-8b02ec3.ngbuilds.io/. |
1c3e137 to
94dced4
Compare
|
You can preview 94dced4 at https://pr34374-94dced4.ngbuilds.io/. |
2915499 to
bdb74cb
Compare
|
You can preview bdb74cb at https://pr34374-bdb74cb.ngbuilds.io/. |
bdb74cb to
1987ff7
Compare
|
You can preview 1987ff7 at https://pr34374-1987ff7.ngbuilds.io/. |
1987ff7 to
9f7cbc2
Compare
|
You can preview 9f7cbc2 at https://pr34374-9f7cbc2.ngbuilds.io/. |
9f7cbc2 to
be630c0
Compare
|
You can preview be630c0 at https://pr34374-be630c0.ngbuilds.io/. |
be630c0 to
5e302d0
Compare
|
You can preview 89a37a0 at https://pr34374-89a37a0.ngbuilds.io/. |
|
You can preview c095256 at https://pr34374-c095256.ngbuilds.io/. |
|
You can preview dbae03a at https://pr34374-dbae03a.ngbuilds.io/. |
|
You can preview d8b3206 at https://pr34374-d8b3206.ngbuilds.io/. |
|
You can preview c8ce569 at https://pr34374-c8ce569.ngbuilds.io/. |
There was a problem hiding this comment.
As much as is this is probably the most approachable solution, I'd like to recommend providing the url option to renderModule from @angular/platform-server, since that initializes the URL platform-wide.
There was a problem hiding this comment.
Nice! I didn't know about that; thx for bringing it up 👍
I have pushed a fixup commit to recommend this approach instead: 3072e2e
The docs examples are switched to Ivy. On CI, the tests are run with both Ivy and ViewEngine. Partially addresses: [FW-1609](https://angular-team.atlassian.net/browse/FW-1609)
…les on CI Previously, only e2e tests were run for docs examples on CI. As a result, unit tests (which are included in the zipped archives we provide for users to download and play with the examples locally) were often outdated and broken. This commit configures specific docs examples that have meaningful unit tests to run them on CI (via the `run-example-e2e.js` script). Where necessary, the unit tests are fixed to ensure they pass and reflect the changes in the corresponding component/service. This commit also removes some auto-generated unit tests that are not meaningful (e.g. make trivial assertions, such that a component instance is truthy) and are often broken anyway (e.g. because the corresponding component has been changed in ways that make the tests fail).
…`core-js` The `core-js` dependency is no longer included in `package.json` for `cli`-type examples, but only for the `systemjs` ones. This commit updates the `package.json` templates to reflect that (and also updates the `npm-packages` guide accordingly).
… `tests` Each docs example has an `example-config.json` configuration file. Among other things, this file can be used to specify what commands to run in order to test the example. (If not specified, the `run-example-e2e.js` script will run a default `yarn e2e` command.) Previously, the property specifying the test commands was called `e2e`. This is because in the past only e2e tests were run for docs examples. Since recently, some examples may specify commands for other types of tests (such as unit tests). Therefore, calling the property that holds the list of test commands `e2e` no longer makes sense and can be misleading to people looking at the configuration files. This commit renamed the property to the more generic `tests`. In the future, the `run-example-e2e.js` script (and corresponding npm script) should be renamed and refactored to also avoid giving the impression that only e2e tests are run. Discussed in: angular#36143 (comment)
…s example ZIP archive Previously, the `package.json` template used in the ZIP archive of the `universal` example that we offer for download missed the `build` npm script. This commit updates the template for the `universal` docs example to include the `build` npm script. NOTE: The `build` npm script is already included in `aio/tools/examples/shared/boilerplate/universal/package.json`, but it was removed by the example zipper.
I noticed these minor styling issues while aligning the `universal` examples with the `toh-pt6` example (in a subsequent commit).
…match latest CLI Update the `main.ts` files in Tour-of-Heroes examples to match what would be generated by the latest CLI.
As mentioned in the `universal` guide, the `toh-pt6` examples is the starting poitn for the `universal` example. However, the two examples had become out-of-sync, because some fixes/changes were made to the Tour-of-Heroes examples. This commit ports these changes to the `universal` example.
Update the `universal` example (and related files) to match what would be generated by the latest CLI.
… error in `universal` example Previously, building the `universal` example failed with: ``` node_modules/@types/express/index.d.ts(90,50): error TS2694: Namespace '".../@types/express-serve-static-core/index"' has no exported member 'Params'. node_modules/@types/express/index.d.ts(90,64): error TS2694: Namespace '".../@types/express-serve-static-core/index"' has no exported member 'ParamsDictionary'. ``` This commit fixes the error by upgrading `@types/express-serve-static-core` to a newer version. See DefinitelyTyped/DefinitelyTyped#40905 for more details.
Previously, there were no tests for the `universal` docs example. This meant that the project was not tested at all (not even ensuring that it can be built successfully). This commit adds e2e tests for the `universal` example (ported from `toh-pt6` and cleaned up) and also verifies that the project can be built successfully (including the server).
In the past, server-side rendered apps needed to convert URLs used in API requests to absolute when rendering on the server. Originally, this was handled in the `universal` guide and corresponding example app by modifying the `HeroService` to use `APP_BASE_HREF` to derive the absolute URL. In angular#28956, the guide was updated to show an improved method: Specifying an `HttpInterceptor` that took care of converting the URLs to absolute. That interceptor was only provided when rendering the app on the server. By mistake, the corresponding example app was not updated along with the guide. Since `@nguniversal/*` v7.1.0, it is no longer necessary to convert the URLs to absolute inside the app. This is handled in the `@nguniversal` libs (see angular/universal#897). This commit updates the example app to emove unnecessary code and modifies the guide to mention the issue with absolute URLs, but explain that developers only need to worry about it when not using one of the `@nguniversal/*-engine` packages.
Update the `i18n` example (and related files) to match what would be generated by the latest CLI.
|
The final bit was addressed in #36924, so this can be closed. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Jira issue: FW-1609
Blocked on:
Add elements project type for boilerplate example projects #33484 (+updatingLanded in build(docs-infra): update docs examples to latest v9 #36015.aio/tools/examples/shared/boilerplate/elements/package.jsonaccording toaio/tools/examples/shared/boilerplate/cli/package.json)release: cut the zone.js-0.10.3 release #34508(+updatingzone.jsdependency version) Landed in build(docs-infra): update docs examples to latest v9 #36015.docs: fix docs and associated code snippets for enabling more macro tasks infakeAsync()#35778build(docs-infra): use local version of Zone.js when testing against local packages #35780build(docs-infra): use local version of Zone.js when testing against local packages #35858build(docs-infra): update docs examples to latest v9 #36015(orignally part of this PR - split off for easier review/merging)build(docs-infra): switch the docs examples to Ivy and run unit tests for specific examples on CI #36143(orignally part of this PR - split off for easier review/merging)docs: updateuniversalguide and docs example to v9 #36483 (orignally part of this PR - split off for easier review/merging)Fixes #34382, #34383 and #35289.
This PR may also partially address: #35776