mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
Compare commits
252 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 99bf2cd524 | |||
| 7725b70a0a | |||
| a5c3857a7b | |||
| 5e0d2bc143 | |||
| b86a81136d | |||
| 0fa674ba50 | |||
| bd4dbdd2bd | |||
| 436111f661 | |||
| c21b459ba6 | |||
| ec5807cbdc | |||
| f978e9caf1 | |||
| 760e284428 | |||
| 3818436ebc | |||
| c9f27b434a | |||
| 0e6fbfb758 | |||
| 4c50e1e7cb | |||
| 82bbcde843 | |||
| 266ad40e62 | |||
| 4261fd367e | |||
| 6250269f1f | |||
| 3eea50da64 | |||
| e5d58d250d | |||
| ac4e8f7bca | |||
| 51ac883167 | |||
| 9bb3446e35 | |||
| 04d77d5a1c | |||
| 1ca24cb936 | |||
| 967bbc1e3e | |||
| 507d83d5ed | |||
| 4a33efaa3e | |||
| 5530c5e505 | |||
| ce094b227c | |||
| 9258160598 | |||
| 3ee861835a | |||
| 9cd633e1b8 | |||
| 75db462d8b | |||
| c3d077cca1 | |||
| af0eb846a5 | |||
| 544aedee6f | |||
| add11c6854 | |||
| 5083d893a9 | |||
| 826861b1fa | |||
| 9cb003ac3d | |||
| efb9eb4fa9 | |||
| 79a29e4f14 | |||
| eda03d4b89 | |||
| 8979fba2c5 | |||
| d5ee04edc1 | |||
| 87921d7fff | |||
| d38135a12d | |||
| 775476b9ac | |||
| 5cf14da35c | |||
| aeeb38a546 | |||
| 2c66afe857 | |||
| a19e214cbe | |||
| d4c103ae08 | |||
| 39b7bdabec | |||
| 99df5a8ba2 | |||
| 8ae4783d9b | |||
| cc57d4c499 | |||
| 8c6f261fa3 | |||
| c67cbe98a6 | |||
| 9bf9864e79 | |||
| a3b1dc005d | |||
| 8bd9ad02a4 | |||
| 8a670e6bc5 | |||
| afdcff3f71 | |||
| 051c140cc3 | |||
| c77ebb6f51 | |||
| b955999d29 | |||
| 268a26f1b6 | |||
| ca8969b946 | |||
| ce231fb271 | |||
| 888360a6b0 | |||
| 1713d31026 | |||
| 4390d09d58 | |||
| 7676d8fc2d | |||
| e9e8960e76 | |||
| 766548c3ec | |||
| 545fb0d88b | |||
| 9a2295fcee | |||
| d0ae5561b0 | |||
| 9d6effcec9 | |||
| 5587dde5d5 | |||
| 650101e19d | |||
| 36e8f4d5c8 | |||
| 766db6a069 | |||
| 5826d8cb52 | |||
| a7c1115c3d | |||
| 5c0004bb62 | |||
| 9f0691577e | |||
| 4d2a8005e8 | |||
| 13404d5107 | |||
| 68d51f08a3 | |||
| 422e9754b0 | |||
| 80d1094a4e | |||
| 53427d875d | |||
| 9cb1d27406 | |||
| ee0412fb29 | |||
| 05e7bf8734 | |||
| 16eba152c4 | |||
| 4ac78fb846 | |||
| 5ba2a48f49 | |||
| 88f0545e8e | |||
| eb9a5f5bbe | |||
| 158ceaf062 | |||
| 816ddf4539 | |||
| f4e9768da2 | |||
| 7b67ad2fc5 | |||
| 129c973934 | |||
| bc429baa92 | |||
| a84beaa4a7 | |||
| fd45d03d2f | |||
| 949dec26b8 | |||
| fc034137ab | |||
| ca60d9dd3f | |||
| 10851d27cc | |||
| d10dc5c85c | |||
| cb95e2f8ab | |||
| eb0ccfc40c | |||
| a8a20ad238 | |||
| e53d02df85 | |||
| 109df125c8 | |||
| 17f2181299 | |||
| 0bcea6c928 | |||
| 2c325d46b0 | |||
| 54a8fc3b19 | |||
| 555696635e | |||
| 878f581961 | |||
| 9cef0d210f | |||
| 346a555e93 | |||
| fa837a393e | |||
| 4d043992e5 | |||
| 2abcb040eb | |||
| 67f0cf5fc8 | |||
| 2f9d94bc4a | |||
| ee76001431 | |||
| b63afb9e93 | |||
| 658fb0a17f | |||
| f8aa778b70 | |||
| 60ed00a601 | |||
| c7ff3d158a | |||
| aeb20f95d2 | |||
| 708ba8115f | |||
| fb5a28858d | |||
| 5b67c94775 | |||
| b478dfbfda | |||
| 75d1cae616 | |||
| 53fe455630 | |||
| 1470b7d40e | |||
| 76631995e1 | |||
| 519e781701 | |||
| 1af2be9b23 | |||
| a893f0b60d | |||
| 93ce4d0483 | |||
| ed271ebb37 | |||
| 6734b59b35 | |||
| 789326d483 | |||
| 4b63716b4a | |||
| 308b194ee3 | |||
| 62510a7b4d | |||
| ece2deeab6 | |||
| 4d8d324ea6 | |||
| 3253576db8 | |||
| 365fd50407 | |||
| d1d9f5569f | |||
| 7763387253 | |||
| 0ec68a2a40 | |||
| 2ad5dcf3f0 | |||
| 9aff43b5e8 | |||
| fa46844f5c | |||
| cd00ec582b | |||
| 821012d0f7 | |||
| 8958e0bf70 | |||
| 4bb332ef08 | |||
| 64f202cab9 | |||
| cf34d2b87f | |||
| ec4483c471 | |||
| 1f7e81aef9 | |||
| cb433af0e1 | |||
| 3cf70e26ba | |||
| 2b7bad5151 | |||
| 78d4ad20e6 | |||
| c2149dfaa8 | |||
| 99e9474aa2 | |||
| 766bdf3207 | |||
| 2a1ea5a22b | |||
| 529a5f434d | |||
| e70228afa9 | |||
| 4ab3a9afad | |||
| 1f5ab960ef | |||
| 860eccef48 | |||
| e61ccd2ac5 | |||
| 80e5a0a03d | |||
| c0788200e2 | |||
| 42318e7c3d | |||
| 33dc072b70 | |||
| 209632e64d | |||
| e78dd31cea | |||
| 91029aa082 | |||
| 52296bc29d | |||
| 64862cbff2 | |||
| 90bbc68d44 | |||
| a5cc82ee84 | |||
| 855b8e046c | |||
| 35e8184935 | |||
| 74506e76a8 | |||
| c22c5c4543 | |||
| 5d41ab9cd1 | |||
| 243ccce624 | |||
| e8badecf4f | |||
| cdfcb779df | |||
| ac395d0f68 | |||
| e75a9a4d83 | |||
| 41f28f88b1 | |||
| 7df0a8a278 | |||
| 9889346620 | |||
| 39a50f9a8d | |||
| 1f77083a2d | |||
| bb35414a38 | |||
| fcfb42a8ba | |||
| 57e54e29e7 | |||
| 2909e9817d | |||
| 619f3c8792 | |||
| 0ee1a1419d | |||
| f386a04c9d | |||
| 492e03f699 | |||
| ba9ddd7ac2 | |||
| 5d23e601d1 | |||
| a7872ca77a | |||
| 10314787d6 | |||
| 40a94b3ab6 | |||
| 1f129f114e | |||
| 962934bc4f | |||
| 6ce8fc8637 | |||
| e82173e8c4 | |||
| b6a7d509fe | |||
| 01722ee637 | |||
| 7225485311 | |||
| a45e69f627 | |||
| a7d6c64a47 | |||
| 2f7c7b3833 | |||
| 0daa1ea19d | |||
| 658ae699d8 | |||
| 9cf6b9369e | |||
| 9ea0d69275 | |||
| f1991d49b0 | |||
| 198f2ff5f2 | |||
| 8d37ed035c | |||
| 365955322f | |||
| d870856840 | |||
| 7bfa3610c5 |
@@ -56,6 +56,11 @@ build --enable_runfiles
|
||||
build:release --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=release"
|
||||
build:release --stamp
|
||||
|
||||
# Building AIO against local Angular deps requires stamping
|
||||
# versions in Angular packages due to CLI version checks.
|
||||
build:aio_local_deps --stamp
|
||||
build:aio_local_deps --workspace_status_command="yarn -s --cwd aio local-workspace-status"
|
||||
|
||||
# Snapshots should also be stamped with version control information.
|
||||
build:snapshot-build --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=snapshot"
|
||||
build:snapshot-build --stamp
|
||||
@@ -69,6 +74,14 @@ build:snapshot-build --stamp
|
||||
##########################################################
|
||||
build --flag_alias=aio_build_config=//aio:flag_aio_build_config
|
||||
|
||||
####################################
|
||||
# AIO first party dep substitution #
|
||||
# Turn on with #
|
||||
# --config=aio_local_deps #
|
||||
####################################
|
||||
|
||||
build:aio_local_deps --//aio:flag_aio_local_deps
|
||||
|
||||
###############################
|
||||
# Output #
|
||||
###############################
|
||||
@@ -105,6 +118,10 @@ common:remote --jobs=200
|
||||
|
||||
build:remote --google_default_credentials
|
||||
|
||||
# Limit the number of test jobs for on an AIO local deps build. The example tests running
|
||||
# concurrently pushes the circleci executor RAM usage to its limits.
|
||||
test:aio_local_deps --jobs=24
|
||||
|
||||
# Force remote exeuctions to consider the entire run as linux
|
||||
build:remote --cpu=k8
|
||||
build:remote --host_cpu=k8
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"devondcarew.bazel-code",
|
||||
"gkalpak.aio-docs-utils",
|
||||
"ms-vscode.vscode-typescript-tslint-plugin",
|
||||
"xaver.clang-format",
|
||||
// The following extensions are useful when working on angular.io (i.e. inside the `aio/` directory).
|
||||
//"angular.ng-template",
|
||||
//"dbaeumer.vscode-eslint",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: 'Docs or angular.dev Bug Report'
|
||||
name: 'Docs or angular.io Bug Report'
|
||||
description: Report an issue in Angular's documentation or angular.io application
|
||||
|
||||
body:
|
||||
|
||||
@@ -21,16 +21,16 @@ jobs:
|
||||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'adev: preview'))
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5774b71c01a55c4c998f858ee37d3b77ae704c31
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5774b71c01a55c4c998f858ee37d3b77ae704c31
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5774b71c01a55c4c998f858ee37d3b77ae704c31
|
||||
- name: Install node modules
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Build adev to ensure it continues to work
|
||||
run: yarn bazel build //adev:build
|
||||
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
run: yarn bazel build --config=aio_local_deps //adev:build
|
||||
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@5774b71c01a55c4c998f858ee37d3b77ae704c31
|
||||
with:
|
||||
workflow-artifact-name: 'adev-preview'
|
||||
pull-number: '${{github.event.pull_request.number}}'
|
||||
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
npx -y firebase-tools@latest target:clear --config adev/firebase.json --project ${{env.PREVIEW_PROJECT}} hosting angular-docs
|
||||
npx -y firebase-tools@latest target:apply --config adev/firebase.json --project ${{env.PREVIEW_PROJECT}} hosting angular-docs ${{env.PREVIEW_SITE}}
|
||||
|
||||
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@5774b71c01a55c4c998f858ee37d3b77ae704c31
|
||||
with:
|
||||
github-token: '${{secrets.GITHUB_TOKEN}}'
|
||||
workflow-artifact-name: 'adev-preview'
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
# This workflow builds the AIO previews for pull requests when a certain label is applied.
|
||||
# The actual deployment happens as part of a dedicated second workflow to avoid security
|
||||
# issues where the building would otherwise occur in an authorized context where secrets
|
||||
# could be leaked. More details can be found here:
|
||||
|
||||
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
|
||||
|
||||
name: Build AIO app for preview deployment
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [synchronize, labeled]
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
aio-build:
|
||||
runs-on: ubuntu-latest
|
||||
# We only want to build and deploy the AIO app if the `aio: preview` label has been
|
||||
# added, or if the label is already applied and new changes have been made in the PR.
|
||||
if: |
|
||||
(github.event.action == 'labeled' && github.event.label.name == 'aio: preview') ||
|
||||
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'aio: preview'))
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- uses: ./.github/actions/yarn-install
|
||||
|
||||
- uses: angular/dev-infra/github-actions/bazel/configure-remote@c83e99a12397014162531ca125c94549db55dd84
|
||||
with:
|
||||
bazelrc: ./.bazelrc.user
|
||||
|
||||
# Build the web package. Note: We run Bazel from a low-resource Github action container,
|
||||
# so we manually need to instruct Bazel to run more actions concurrently as by default
|
||||
# the number of concurrent actions is determined based on the host resources.
|
||||
- run: bazel build //aio:build --jobs=32 --announce_rc --verbose_failures
|
||||
|
||||
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@c83e99a12397014162531ca125c94549db55dd84
|
||||
with:
|
||||
workflow-artifact-name: 'aio'
|
||||
pull-number: '${{github.event.pull_request.number}}'
|
||||
artifact-build-revision: '${{github.event.pull_request.head.sha}}'
|
||||
deploy-directory: './dist/bin/aio/build'
|
||||
@@ -0,0 +1,44 @@
|
||||
# This workflow runs whenever the AIO build workflow has completed. Deployment happens
|
||||
# as part of a dedicated second workflow to avoid security issues where the building would
|
||||
# otherwise occur in an authorized context where secrets could be leaked.
|
||||
#
|
||||
# More details can be found here:
|
||||
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
|
||||
|
||||
name: Deploying AIO preview to Firebase
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ['Build AIO app for preview deployment']
|
||||
types: [completed]
|
||||
|
||||
permissions:
|
||||
# Needed in order to be able to comment on the pull request.
|
||||
pull-requests: write
|
||||
|
||||
env:
|
||||
PREVIEW_PROJECT: ng-dev-previews
|
||||
PREVIEW_SITE: ng-dev-previews-fw
|
||||
|
||||
jobs:
|
||||
aio-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||
|
||||
- name: Configure Firebase deploy target
|
||||
working-directory: aio/
|
||||
run: |
|
||||
# We can use `npx` as the Firebase deploy actions uses it too.
|
||||
npx -y firebase-tools@latest target:clear --project ${{env.PREVIEW_PROJECT}} hosting aio
|
||||
npx -y firebase-tools@latest target:apply --project ${{env.PREVIEW_PROJECT}} hosting aio ${{env.PREVIEW_SITE}}
|
||||
|
||||
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@c83e99a12397014162531ca125c94549db55dd84
|
||||
with:
|
||||
github-token: '${{secrets.GITHUB_TOKEN}}'
|
||||
workflow-artifact-name: 'aio'
|
||||
firebase-config-dir: './aio/'
|
||||
firebase-public-dir: './aio/dist'
|
||||
firebase-project-id: '${{env.PREVIEW_PROJECT}}'
|
||||
firebase-service-key: '${{secrets.FIREBASE_PREVIEW_SERVICE_TOKEN}}'
|
||||
@@ -13,9 +13,9 @@ jobs:
|
||||
assistant_to_the_branch_manager:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: angular/dev-infra/github-actions/branch-manager@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
- uses: angular/dev-infra/github-actions/branch-manager@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
- uses: alessbell/pull-request-comment-branch@aad01d65d6982b8eacabed5e9a684cd8ceb98da6 # v1.1
|
||||
id: comment-branch
|
||||
|
||||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
# Specify repository as the PR branch might be from a fork.
|
||||
repository: ${{steps.comment-branch.outputs.head_owner}}/${{steps.comment-branch.outputs.head_repo}}
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
|
||||
- uses: ./.github/actions/yarn-install
|
||||
|
||||
- uses: angular/dev-infra/github-actions/bazel/configure-remote@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
- uses: angular/dev-infra/github-actions/bazel/configure-remote@5774b71c01a55c4c998f858ee37d3b77ae704c31
|
||||
with:
|
||||
bazelrc: ./.bazelrc.user
|
||||
|
||||
|
||||
+275
-9
@@ -5,7 +5,6 @@ on:
|
||||
branches:
|
||||
- main
|
||||
- '[0-9]+.[0-9]+.x'
|
||||
- 'browser-update-test'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
@@ -20,6 +19,243 @@ defaults:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
cache-node-modules: true
|
||||
node-module-directories: |
|
||||
./node_modules
|
||||
./aio/node_modules
|
||||
- name: Install node modules
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Install node modules in aio
|
||||
run: yarn install --frozen-lockfile --cwd aio
|
||||
- name: Check code lint
|
||||
run: yarn -s tslint
|
||||
- name: Check code lint in aio
|
||||
run: yarn -s --cwd aio lint
|
||||
- name: Check for circular dependencies
|
||||
run: yarn -s ts-circular-deps:check
|
||||
- name: Validate pull approve configuration
|
||||
run: yarn -s ng-dev pullapprove verify
|
||||
- name: Validate angular robot configuration
|
||||
run: yarn -s ng-dev ngbot verify
|
||||
- name: Confirm code builds with typescript as expected
|
||||
run: yarn -s check-tooling-setup
|
||||
- name: Check commit message
|
||||
# Commit message validation is only done on pull requests as its too late to validate once
|
||||
# it has been merged.
|
||||
if: github.event_name == 'pull_request'
|
||||
run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
|
||||
- name: Check code format
|
||||
# Code formatting checks are only done on pull requests as its too late to validate once
|
||||
# it has been merged.
|
||||
if: github.event_name == 'pull_request'
|
||||
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
|
||||
|
||||
devtools:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Install node modules
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Run unit tests
|
||||
run: yarn devtools:test
|
||||
- name: Test build
|
||||
run: yarn devtools:build:chrome
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Bazel Remote Caching
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Install node modules
|
||||
run: yarn install --frozen-lockfile --network-timeout 100000
|
||||
- name: Run CI tests for framework
|
||||
run: yarn test:ci
|
||||
|
||||
aio:
|
||||
runs-on: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@c83e99a12397014162531ca125c94549db55dd84
|
||||
with:
|
||||
cache-node-modules: true
|
||||
node-module-directories: |
|
||||
./aio/node_modules
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@c83e99a12397014162531ca125c94549db55dd84
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@c83e99a12397014162531ca125c94549db55dd84
|
||||
- name: Install node modules for aio
|
||||
run: yarn install --cwd aio --frozen-lockfile
|
||||
- name: Run AIO tests with upstream packages
|
||||
run: yarn --cwd aio test:ci
|
||||
- name: Check generated bundle sizes
|
||||
run: yarn --cwd aio payload-size
|
||||
|
||||
adev:
|
||||
runs-on:
|
||||
labels: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Install node modules
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Build adev to ensure it continues to work
|
||||
run: yarn bazel test --config=aio_local_deps //adev:test
|
||||
|
||||
aio-local:
|
||||
runs-on:
|
||||
labels: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@c83e99a12397014162531ca125c94549db55dd84
|
||||
with:
|
||||
cache-node-modules: true
|
||||
node-module-directories: |
|
||||
./aio/node_modules
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@c83e99a12397014162531ca125c94549db55dd84
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@c83e99a12397014162531ca125c94549db55dd84
|
||||
- name: Install node modules
|
||||
run: yarn install --cwd aio --frozen-lockfile
|
||||
- name: Run AIO tests with local packages
|
||||
run: yarn --cwd aio test-local:ci
|
||||
- name: Check generated bundle sizes
|
||||
run: yarn --cwd aio payload-size aio-local
|
||||
|
||||
aio-deploy:
|
||||
needs: [aio]
|
||||
if: needs.aio.result == 'success' && github.event_name == 'push'
|
||||
runs-on:
|
||||
labels: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@c83e99a12397014162531ca125c94549db55dd84
|
||||
with:
|
||||
cache-node-modules: true
|
||||
node-module-directories: |
|
||||
./aio/node_modules
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@c83e99a12397014162531ca125c94549db55dd84
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@c83e99a12397014162531ca125c94549db55dd84
|
||||
- name: Install node modules for aio
|
||||
run: yarn install --cwd aio --frozen-lockfile
|
||||
- name: Set the stable branch environment variable
|
||||
id: latest_version
|
||||
run: |
|
||||
echo "CI_STABLE_BRANCH=$(npm info @angular/core dist-tags.latest | sed -r 's/^\s*([0-9]+\.[0-9]+)\.[0-9]+.*$/\1.x/')" >> $GITHUB_OUTPUT
|
||||
echo "CI_BRANCH=$(echo ${{ github.event.ref }} | cut -d '/' -f 3)" >> $GITHUB_OUTPUT
|
||||
- name: Deploy aio to production
|
||||
env:
|
||||
CI_AIO_MIN_PWA_SCORE: '95'
|
||||
CI_COMMIT: ${{ github.event.after }}
|
||||
CI_REPO_NAME: 'angular'
|
||||
CI_PULL_REQUEST: 'false'
|
||||
CI_REPO_OWNER: 'angular'
|
||||
CI_BUILD_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
|
||||
CI_STABLE_BRANCH: ${{ steps.latest_version.outputs.CI_STABLE_BRANCH }}
|
||||
CI_BRANCH: ${{ steps.latest_version.outputs.CI_BRANCH }}
|
||||
CI_SECRET_AIO_DEPLOY_FIREBASE_TOKEN: ${{ secrets.AIO_DEPLOY_TOKEN }}
|
||||
CI_SECRET_PAYLOAD_FIREBASE_TOKEN: ${{ secrets.AIO_PAYLOAD_TOKEN }}
|
||||
run: yarn --cwd aio deploy-production
|
||||
- name: Notify about failed deployment
|
||||
if: ${{ failure() }}
|
||||
uses: slackapi/slack-github-action@2a8087d4af6f83146a87539a70defe909fe6dbe6 # v=v1.24.0
|
||||
with:
|
||||
channel-id: 'C07DT5M6V,CKV1F72BG'
|
||||
slack-message: 'Deploy to aio job failed for ${{ github.base_ref }} branch failed on build ${{ github.event.after }}: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
|
||||
env:
|
||||
SLACK_BOT_TOKEN: ${{ secrets.ANGULAR_ROBOT_SLACK_TOKEN }}
|
||||
|
||||
publish-snapshots:
|
||||
if: github.event_name == 'push'
|
||||
runs-on:
|
||||
labels: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Install node modules
|
||||
run: yarn install --frozen-lockfile
|
||||
- run: echo "https://${{secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN}}:@github.com" > ${HOME}/.git_credentials
|
||||
- run: yarn build
|
||||
- run: ./scripts/ci/publish-build-artifacts.sh
|
||||
|
||||
zone-js:
|
||||
runs-on:
|
||||
labels: ubuntu-latest-4core
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
cache-node-modules: true
|
||||
node-module-directories: |
|
||||
./node_modules
|
||||
./packages/zone.js/node_modules
|
||||
./packages/zone.js/test/typings/node_modules
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Install node modules
|
||||
run: yarn install --frozen-lockfile
|
||||
- run: |
|
||||
yarn bazel build \
|
||||
//packages/zone.js/bundles:zone.umd.js \
|
||||
//packages/zone.js:npm_package \
|
||||
//packages/zone.js/test/closure:closure_js \
|
||||
|
||||
- run: |
|
||||
rm -Rf packages/zone.js/build
|
||||
rm -Rf packages/zone.js/test/extra/*.umd.js
|
||||
|
||||
mkdir -p packages/zone.js/build/
|
||||
mkdir -p packages/zone.js/build/test/
|
||||
|
||||
cp dist/bin/packages/zone.js/bundles/zone.umd.js packages/zone.js/build/zone.umd.js
|
||||
cp dist/bin/packages/zone.js/npm_package/bundles/zone-mix.umd.js ./packages/zone.js/test/extra/
|
||||
cp dist/bin/packages/zone.js/npm_package/bundles/zone-patch-electron.umd.js ./packages/zone.js/test/extra/
|
||||
cp dist/bin/packages/zone.js/test/closure/zone.closure.mjs ./packages/zone.js/build/test/zone.closure.mjs
|
||||
|
||||
# Install
|
||||
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
|
||||
# Run zone.js tools tests
|
||||
- run: yarn --cwd packages/zone.js promisefinallytest
|
||||
- run: yarn --cwd packages/zone.js jest:test
|
||||
- run: yarn --cwd packages/zone.js jest:nodetest
|
||||
- run: yarn --cwd packages/zone.js electrontest
|
||||
- run: yarn --cwd packages/zone.js/test/typings install --frozen-lockfile --non-interactive
|
||||
- run: yarn --cwd packages/zone.js/test/typings test
|
||||
|
||||
bazel-saucelabs:
|
||||
# TODO: Replace legacy job with Bazel saucelabs job.
|
||||
if: github.event_name == 'push'
|
||||
@@ -28,7 +264,7 @@ jobs:
|
||||
JOBS: 2
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
cache-node-modules: true
|
||||
# Checking out the pull request commit is intended here as we need to run the changed code tests.
|
||||
@@ -36,11 +272,11 @@ jobs:
|
||||
- name: Install node modules
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Bazel Remote Caching
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Saucelabs Variables
|
||||
uses: angular/dev-infra/github-actions/saucelabs@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/saucelabs@50bb71e51d3372ca2e359adb9069f89beeac4ae7
|
||||
- name: Set up Sauce Tunnel Daemon
|
||||
run: yarn bazel run //tools/saucelabs-daemon/background-service -- $JOBS &
|
||||
env:
|
||||
@@ -56,15 +292,15 @@ jobs:
|
||||
SAUCE_TUNNEL_IDENTIFIER: angular-framework-${{ github.run_number }}
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
cache-node-modules: true
|
||||
- name: Install node modules
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Saucelabs Variables
|
||||
uses: angular/dev-infra/github-actions/saucelabs@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/saucelabs@50bb71e51d3372ca2e359adb9069f89beeac4ae7
|
||||
- name: Starting Saucelabs tunnel service
|
||||
run: ./tools/saucelabs/sauce-service.sh run &
|
||||
# Build test fixtures for a test that rely on Bazel-generated fixtures. Note that disabling
|
||||
@@ -96,4 +332,34 @@ jobs:
|
||||
- name: Stop Saucelabs tunnel service
|
||||
run: ./tools/saucelabs/sauce-service.sh stop
|
||||
|
||||
|
||||
adev-deploy:
|
||||
needs: [adev]
|
||||
if: needs.adev.result == 'success' && github.event_name == 'push' && github.ref_name == 'main'
|
||||
env:
|
||||
DEPLOY_PROJECT: angular-dev-site
|
||||
DEPLOY_SITE: angular-dev-site
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
- name: Install node modules
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Build adev to ensure it continues to work
|
||||
run: yarn bazel build --config=aio_local_deps //adev:build
|
||||
- name: Move generated project files into deployment directory
|
||||
run: cp -r dist/bin/adev/build adev/build
|
||||
- name: Setup firebase context
|
||||
run: |
|
||||
npx -y firebase-tools@latest target:clear --config adev/firebase.json --project ${{ env.DEPLOY_PROJECT }} hosting angular-docs
|
||||
npx -y firebase-tools@latest target:apply --config adev/firebase.json --project ${{ env.DEPLOY_PROJECT }} hosting angular-docs ${{ env.DEPLOY_SITE }}
|
||||
- name: Deploy to firebase
|
||||
uses: FirebaseExtended/action-hosting-deploy@120e124148ab7016bec2374e5050f15051255ba2 # v0.7.1
|
||||
with:
|
||||
entryPoint: './adev'
|
||||
firebaseServiceAccount: ${{ secrets.ANGULAR_DEV_SITE_DEPLOY }}
|
||||
projectId: ${{ env.DEPLOY_PROJECT }}
|
||||
channelId: live
|
||||
|
||||
@@ -12,14 +12,14 @@ jobs:
|
||||
labels:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
||||
- uses: angular/dev-infra/github-actions/commit-message-based-labels@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- uses: angular/dev-infra/github-actions/commit-message-based-labels@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
|
||||
post_approval_changes:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
||||
- uses: angular/dev-infra/github-actions/post-approval-changes@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- uses: angular/dev-infra/github-actions/post-approval-changes@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
|
||||
|
||||
@@ -13,8 +13,8 @@ jobs:
|
||||
statuses: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
||||
- uses: angular/dev-infra/github-actions/google-internal-tests@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- uses: angular/dev-infra/github-actions/google-internal-tests@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
run-tests-guide-url: http://go/angular-g3sync-start
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -9,6 +9,6 @@ jobs:
|
||||
status:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: angular/dev-infra/github-actions/unified-status-check@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
- uses: angular/dev-infra/github-actions/unified-status-check@4b433074a806bbbd4d319264430740cd46e62f27
|
||||
with:
|
||||
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
|
||||
|
||||
@@ -22,15 +22,15 @@ jobs:
|
||||
version: ['https://next.angular.io/', 'https://angular.io/']
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5774b71c01a55c4c998f858ee37d3b77ae704c31
|
||||
with:
|
||||
cache-node-modules: true
|
||||
node-module-directories: |
|
||||
./aio/node_modules
|
||||
- name: Setup Bazel
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/bazel/setup@5774b71c01a55c4c998f858ee37d3b77ae704c31
|
||||
- name: Setup Bazel RBE
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/bazel/configure-remote@5774b71c01a55c4c998f858ee37d3b77ae704c31
|
||||
- name: Install node modules in aio
|
||||
run: yarn install --frozen-lockfile --cwd aio
|
||||
- name: Run basic e2e and deployment config tests.
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Initialize environment
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5774b71c01a55c4c998f858ee37d3b77ae704c31
|
||||
with:
|
||||
cache-node-modules: true
|
||||
node-module-directories: |
|
||||
|
||||
@@ -19,7 +19,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
# Setting `persist-credentials: false` prevents the github-action account from being the
|
||||
# account that is attempted to be used for authentication, instead the remote is set to
|
||||
@@ -28,11 +28,11 @@ jobs:
|
||||
# This is needed as otherwise the PR creation will fail with `shallow update not allowed` when the forked branch is not in sync.
|
||||
fetch-depth: 0
|
||||
- name: Generate CLI help
|
||||
run: node adev/scripts/update-cli-help/index.mjs
|
||||
run: node aio/scripts/update-cli-help/index.mjs
|
||||
env:
|
||||
ANGULAR_CLI_BUILDS_READONLY_GITHUB_TOKEN: ${{ secrets.ANGULAR_CLI_BUILDS_READONLY_GITHUB_TOKEN }}
|
||||
- name: Create a PR (if necessary)
|
||||
uses: angular/dev-infra/github-actions/create-pr-for-changes@e6e98d32d7d4d350ecf4ec10ad9c7e75198daabd
|
||||
uses: angular/dev-infra/github-actions/create-pr-for-changes@1421ff04811ecb45812930c5d1f61d912880e75f
|
||||
with:
|
||||
branch-prefix: update-cli-help
|
||||
pr-title: 'docs: update Angular CLI help [${{github.ref_name}}]'
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# Update the `events.json` file that powers the [AIO events page](https://angular.io/events) (if
|
||||
# necessary) and create a pull request.
|
||||
#
|
||||
# For more details on the overall process, see
|
||||
# [aio/scripts/generate-events/README.md](../../aio/scripts/generate-events/README.md).
|
||||
|
||||
name: Update AIO events
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs: {}
|
||||
schedule:
|
||||
# Run every day at 15:00.
|
||||
- cron: '0 15 * * *'
|
||||
|
||||
# Declare default permissions as read only.
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
update_events:
|
||||
name: Update `events.json` (if necessary)
|
||||
if: github.repository == 'angular/angular'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the repository
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
# Setting `persist-credentials: false` prevents the github-action account from being the
|
||||
# account that is attempted to be used for authentication, instead the remote is set to
|
||||
# an authenticated URL.
|
||||
persist-credentials: false
|
||||
# This is needed as otherwise the PR creation will fail with `shallow update not allowed` when the forked branch is not in sync.
|
||||
fetch-depth: 0
|
||||
- name: Generate `events.json`
|
||||
run: node aio/scripts/generate-events/index.mjs --ignore-invalid-dates
|
||||
- name: Create a PR (if necessary)
|
||||
uses: angular/dev-infra/github-actions/create-pr-for-changes@c83e99a12397014162531ca125c94549db55dd84
|
||||
with:
|
||||
branch-prefix: docs-update-events
|
||||
pr-title: 'docs: update events'
|
||||
pr-description: |
|
||||
Generated `events.json` with the latest events retrieved from the Firebase DB.
|
||||
pr-labels: |
|
||||
action: review
|
||||
area: docs
|
||||
target: patch
|
||||
angular-robot-token: ${{ secrets.ANGULAR_ROBOT_ACCESS_TOKEN }}
|
||||
+56
-5
@@ -7,7 +7,23 @@ export const format: FormatConfig = {
|
||||
'prettier': {
|
||||
'matchers': [
|
||||
'**/*.{yaml,yml}',
|
||||
'**/*.{js,ts}',
|
||||
'adev/**/*.{js,ts}',
|
||||
'devtools/**/*.{js,ts}',
|
||||
'tools/**/*.{js,ts}',
|
||||
'modules/**/*.{js,ts}',
|
||||
'scripts/**/*.{js,ts}',
|
||||
'packages/animations/**/*.{js,ts}',
|
||||
'packages/bazel/**/*.{js,ts}',
|
||||
'packages/benchpress/**/*.{js,ts}',
|
||||
'packages/common/**/*.{js,ts}',
|
||||
'packages/docs/**/*.{js,ts}',
|
||||
'packages/elements/**/*.{js,ts}',
|
||||
'packages/examples/**/*.{js,ts}',
|
||||
'packages/misc/**/*.{js,ts}',
|
||||
'packages/private/**/*.{js,ts}',
|
||||
'packages/router/**/*.{js,ts}',
|
||||
'packages/service-worker/**/*.{js,ts}',
|
||||
'packages/upgrade/**/*.{js,ts}',
|
||||
|
||||
// Do not format d.ts files as they are generated
|
||||
'!**/*.d.ts',
|
||||
@@ -15,15 +31,50 @@ export const format: FormatConfig = {
|
||||
// not be modified.
|
||||
'!third_party/**',
|
||||
'!.yarn/**',
|
||||
],
|
||||
},
|
||||
'clang-format': {
|
||||
'matchers': [
|
||||
'**/*.{js,ts}',
|
||||
// TODO: burn down format failures and remove aio and integration exceptions.
|
||||
'!aio/**',
|
||||
'!integration/**',
|
||||
// Both third_party and .yarn are directories containing copied code which should
|
||||
// not be modified.
|
||||
'!third_party/**',
|
||||
'!.yarn/**',
|
||||
// Do not format d.ts files as they are generated
|
||||
'!**/*.d.ts',
|
||||
// Do not format generated ng-dev script
|
||||
'!dev-infra/ng-dev.js',
|
||||
'!dev-infra/build-worker.js',
|
||||
// Do not format compliance test-cases since they must match generated code
|
||||
'!packages/compiler-cli/test/compliance/test_cases/**/*.js',
|
||||
// Do not format the locale files which are checked-in for Google3, but generated using
|
||||
// the `generate-locales-tool` from `packages/common/locales`.
|
||||
'!packages/core/src/i18n/locale_en.ts',
|
||||
'!packages/common/locales/closure-locale.ts',
|
||||
'!packages/common/src/i18n/currencies.ts',
|
||||
// Test cases contain non valid code.
|
||||
'!packages/compiler-cli/test/compliance/test_cases/**/*.{js,ts}',
|
||||
// Ignore AIO as its pending removal.
|
||||
'!aio/**/*.{js,ts}',
|
||||
// Temporarily disable formatting for adev
|
||||
'!adev/**',
|
||||
|
||||
// Migrated to prettier
|
||||
'!devtools/**/*.{js,ts}',
|
||||
'!tools/**/*.{js,ts}',
|
||||
'!modules/**/*.{js,ts}',
|
||||
'!scripts/**/*.{js,ts}',
|
||||
'!packages/animations/**/*.{js,ts}',
|
||||
'!packages/bazel/**/*.{js,ts}',
|
||||
'!packages/benchpress/**/*.{js,ts}',
|
||||
'!packages/common/**/*.{js,ts}',
|
||||
'!packages/docs/**/*.{js,ts}',
|
||||
'!packages/elements/**/*.{js,ts}',
|
||||
'!packages/examples/**/*.{js,ts}',
|
||||
'!packages/misc/**/*.{js,ts}',
|
||||
'!packages/private/**/*.{js,ts}',
|
||||
'!packages/router/**/*.{js,ts}',
|
||||
'!packages/service-worker/**/*.{js,ts}',
|
||||
'!packages/upgrade/**/*.{js,ts}',
|
||||
],
|
||||
},
|
||||
'buildifier': true,
|
||||
|
||||
+3
-3
@@ -1201,7 +1201,7 @@ groups:
|
||||
'tools/gulp-tasks/**/{*,.*}',
|
||||
'tools/legacy-saucelabs/**/{*,.*}',
|
||||
'tools/manual_api_docs/**/{*,.*}',
|
||||
'tools/npm-patches/**/{*,.*}',
|
||||
'tools/npm-patches*/**/{*,.*}',
|
||||
'tools/rxjs/**/{*,.*}',
|
||||
'tools/saucelabs-daemon/**/{*,.*}',
|
||||
'tools/saucelabs/**/{*,.*}',
|
||||
@@ -1344,7 +1344,7 @@ groups:
|
||||
- atscott # Andrew Scott
|
||||
reviews:
|
||||
required: 1
|
||||
reviewed_for: optional
|
||||
reviewed_for: required
|
||||
labels:
|
||||
pending: 'requires: TGP'
|
||||
approved: 'requires: TGP'
|
||||
@@ -1376,7 +1376,7 @@ groups:
|
||||
- rahatarmanahmed # Rahat Ahmed
|
||||
reviews:
|
||||
required: 1
|
||||
reviewed_for: optional
|
||||
reviewed_for: required
|
||||
labels:
|
||||
pending: 'requires: TGP'
|
||||
approved: 'requires: TGP'
|
||||
|
||||
Vendored
+6
@@ -5,6 +5,12 @@
|
||||
// List of extensions which should be recommended for users of this workspace.
|
||||
"recommendations": [
|
||||
"BazelBuild.vscode-bazel",
|
||||
"gkalpak.aio-docs-utils",
|
||||
"ms-vscode.vscode-typescript-tslint-plugin",
|
||||
"xaver.clang-format",
|
||||
// The following extensions are useful when working on angular.io (i.e. inside the `aio/` directory).
|
||||
//"angular.ng-template",
|
||||
//"dbaeumer.vscode-eslint",
|
||||
//"errata-ai.vale-server",
|
||||
],
|
||||
}
|
||||
|
||||
Vendored
+6
@@ -1,10 +1,16 @@
|
||||
{
|
||||
// Format js and ts files on save with `clang-format.executable`
|
||||
// If `clang-format.executable` is not being used, these two settings should be removed otherwise it will break existing formatting.
|
||||
// You can instead run `yarn gulp format` to manually format your code.
|
||||
"[javascript]": {
|
||||
"editor.formatOnSave": true,
|
||||
},
|
||||
"[typescript]": {
|
||||
"editor.formatOnSave": true,
|
||||
},
|
||||
// Please install https://marketplace.visualstudio.com/items?itemName=xaver.clang-format to take advantage of `clang-format` in VSCode.
|
||||
// (See https://clang.llvm.org/docs/ClangFormat.html for more info `clang-format`.)
|
||||
"clang-format.executable": "${workspaceRoot}/node_modules/.bin/clang-format",
|
||||
// Exclude third party modules and build artifacts from the editor watchers/searches.
|
||||
"files.watcherExclude": {
|
||||
"**/.git/objects/**": true,
|
||||
|
||||
+27
-399
@@ -1,19 +1,13 @@
|
||||
<a name="18.0.0-rc.0"></a>
|
||||
# 18.0.0-rc.0 (2024-05-01)
|
||||
<a name="17.3.8"></a>
|
||||
# 17.3.8 (2024-05-08)
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [c21b459ba6](https://github.com/angular/angular/commit/c21b459ba6520fd5835e23800338ac9c997fee91) | fix | add math elements to schema ([#55631](https://github.com/angular/angular/pull/55631)) ([#55645](https://github.com/angular/angular/pull/55645)) |
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [44c0ed83a6](https://github.com/angular/angular/commit/44c0ed83a6499fa96f65a27bc5c926579c06b6d2) | fix | hide implementation details of ExperimentalPendingTasks ([#55516](https://github.com/angular/angular/pull/55516)) |
|
||||
| [a177abef1b](https://github.com/angular/angular/commit/a177abef1b0a0edc46dcca2d8c5c67669c55ff8f) | fix | render hooks should not specifically run outside the Angular zone ([#55399](https://github.com/angular/angular/pull/55399)) |
|
||||
| [a5c57c7484](https://github.com/angular/angular/commit/a5c57c7484f1dc3afab4ece4e969a4a7308cdeca) | fix | resolve error for multiple component instances that use fallback content ([#55478](https://github.com/angular/angular/pull/55478)) |
|
||||
### migrations
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [f93e5180be](https://github.com/angular/angular/commit/f93e5180be1e20a59ff68f12853653f4f3282846) | fix | resolve multiple structural issues with HttpClient migration ([#55557](https://github.com/angular/angular/pull/55557)) |
|
||||
### router
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [aefee87074](https://github.com/angular/angular/commit/aefee87074f4a5b2531f989a1876ace6e6616da4) | fix | Scroller should scroll as soon as change detection completes ([#55105](https://github.com/angular/angular/pull/55105)) |
|
||||
| [3818436ebc](https://github.com/angular/angular/commit/3818436ebc649267bb39b976b6b567b7f2b06a64) | fix | don't schedule timer triggers on the server ([#55605](https://github.com/angular/angular/pull/55605)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
@@ -34,78 +28,6 @@
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="18.0.0-next.6"></a>
|
||||
# 18.0.0-next.6 (2024-04-25)
|
||||
## Breaking Changes
|
||||
### animations
|
||||
- Deprecated `matchesElement` method has been removed from `AnimationDriver` as it is unused.
|
||||
### core
|
||||
- `async` has been removed, use `waitForAsync` instead.
|
||||
### http
|
||||
- By default we now prevent caching of HTTP requests that require authorization . To opt-out from this behaviour use the `includeRequestsWithAuthHeaders` option in `withHttpTransferCache`.
|
||||
|
||||
Example:
|
||||
```ts
|
||||
withHttpTransferCache({
|
||||
includeRequestsWithAuthHeaders: true,
|
||||
})
|
||||
```
|
||||
### platform-browser
|
||||
- Deprecated `StateKey`, `TransferState` and `makeStateKey` have been removed from `@angular/platform-browser`, use the same APIs from `@angular/core`.
|
||||
## Deprecations
|
||||
### common
|
||||
- `getCurrencySymbol`, `getLocaleCurrencyCode`, `getLocaleCurrencyName`, `getLocaleCurrencySymbol`, `getLocaleDateFormat`, `getLocaleDateTimeFormat`, `getLocaleDayNames`, `getLocaleDayPeriods`, `getLocaleDirection`, `getLocaleEraNames`, `getLocaleExtraDayPeriodRules`, `getLocaleExtraDayPeriods`, `getLocaleFirstDayOfWeek`, `getLocaleId`, `getLocaleMonthNames`, `getLocaleNumberFormat`, `getLocaleNumberSymbol`, `getLocalePluralCase`, `getLocaleTimeFormat`, `getLocaleWeekEndRange`, `getNumberOfCurrencyDigits`
|
||||
### http
|
||||
- `HttpClientModule`, `HttpClientXsrfModule` and `HttpClientJsonpModule`
|
||||
|
||||
As mentionned, those modules can be replaced by provider function only.
|
||||
### animations
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [bcce85af72](https://github.com/angular/angular/commit/bcce85af72a82634f60b31d66a5ef42ecd844ce8) | refactor | remove deprecated `matchesElement` from `AnimationDriver` ([#55479](https://github.com/angular/angular/pull/55479)) |
|
||||
### common
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [d34c033902](https://github.com/angular/angular/commit/d34c033902b4e7543796de6c57d0cfd09093eb43) | refactor | Deprecate Local Data API functions ([#54483](https://github.com/angular/angular/pull/54483)) |
|
||||
### compiler-cli
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [7a16d7e969](https://github.com/angular/angular/commit/7a16d7e969eaf5a9475ffdd21a4bf637ce523856) | fix | don't type check the bodies of control flow nodes in basic mode ([#55360](https://github.com/angular/angular/pull/55360)) |
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [a730f09ae9](https://github.com/angular/angular/commit/a730f09ae9e729da79a3e0951e15e0139ef67713) | feat | Add a public API to establish events to be replayed and an attribute to mark an element with an event handler. ([#55356](https://github.com/angular/angular/pull/55356)) |
|
||||
| [5f06ca8f55](https://github.com/angular/angular/commit/5f06ca8f5539ed208bae0b110887b5538ac4041f) | feat | add HOST_TAG_NAME token ([#54751](https://github.com/angular/angular/pull/54751)) |
|
||||
| [ac863ded48](https://github.com/angular/angular/commit/ac863ded4818af3426ef5888c706a2bd8c79c0be) | feat | provide ExperimentalPendingTasks API ([#55487](https://github.com/angular/angular/pull/55487)) |
|
||||
| [5a10f405d3](https://github.com/angular/angular/commit/5a10f405d315a28b9a000c669e9b1cb3fa24a7f1) | fix | complete the removal of deprecation `async` function ([#55491](https://github.com/angular/angular/pull/55491)) |
|
||||
| [c175bca364](https://github.com/angular/angular/commit/c175bca36432b26851adb4ea9d850c2d07fba864) | fix | DeferBlockFixture.render should not wait for stability ([#55271](https://github.com/angular/angular/pull/55271)) |
|
||||
| [9894278e71](https://github.com/angular/angular/commit/9894278e712a50079af87898a63e1d19a462d015) | fix | make `ActivatedRoute` inject correct instance inside `@defer` blocks ([#55374](https://github.com/angular/angular/pull/55374)) |
|
||||
| [5948193e13](https://github.com/angular/angular/commit/5948193e1368eec86647b4c1c0b337a387b27087) | fix | skip defer timers on the server ([#55480](https://github.com/angular/angular/pull/55480)) |
|
||||
### http
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [6f88d80758](https://github.com/angular/angular/commit/6f88d8075895bd80592b1b7e0fba8202a58a5417) | feat | allow caching requests with different origins between server and client ([#55274](https://github.com/angular/angular/pull/55274)) |
|
||||
| [8eacb6e4b9](https://github.com/angular/angular/commit/8eacb6e4b982a5aa23cfbf9078dc4e19d9466d73) | feat | exclude caching for authenticated HTTP requests ([#55034](https://github.com/angular/angular/pull/55034)) |
|
||||
| [ef665a40a5](https://github.com/angular/angular/commit/ef665a40a580ff4df79617084ac83738f28ae924) | refactor | Deprecate `HttpClientModule` & related modules ([#54020](https://github.com/angular/angular/pull/54020)) |
|
||||
### migrations
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [f914f6a362](https://github.com/angular/angular/commit/f914f6a3628847c06cbdde9c90cd417fb2f4c61f) | feat | Migration schematics for `HttpClientModule` ([#54020](https://github.com/angular/angular/pull/54020)) |
|
||||
### platform-browser
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [cba336d4f1](https://github.com/angular/angular/commit/cba336d4f1badd601b24a58fc51bde995f45682d) | refactor | remove deprecated transfer state APIs ([#55474](https://github.com/angular/angular/pull/55474)) |
|
||||
### platform-server
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [5674c644ab](https://github.com/angular/angular/commit/5674c644abf51ae8764befd3011742ff1febdf29) | fix | add `nonce` attribute to event record script ([#55495](https://github.com/angular/angular/pull/55495)) |
|
||||
### router
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [4a42961393](https://github.com/angular/angular/commit/4a42961393b3abf40f34374df059d3959dadecc0) | feat | `withNavigationErrorHandler` can convert errors to redirects ([#55370](https://github.com/angular/angular/pull/55370)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="17.3.6"></a>
|
||||
# 17.3.6 (2024-04-25)
|
||||
### core
|
||||
@@ -117,83 +39,11 @@
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="18.0.0-next.5"></a>
|
||||
# 18.0.0-next.5 (2024-04-17)
|
||||
## Breaking Changes
|
||||
### common
|
||||
- The deprecated `isPlatformWorkerUi` and `isPlatformWorkerApp` have been removed without replacement, as they serve no purpose since the removal of the WebWorker platform.
|
||||
### compiler
|
||||
- Angular only supports writable expressions inside of two-way bindings.
|
||||
### core
|
||||
- Angular will ensure change detection runs, even when the state update originates from
|
||||
outside the zone, tests may observe additional rounds of change
|
||||
detection compared to the previous behavior.
|
||||
|
||||
This change will be more likely to impact existing unit tests.
|
||||
This should usually be seen as more correct and the test should be updated,
|
||||
but in cases where it is too much effort to debug, the test can revert to the old behavior by adding
|
||||
`provideZoneChangeDetection({schedulingMode: NgZoneSchedulingMode.NgZoneOnly})`
|
||||
to the `TestBed` providers.
|
||||
|
||||
Similarly, applications which may want to update state outside the zone
|
||||
and _not_ trigger change detection can add
|
||||
`provideZoneChangeDetection({schedulingMode: NgZoneSchedulingMode.NgZoneOnly})`
|
||||
to the providers in `bootstrapApplication` or add
|
||||
`schedulingMode: NgZoneSchedulingMode.NgZoneOnly` to the
|
||||
`BootstrapOptions` of `bootstrapModule`.
|
||||
- Testability methods `increasePendingRequestCount`,
|
||||
`decreasePendingRequestCount` and `getPendingRequestCount` have been
|
||||
removed. This information is tracked with zones.
|
||||
### common
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [3b0de30b37](https://github.com/angular/angular/commit/3b0de30b37f558d4815ca9a61db1010aaf3df068) | refactor | remove deprecated `isPlatformWorkerApp` and `isPlatformWorkerUi` API ([#55302](https://github.com/angular/angular/pull/55302)) |
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [7d5bc1c628](https://github.com/angular/angular/commit/7d5bc1c62870d9c68e06eddec229a9b8988e92ee) | fix | remove container index from conditional instruction ([#55190](https://github.com/angular/angular/pull/55190)) |
|
||||
| [4eb0165750](https://github.com/angular/angular/commit/4eb0165750d8c65812502343a70ef4cc35c725b9) | fix | remove support for unassignable expressions in two-way bindings ([#55342](https://github.com/angular/angular/pull/55342)) |
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [fdd560ea14](https://github.com/angular/angular/commit/fdd560ea14f2f35608e26102c7fac0471a634b3e) | feat | Add ability to configure zone change detection to use zoneless scheduler ([#55252](https://github.com/angular/angular/pull/55252)) |
|
||||
| [bce5e2344f](https://github.com/angular/angular/commit/bce5e2344f312dc3a8a30d54e412958bd07180c1) | feat | Add build target for jsaction contract binary. ([#55319](https://github.com/angular/angular/pull/55319)) |
|
||||
| [f09c5a7bc4](https://github.com/angular/angular/commit/f09c5a7bc455a59aea133264cbf9fd9ef7509a7f) | feat | Add zoneless change detection provider as experimental ([#55329](https://github.com/angular/angular/pull/55329)) |
|
||||
| [d28614b90e](https://github.com/angular/angular/commit/d28614b90eff835639747e8961fe61e874c44666) | feat | Modify EventType from an enum to an object. ([#55323](https://github.com/angular/angular/pull/55323)) |
|
||||
| [1ee9f32621](https://github.com/angular/angular/commit/1ee9f32621f6d72e8038a08f5ad4a0cfe8bd6a13) | feat | Synchronize changes from internal JSAction codebase. ([#55182](https://github.com/angular/angular/pull/55182)) |
|
||||
| [de7447d15e](https://github.com/angular/angular/commit/de7447d15ed964ae26f0dace4cb3b08f5cccb1c1) | fix | Angular should not ignore changes that happen outside the zone ([#55102](https://github.com/angular/angular/pull/55102)) |
|
||||
| [0cec9e4f9a](https://github.com/angular/angular/commit/0cec9e4f9a90ec59f0e9838dcbd82705b1709fc0) | fix | Fix null dereference error `addEvent` ([#55353](https://github.com/angular/angular/pull/55353)) |
|
||||
| [6534c035c0](https://github.com/angular/angular/commit/6534c035c099b30987d6fd1346aea454b79cc79d) | fix | Remove deprecated Testability methods ([#53768](https://github.com/angular/angular/pull/53768)) |
|
||||
### service-worker
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [3bc63eaaf3](https://github.com/angular/angular/commit/3bc63eaaf344712ac6de1c9618d4558d9443c848) | fix | avoid running CDs on `controllerchange` ([#54222](https://github.com/angular/angular/pull/54222)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="17.3.5"></a>
|
||||
# 17.3.5 (2024-04-17)
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="18.0.0-next.4"></a>
|
||||
# 18.0.0-next.4 (2024-04-10)
|
||||
### common
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [2a6f809507](https://github.com/angular/angular/commit/2a6f80950756530d5fb1147addabcb31025b0a78) | fix | invalid ImageKit quality parameter ([#55193](https://github.com/angular/angular/pull/55193)) |
|
||||
| [11705f58a7](https://github.com/angular/angular/commit/11705f58a77e9390163b0bc99439fb4c8928e531) | fix | skip transfer cache on client ([#55012](https://github.com/angular/angular/pull/55012)) |
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [39624c6b12](https://github.com/angular/angular/commit/39624c6b129252af352c22c6d6f12ef153477bfc) | fix | output input flags as a literal ([#55215](https://github.com/angular/angular/pull/55215)) |
|
||||
### language-service
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [bd236cc150](https://github.com/angular/angular/commit/bd236cc150e1b21932612ecf91678be77a503d18) | fix | implement getDefinitionAtPosition for Angular templates ([#55269](https://github.com/angular/angular/pull/55269)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="17.3.4"></a>
|
||||
# 17.3.4 (2024-04-10)
|
||||
### common
|
||||
@@ -204,132 +54,17 @@
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="18.0.0-next.3"></a>
|
||||
# 18.0.0-next.3 (2024-04-03)
|
||||
## Breaking Changes
|
||||
### router
|
||||
- Providers available to the routed components always
|
||||
come from the injector heirarchy of the routes and never inherit from
|
||||
the `RouterOutlet`. This means that providers available only to the
|
||||
component that defines the `RouterOutlet` will no longer be available to
|
||||
route components in any circumstances. This was already the case
|
||||
whenever routes defined providers, either through lazy loading an
|
||||
`NgModule` or through explicit `providers` on the route config.
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [f824911510](https://github.com/angular/angular/commit/f8249115102204dbb957a0d292ed5342ea5108e9) | fix | For `FatalDiagnosticError`, hide the `message` field without affecting the emit ([#55160](https://github.com/angular/angular/pull/55160)) |
|
||||
### compiler-cli
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [c04ffb1fa6](https://github.com/angular/angular/commit/c04ffb1fa61f5164ee5eb7c05b7d76292042ff0b) | fix | use switch statements to narrow Angular switch blocks ([#55168](https://github.com/angular/angular/pull/55168)) |
|
||||
<a name="17.3.3"></a>
|
||||
# 17.3.3 (2024-04-03)
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [666d646575](https://github.com/angular/angular/commit/666d646575800e9326eebd513776f8e92b0357e9) | feat | Add event delegation library to queue up events and replay them when the application is ready ([#55121](https://github.com/angular/angular/pull/55121)) |
|
||||
| [146306a141](https://github.com/angular/angular/commit/146306a1417c378920d80a6d91fd847f22e407ab) | feat | add support for i18n hydration ([#54823](https://github.com/angular/angular/pull/54823)) |
|
||||
| [840c375255](https://github.com/angular/angular/commit/840c375255dc381674bb27746d9ababd14567c33) | fix | do not save point-in-time `setTimeout` and `rAF` references ([#55124](https://github.com/angular/angular/pull/55124)) |
|
||||
| [231e0a3528](https://github.com/angular/angular/commit/231e0a3528e152cb1de3a215d437f5104191445c) | fix | handle `ChainedInjector`s in injector debug utils ([#55144](https://github.com/angular/angular/pull/55144)) |
|
||||
| [a5fa279b6e](https://github.com/angular/angular/commit/a5fa279b6e9f5ab4005d6d33107f0e1bb48d05de) | fix | prevent i18n hydration from cleaning projected nodes ([#54823](https://github.com/angular/angular/pull/54823)) |
|
||||
| [f44a5e4604](https://github.com/angular/angular/commit/f44a5e460491a29e5c0cad5577bade8347d52e11) | fix | support content projection and VCRs in i18n ([#54823](https://github.com/angular/angular/pull/54823)) |
|
||||
| [914e4530b0](https://github.com/angular/angular/commit/914e4530b036eb20eb553dbb47f89183458066f4) | fix | test cleanup should not throw if Zone is not present ([#55096](https://github.com/angular/angular/pull/55096)) |
|
||||
| [a99cb7ce5b](https://github.com/angular/angular/commit/a99cb7ce5b77a125ab660da8ebef23ecb158e2e3) | fix | zoneless scheduler should check if Zone is defined before accessing it ([#55118](https://github.com/angular/angular/pull/55118)) |
|
||||
### forms
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [1c736dc3b2](https://github.com/angular/angular/commit/1c736dc3b258a502360cda40b3a00c07102ccbf5) | feat | Unified Control State Change Events ([#54579](https://github.com/angular/angular/pull/54579)) |
|
||||
### language-service
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [a48afe0d94](https://github.com/angular/angular/commit/a48afe0d9478aca314e68552f4af77f4123563cd) | fix | avoid generating TS syntactic diagnostics for templates ([#55091](https://github.com/angular/angular/pull/55091)) |
|
||||
| [158ceaf062](https://github.com/angular/angular/commit/158ceaf062036bde2a828ee769580f99433a31a8) | fix | handle `ChainedInjector`s in injector debug utils ([#55144](https://github.com/angular/angular/pull/55144)) |
|
||||
| [4d043992e5](https://github.com/angular/angular/commit/4d043992e5635a2f841b633fb38d0009a39f05d0) | fix | test cleanup should not throw if Zone is not present ([#55096](https://github.com/angular/angular/pull/55096)) |
|
||||
### migrations
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [0c20c4075a](https://github.com/angular/angular/commit/0c20c4075af753d8e5eaecb5f7114a48ced5ad96) | fix | avoid conflicts with some greek letters in control flow migration ([#55113](https://github.com/angular/angular/pull/55113)) |
|
||||
### platform-browser
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [45ae7a6b60](https://github.com/angular/angular/commit/45ae7a6b60019bd49b8a58122a0d5bcbda7e245b) | feat | add withI18nSupport() in developer preview ([#55130](https://github.com/angular/angular/pull/55130)) |
|
||||
### router
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [87f3f27f90](https://github.com/angular/angular/commit/87f3f27f9087d757e18e8e2a0f2fca6f2a2c7edf) | feat | Allow resolvers to return `RedirectCommand` ([#54556](https://github.com/angular/angular/pull/54556)) |
|
||||
| [3839cfbb18](https://github.com/angular/angular/commit/3839cfbb18fcc70cae5a6ba4ba7676b1c4acf7a0) | fix | Routed components never inherit `RouterOutlet` `EnvironmentInjector` ([#54265](https://github.com/angular/angular/pull/54265)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="18.0.0-next.2"></a>
|
||||
# 18.0.0-next.2 (2024-03-28)
|
||||
## Breaking Changes
|
||||
### compiler-cli
|
||||
- * Angular no longer supports TypeScript versions older than 5.4.
|
||||
### core
|
||||
- `ComponentFixture.whenStable` now matches the
|
||||
`ApplicationRef.isStable` observable. Prior to this change, stability
|
||||
of the fixture did not include everything that was considered in
|
||||
`ApplicationRef`. `whenStable` of the fixture will now include unfinished
|
||||
router navigations and unfinished `HttpClient` requests. This will cause
|
||||
tests that `await` the `whenStable` promise to time out when there are
|
||||
incomplete requests. To fix this, remove the `whenStable`,
|
||||
instead wait for another condition, or ensure `HttpTestingController`
|
||||
mocks responses for all requests. Try adding `HttpTestingController.verify()`
|
||||
before your `await fixture.whenStable` to identify the open requests.
|
||||
Also, make sure your tests wait for the stability promise. We found many
|
||||
examples of tests that did not, meaning the expectations did not execute
|
||||
within the test body.
|
||||
|
||||
In addition, `ComponentFixture.isStable` would synchronously switch to
|
||||
true in some scenarios but will now always be asynchronous.
|
||||
### router
|
||||
- When a a guard returns a `UrlTree` as a redirect, the
|
||||
redirecting navigation will now use `replaceUrl` if the initial
|
||||
navigation was also using the `replaceUrl` option. If this is not
|
||||
desirable, the redirect can configure new `NavigationBehaviorOptions` by
|
||||
returning a `RedirectCommand` with the desired options instead of `UrlTree`.
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [7fc7f3f05f](https://github.com/angular/angular/commit/7fc7f3f05f0139dd773032fd5ad308f8d2a9fcf5) | fix | capture all control flow branches for content projection in if blocks ([#54921](https://github.com/angular/angular/pull/54921)) |
|
||||
| [a369f43fbd](https://github.com/angular/angular/commit/a369f43fbdf45456bbae1caf71ef7becd15d1e90) | fix | capture switch block cases for content projection ([#54921](https://github.com/angular/angular/pull/54921)) |
|
||||
| [eb625d3783](https://github.com/angular/angular/commit/eb625d37839c3b9f20a2ffb3af06426f9910c8ac) | fix | declare for loop aliases in addition to new name ([#54942](https://github.com/angular/angular/pull/54942)) |
|
||||
| [bfd0bd574e](https://github.com/angular/angular/commit/bfd0bd574e9a2e1489a007393caae266512c0f04) | fix | invoke method-based tracking function with context ([#54960](https://github.com/angular/angular/pull/54960)) |
|
||||
| [e1650e3b13](https://github.com/angular/angular/commit/e1650e3b13556ab09c919cfdf97913fa0291622c) | fix | throw error if item name and context variables conflict ([#55045](https://github.com/angular/angular/pull/55045)) |
|
||||
### compiler-cli
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [5bd188a394](https://github.com/angular/angular/commit/5bd188a394d30053099e2c83fe79136d590e5399) | feat | add partial compilation support for deferred blocks ([#54908](https://github.com/angular/angular/pull/54908)) |
|
||||
| [b02b31a915](https://github.com/angular/angular/commit/b02b31a915333e680cf96de5d0f965a6e2639028) | feat | drop support for TypeScript older than 5.4 ([#54961](https://github.com/angular/angular/pull/54961)) |
|
||||
| [78188e877a](https://github.com/angular/angular/commit/78188e877a4db8655bdd3dc5012b70b12a7234de) | fix | add diagnostic if initializer API is used outside of an initializer ([#54993](https://github.com/angular/angular/pull/54993)) |
|
||||
| [694ba79cbf](https://github.com/angular/angular/commit/694ba79cbf7aaed1079b1fabf53ea446162fc933) | fix | report cases where initializer APIs are used in a non-directive class ([#54993](https://github.com/angular/angular/pull/54993)) |
|
||||
| [6219341d26](https://github.com/angular/angular/commit/6219341d267ae7689299835b90f0afa0fe61e213) | fix | report errors when initializer APIs are used on private fields ([#54981](https://github.com/angular/angular/pull/54981)) |
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [a600a39d0c](https://github.com/angular/angular/commit/a600a39d0cf9bb8fc2b6786e6f31acb78b7acc6e) | feat | add support for fallback content in ng-content ([#54854](https://github.com/angular/angular/pull/54854)) |
|
||||
| [658cf8c384](https://github.com/angular/angular/commit/658cf8c3840b637284a5bb6c9751226d24ccbf9f) | fix | `ComponentFixture` stability should match `ApplicationRef` ([#54949](https://github.com/angular/angular/pull/54949)) |
|
||||
| [2fc11eae9e](https://github.com/angular/angular/commit/2fc11eae9ea65160866bf7ba46c10520ae9a141f) | fix | account for re-projected ng-content elements with fallback content ([#54854](https://github.com/angular/angular/pull/54854)) |
|
||||
| [1c0ec56c46](https://github.com/angular/angular/commit/1c0ec56c462cf18fb38aae29858165a08b5a2a82) | fix | correctly project single-root content inside control flow ([#54921](https://github.com/angular/angular/pull/54921)) |
|
||||
| [86a359b399](https://github.com/angular/angular/commit/86a359b399456e62335a0bcfe7c7fb48b7c2b781) | fix | establish proper injector resolution order for `@defer` blocks ([#55079](https://github.com/angular/angular/pull/55079)) |
|
||||
| [e02bcf89cf](https://github.com/angular/angular/commit/e02bcf89cf77c3118c649a7db68e66a78f16155c) | fix | Fix clearing of pending task in zoneless cleanup implementation ([#55074](https://github.com/angular/angular/pull/55074)) |
|
||||
### http
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [cf73983fdc](https://github.com/angular/angular/commit/cf73983fdc5fca955fbe729b231a207fc5cd70fd) | fix | include transferCache when cloning HttpRequest ([#54939](https://github.com/angular/angular/pull/54939)) |
|
||||
| [13554f9637](https://github.com/angular/angular/commit/13554f9637c222671253e733114cfbc815c6d33d) | fix | manage different body types for caching POST requests ([#54980](https://github.com/angular/angular/pull/54980)) |
|
||||
### language-service
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [6d1b82df32](https://github.com/angular/angular/commit/6d1b82df32049cfaba2f6a50b9639b6e3b722170) | fix | allow external projects to use provided compiler options ([#55035](https://github.com/angular/angular/pull/55035)) |
|
||||
| [4166dfc1b6](https://github.com/angular/angular/commit/4166dfc1b62a83b60203bfe45a6d4aa7148a0b23) | fix | prevent underlying TS Service from handling template files ([#55003](https://github.com/angular/angular/pull/55003)) |
|
||||
### migrations
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [63688714ae](https://github.com/angular/angular/commit/63688714aeb788a24b030f9f9cdcc55e7fb0d758) | fix | account for variables in imports initializer ([#55081](https://github.com/angular/angular/pull/55081)) |
|
||||
### router
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [60f1d681e0](https://github.com/angular/angular/commit/60f1d681e0ba66d3d94b0819f2c612f095c2d3d3) | fix | preserve replaceUrl when returning a urlTree from CanActivate ([#54042](https://github.com/angular/angular/pull/54042)) |
|
||||
| [eae75ff3f9](https://github.com/angular/angular/commit/eae75ff3f9f564b919debe3f9fa41ed1b073a22c) | fix | RouterLinkActive will always remove active classes when links are not active ([#54982](https://github.com/angular/angular/pull/54982)) |
|
||||
| [949dec26b8](https://github.com/angular/angular/commit/949dec26b860a500e90874ad778da74549d21d7e) | fix | avoid conflicts with some greek letters in control flow migration ([#55113](https://github.com/angular/angular/pull/55113)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
@@ -363,55 +98,6 @@
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="18.0.0-next.1"></a>
|
||||
# 18.0.0-next.1 (2024-03-20)
|
||||
## Breaking Changes
|
||||
### platform-browser-dynamic
|
||||
- No longer used `RESOURCE_CACHE_PROVIDER` APIs have been removed.
|
||||
### platform-server
|
||||
- deprecated `platformDynamicServer` has been removed. Add an `import @angular/compiler` and replace the usage with `platformServer`
|
||||
- deprecated `ServerTransferStateModule` has been removed. `TransferState` can be use without providing this module.
|
||||
- deprecated `useAbsoluteUrl` and `baseUrl` been removed from `PlatformConfig`. Provide and absolute `url` instead.
|
||||
- Legacy handling or Node.js URL parsing has been removed from `ServerPlatformLocation`.
|
||||
|
||||
The main differences are;
|
||||
- `pathname` is always suffixed with a `/`.
|
||||
- `port` is empty when `http:` protocol and port in url is `80`
|
||||
- `port` is empty when `https:` protocol and port in url is `443`
|
||||
### router
|
||||
- This change allows `Route.redirectTo` to be a function
|
||||
in addition to the previous string. Code which expects `redirectTo` to
|
||||
only be a string on `Route` objects will need to be adjusted.
|
||||
### compiler
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [879bd80b57](https://github.com/angular/angular/commit/879bd80b571368bdc6e65c5415d98ad0f546267a) | fix | capture data bindings for content projection purposes in blocks ([#54876](https://github.com/angular/angular/pull/54876)) |
|
||||
### compiler-cli
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [6aff144232](https://github.com/angular/angular/commit/6aff14423238f8995da8104e60c0baca26df2020) | fix | symbol feature detection for the compiler ([#54711](https://github.com/angular/angular/pull/54711)) |
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [314112de99](https://github.com/angular/angular/commit/314112de99bb97475a0d8bdbddf84a3b3ce4a8fb) | fix | Prevent `markForCheck` during change detection from causing infinite loops ([#54900](https://github.com/angular/angular/pull/54900)) |
|
||||
### platform-browser-dynamic
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [eb20c1a8b1](https://github.com/angular/angular/commit/eb20c1a8b18e2e080c856e3e1bf7bcd02f3bfd28) | refactor | unused `RESOURCE_CACHE_PROVIDER` API has been removed ([#54875](https://github.com/angular/angular/pull/54875)) |
|
||||
### platform-server
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [07ac017731](https://github.com/angular/angular/commit/07ac017731f0e08ea3736f1f212093a28648a304) | refactor | remove deprecated `platformDynamicServer` API ([#54874](https://github.com/angular/angular/pull/54874)) |
|
||||
| [e8b588d8b7](https://github.com/angular/angular/commit/e8b588d8b7fc014aaef99d4b0c1e4567b4aa195d) | refactor | remove deprecated `ServerTransferStateModule` API ([#54874](https://github.com/angular/angular/pull/54874)) |
|
||||
| [3b1967ca64](https://github.com/angular/angular/commit/3b1967ca64479df9137b3ad7a0d04dbaff6496f4) | refactor | remove deprecated `useAbsoluteUrl` and `baseUrl` from `PlatformConfig` ([#54874](https://github.com/angular/angular/pull/54874)) |
|
||||
| [2357d3566c](https://github.com/angular/angular/commit/2357d3566c4d18dc40cbda6644ed459ef7703893) | refactor | remove legacy URL handling logic ([#54874](https://github.com/angular/angular/pull/54874)) |
|
||||
### router
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [2b802587f2](https://github.com/angular/angular/commit/2b802587f27186baa493c1dd01f42d568b652f38) | feat | Allow Route.redirectTo to be a function which returns a string or UrlTree ([#52606](https://github.com/angular/angular/pull/52606)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="17.3.1"></a>
|
||||
# 17.3.1 (2024-03-20)
|
||||
### compiler
|
||||
@@ -425,79 +111,6 @@
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="18.0.0-next.0"></a>
|
||||
# 18.0.0-next.0 (2024-03-14)
|
||||
## Breaking Changes
|
||||
### core
|
||||
- `OnPush` views at the root of the application need to
|
||||
be marked dirty for their host bindings to refresh. Previously, the host
|
||||
bindings were refreshed for all root views without respecting the
|
||||
`OnPush` change detection strategy.
|
||||
- The `ComponentFixture` `autoDetect` feature will no
|
||||
longer refresh the component's host view when the component is `OnPush`
|
||||
and not marked dirty. This exposes existing issues in components which
|
||||
claim to be `OnPush` but do not correctly call `markForCheck` when they
|
||||
need to be refreshed. If this change causes test failures, the easiest
|
||||
fix is to change the component to `ChangeDetectionStrategy.Default`.
|
||||
- When Angular runs change detection, it will continue to
|
||||
refresh any views attached to `ApplicationRef` that are still marked for
|
||||
check after one round completes. In rare cases, this can result in infinite
|
||||
loops when certain patterns continue to mark views for check using
|
||||
`ChangeDetectorRef.detectChanges`. This will be surfaced as a runtime
|
||||
error with the `NG0103` code.
|
||||
- The `ComponentFixture.autoDetect` feature now executes
|
||||
change detection for the fixture within `ApplicationRef.tick`. This more
|
||||
closely matches the behavior of how a component would refresh in
|
||||
production. The order of component refresh in tests may be slightly
|
||||
affected as a result, especially when dealing with additional components
|
||||
attached to the application, such as dialogs. Tests sensitive to this
|
||||
type of change (such as screenshot tests) may need to be updated.
|
||||
Concretely, this change means that the component will refresh _before_
|
||||
additional views attached to `ApplicationRef` (i.e. dialog components).
|
||||
Prior to this change, the fixture component would refresh _after_ other
|
||||
views attached to the application.
|
||||
- The exact timing of change detection execution when
|
||||
using event or run coalescing with `NgZone` is now the first of either
|
||||
`setTimeout` or `requestAnimationFrame`. Code which relies on this
|
||||
timing (usually by accident) will need to be adjusted. If a callback
|
||||
needs to execute after change detection, we recommend `afterNextRender`
|
||||
instead of something like `setTimeout`.
|
||||
- Newly created and views marked for check and reattached
|
||||
during change detection are now guaranteed to be refreshed in that same
|
||||
change detection cycle. Previously, if they were attached at a location
|
||||
in the view tree that was already checked, they would either throw
|
||||
`ExpressionChangedAfterItHasBeenCheckedError` or not be refreshed until
|
||||
some future round of change detection. In rare circumstances, this
|
||||
correction can cause issues. We identified one instance that relied on
|
||||
the previous behavior by reading a value on initialization which was
|
||||
queued to be updated in a microtask instead of being available in the
|
||||
current change detection round. The component only read this value during
|
||||
initialization and did not read it again after the microtask updated it.
|
||||
### router
|
||||
- Guards can now return `RedirectCommand` for redirects
|
||||
in addition to `UrlTree`. Code which expects only `boolean` or `UrlTree`
|
||||
values in `Route` types will need to be adjusted.
|
||||
### compiler-cli
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [9b424d7224](https://github.com/angular/angular/commit/9b424d7224db46edb16c81979c7e231d5e3db5e9) | fix | preserve original reference to non-deferrable dependency ([#54759](https://github.com/angular/angular/pull/54759)) |
|
||||
### core
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [64f870c12b](https://github.com/angular/angular/commit/64f870c12bae1ad66509f0d65f8d3e051aae6eaa) | fix | `ApplicationRef.tick` should respect OnPush for host bindings ([#53718](https://github.com/angular/angular/pull/53718)) ([#53718](https://github.com/angular/angular/pull/53718)) |
|
||||
| [8cad4e8cbe](https://github.com/angular/angular/commit/8cad4e8cbe2baf20dae7b7ef1f4253a4940cbba0) | fix | `ComponentFixture` `autoDetect` respects `OnPush` flag of host view ([#54824](https://github.com/angular/angular/pull/54824)) |
|
||||
| [ba8e465974](https://github.com/angular/angular/commit/ba8e46597435a827670f10b971b2c58f7033b180) | fix | Change Detection will continue to refresh views while marked for check ([#54734](https://github.com/angular/angular/pull/54734)) |
|
||||
| [24bc0ed4f2](https://github.com/angular/angular/commit/24bc0ed4f2de47bd998338d73cba394fb45dd497) | fix | ComponentFixture autodetect should detect changes within ApplicationRef.tick ([#54733](https://github.com/angular/angular/pull/54733)) |
|
||||
| [10c5cdb49c](https://github.com/angular/angular/commit/10c5cdb49c51c95086febd37f4d88a9b944d7e1c) | fix | ensure change detection runs in a reasonable timeframe with zone coalescing ([#54578](https://github.com/angular/angular/pull/54578)) |
|
||||
| [ad045efd4b](https://github.com/angular/angular/commit/ad045efd4b1565e01c14399998143538ebfbfd99) | fix | Ensure views marked for check are refreshed during change detection ([#54735](https://github.com/angular/angular/pull/54735)) |
|
||||
| [700c0520bb](https://github.com/angular/angular/commit/700c0520bb638952ba41a8d8260cf12afb078c0e) | fix | Update ApplicationRef.tick loop to only throw in dev mode ([#54848](https://github.com/angular/angular/pull/54848)) |
|
||||
### router
|
||||
| Commit | Type | Description |
|
||||
| -- | -- | -- |
|
||||
| [8735af08b9](https://github.com/angular/angular/commit/8735af08b976b30cf236a83f9e8b64b5ff62e9f3) | feat | Add ability to return `UrlTree` with `NavigationBehaviorOptions` from guards ([#45023](https://github.com/angular/angular/pull/45023)) |
|
||||
|
||||
<!-- CHANGELOG SPLIT MARKER -->
|
||||
|
||||
<a name="17.3.0"></a>
|
||||
# 17.3.0 (2024-03-13)
|
||||
### compiler
|
||||
@@ -1078,6 +691,21 @@ Live long and prosper 🖖🏻
|
||||
|
||||
Example after:
|
||||
|
||||
```typescript
|
||||
items.update(itemsArray => [itemsArray, …newItem]);
|
||||
```
|
||||
- The `mutate` method was removed from the `WritableSignal` interface and completely
|
||||
dropped from the public API surface. As an alternative please use the update method and
|
||||
make immutable changes to the object.
|
||||
|
||||
Example before:
|
||||
|
||||
```typescript
|
||||
items.mutate(itemsArray => itemsArray.push(newItem));
|
||||
```
|
||||
|
||||
Example after:
|
||||
|
||||
```typescript
|
||||
items.update(itemsArray => [itemsArray, …newItem]);
|
||||
```
|
||||
|
||||
+1
-1
@@ -207,7 +207,7 @@ To ensure consistency throughout the source code, keep these rules in mind as yo
|
||||
* All public API methods **must be documented**.
|
||||
* We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at **100 characters**.
|
||||
|
||||
An automated formatter is available, see [DEVELOPER.md](docs/DEVELOPER.md#formatting-your-source-code).
|
||||
An automated formatter is available, see [DEVELOPER.md](docs/DEVELOPER.md#clang-format).
|
||||
|
||||
|
||||
## <a name="commit"></a> Commit Message Format
|
||||
|
||||
@@ -63,7 +63,22 @@ Get started with Angular, learn the fundamentals and explore advanced topics on
|
||||
|
||||
### Local Development
|
||||
|
||||
To contribute to the Angular Docs, check out the [Angular.dev README](adev/README.md)
|
||||
To contribute to Angular docs, you can setup a local environment with the following commands:
|
||||
|
||||
```bash
|
||||
# Clone Angular repo
|
||||
git clone https://github.com/angular/angular.git
|
||||
|
||||
# Navigate to project directory
|
||||
cd angular
|
||||
|
||||
# Install dependencies
|
||||
yarn
|
||||
|
||||
# Build and run local dev server
|
||||
# Note: Initial build will take some time
|
||||
yarn docs
|
||||
```
|
||||
|
||||
## Development Setup
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ workspace(
|
||||
name = "angular",
|
||||
managed_directories = {
|
||||
"@npm": ["node_modules"],
|
||||
"@aio_npm": ["aio/node_modules"],
|
||||
},
|
||||
)
|
||||
|
||||
@@ -50,16 +51,16 @@ load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
|
||||
nodejs_register_toolchains(
|
||||
name = "nodejs",
|
||||
node_repositories = {
|
||||
"18.20.0-darwin_arm64": ("node-v18.20.0-darwin-arm64.tar.gz", "node-v18.20.0-darwin-arm64", "10066ad4dd9e03ea5c4c45ef8775420ff37b860de09bbdf87b97e0c07b1ea036"),
|
||||
"18.20.0-darwin_amd64": ("node-v18.20.0-darwin-x64.tar.gz", "node-v18.20.0-darwin-x64", "062ba71618e88e06321de5caa038843c350aababa2d315f3ca7b8551f8e66c1c"),
|
||||
"18.20.0-linux_arm64": ("node-v18.20.0-linux-arm64.tar.xz", "node-v18.20.0-linux-arm64", "afe51da9ffb38ac1e3a20d9a06efd403ced4bf8831ab554a02a088dd8392fd79"),
|
||||
"18.20.0-linux_ppc64le": ("node-v18.20.0-linux-ppc64le.tar.xz", "node-v18.20.0-linux-ppc64le", "9e652bbf53a3e37285b11dfb9d6a9bb8b02010c3b50e5c8229d4cc10e72681da"),
|
||||
"18.20.0-linux_s390x": ("node-v18.20.0-linux-s390x.tar.xz", "node-v18.20.0-linux-s390x", "a6c2a5796b9d9e9bf21da62ec89ff30b41a8108880b9eaa3c912f1ce795a7743"),
|
||||
"18.20.0-linux_amd64": ("node-v18.20.0-linux-x64.tar.xz", "node-v18.20.0-linux-x64", "03eea148e56785babb27930b05ed6bf311aaa3bc573c0399dd63cad2fe5713c7"),
|
||||
"18.20.0-windows_amd64": ("node-v18.20.0-win-x64.zip", "node-v18.20.0-win-x64", "1c0aab05cc6836a8f5148cca345b92ebc948a4a2013f18d117b7ade6ff05aca6"),
|
||||
"18.18.2-darwin_arm64": ("node-v18.18.2-darwin-arm64.tar.gz", "node-v18.18.2-darwin-arm64", "9f982cc91b28778dd8638e4f94563b0c2a1da7aba62beb72bd427721035ab553"),
|
||||
"18.18.2-darwin_amd64": ("node-v18.18.2-darwin-x64.tar.gz", "node-v18.18.2-darwin-x64", "5bb8da908ed590e256a69bf2862238c8a67bc4600119f2f7721ca18a7c810c0f"),
|
||||
"18.18.2-linux_arm64": ("node-v18.18.2-linux-arm64.tar.xz", "node-v18.18.2-linux-arm64", "2e630e18548627f61eaf573233da7949dc0a1df5eef3f486fa9820c5f6c121aa"),
|
||||
"18.18.2-linux_ppc64le": ("node-v18.18.2-linux-ppc64le.tar.xz", "node-v18.18.2-linux-ppc64le", "b0adff5cf5938266b711d6c724fb134d802e0dee40b3a3f73d162de1b3d11880"),
|
||||
"18.18.2-linux_s390x": ("node-v18.18.2-linux-s390x.tar.xz", "node-v18.18.2-linux-s390x", "c70ec2074b5e2b42c55bb4b8105418b67bf8a61c500d9376a07430dfcc341fdb"),
|
||||
"18.18.2-linux_amd64": ("node-v18.18.2-linux-x64.tar.xz", "node-v18.18.2-linux-x64", "75aba25ae76999309fc6c598efe56ce53fbfc221381a44a840864276264ab8ac"),
|
||||
"18.18.2-windows_amd64": ("node-v18.18.2-win-x64.zip", "node-v18.18.2-win-x64", "3bb0e51e579a41a22b3bf6cb2f3e79c03801aa17acbe0ca00fc555d1282e7acd"),
|
||||
},
|
||||
# We need at least Node 18.17 due to some transitive dependencies.
|
||||
node_version = "18.20.0",
|
||||
node_version = "18.18.2",
|
||||
)
|
||||
|
||||
# Download npm dependencies.
|
||||
@@ -75,7 +76,7 @@ yarn_install(
|
||||
"//:.yarnrc",
|
||||
"//:tools/npm-patches/@bazel+jasmine+5.8.1.patch",
|
||||
"//tools:postinstall-patches.js",
|
||||
"//tools/esm-interop:patches/npm/@angular+build-tooling+0.0.0-56d0b1f597b9e4b5d99f289f6904a220802164c1.patch",
|
||||
"//tools/esm-interop:patches/npm/@angular+build-tooling+0.0.0-e0ec7b60641d7f6369be45d8d02663fd50f320be.patch",
|
||||
"//tools/esm-interop:patches/npm/@bazel+concatjs+5.8.1.patch",
|
||||
"//tools/esm-interop:patches/npm/@bazel+esbuild+5.7.1.patch",
|
||||
"//tools/esm-interop:patches/npm/@bazel+protractor+5.7.1.patch",
|
||||
@@ -94,6 +95,30 @@ yarn_install(
|
||||
yarn_lock = "//:yarn.lock",
|
||||
)
|
||||
|
||||
yarn_install(
|
||||
name = "aio_npm",
|
||||
# Note that we add the postinstall scripts here so that the dependencies are re-installed
|
||||
# when the postinstall patches are modified.
|
||||
data = [
|
||||
YARN_LABEL,
|
||||
"//:.yarnrc",
|
||||
"//:tools/npm-patches/@bazel+jasmine+5.8.1.patch",
|
||||
"//aio:tools/cli-patches/bazel-architect-output.patch",
|
||||
"//aio:tools/cli-patches/patch.js",
|
||||
],
|
||||
# Currently disabled due to:
|
||||
# 1. Missing Windows support currently.
|
||||
# 2. Incompatibilites with the `ts_library` rule.
|
||||
exports_directories_only = False,
|
||||
manual_build_file_contents = npm_package_archives(),
|
||||
package_json = "//aio:package.json",
|
||||
# We prefer to symlink the `node_modules` to only maintain a single install.
|
||||
# See https://github.com/angular/dev-infra/pull/446#issuecomment-1059820287 for details.
|
||||
symlink_node_modules = True,
|
||||
yarn = YARN_LABEL,
|
||||
yarn_lock = "//aio:yarn.lock",
|
||||
)
|
||||
|
||||
yarn_install(
|
||||
name = "aio_example_deps",
|
||||
# Rename the default js_library target from "node_modules" as this obscures the
|
||||
@@ -167,10 +192,10 @@ cldr_xml_data_repository(
|
||||
# sass rules
|
||||
http_archive(
|
||||
name = "io_bazel_rules_sass",
|
||||
sha256 = "845061fad5cb42a353ac394fe6450ec9f21d337acf5b98011ef29ddcb33e3671",
|
||||
strip_prefix = "rules_sass-9f8be59f5175d0dd3438d7da994b2782299e0c2c",
|
||||
sha256 = "a2aeaf52f9a17b07e91c116d64bca3fd1a709addd02a390efff1b78b8f88bc13",
|
||||
strip_prefix = "rules_sass-9a4a4be9e8f208375892d27212cbbcf27685d333",
|
||||
urls = [
|
||||
"https://github.com/bazelbuild/rules_sass/archive/9f8be59f5175d0dd3438d7da994b2782299e0c2c.zip",
|
||||
"https://github.com/bazelbuild/rules_sass/archive/9a4a4be9e8f208375892d27212cbbcf27685d333.zip",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ APPLICATION_ASSETS = [
|
||||
]
|
||||
|
||||
APPLICATION_DEPS = [
|
||||
"@npm//@angular/build",
|
||||
"@npm//@angular-devkit/build-angular",
|
||||
"@npm//@angular/animations",
|
||||
"@npm//@angular/cdk",
|
||||
@@ -78,12 +77,9 @@ APPLICATION_DEPS = [
|
||||
"@npm//@lezer/highlight",
|
||||
"@npm//@lezer/javascript",
|
||||
"@npm//@lezer/common",
|
||||
"@npm//@xterm/xterm",
|
||||
"@npm//algoliasearch",
|
||||
"@npm//xterm",
|
||||
"@npm//xterm-addon-fit",
|
||||
"@npm//angular-split",
|
||||
"@npm//zone.js",
|
||||
]
|
||||
|
||||
TEST_DEPS = APPLICATION_DEPS + [
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
# [Angular.dev](https://www.angular.dev)
|
||||
|
||||
This site is built with Angular.
|
||||
|
||||
The content is written primarly in Markdown format located in `src/content`. For simple edits, you can directly edit the file on GitHub and generate a Pull Request.
|
||||
|
||||
## Local Development
|
||||
|
||||
For local development, [yarn](https://yarnpkg.com/) is the preferred package manager. You can setup a local environment with the following commands
|
||||
:
|
||||
|
||||
```bash
|
||||
# Clone Angular repo
|
||||
git clone https://github.com/angular/angular.git
|
||||
|
||||
# Navigate to project directory
|
||||
cd angular
|
||||
|
||||
# Install dependencies
|
||||
yarn
|
||||
|
||||
# Build and run local dev server
|
||||
# Note: Initial build will take some time
|
||||
yarn docs
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Want to report a bug, contribute some code, or improve the documentation? Excellent!
|
||||
|
||||
Read through our [contributing guidelines](CONTRIBUTING.md) to learn about our submission process, coding rules, and more.
|
||||
|
||||
And if you're new, check out one of our issues labeled as <kbd>[help wanted](https://github.com/angular/angular/labels/help%20wanted)</kbd> or <kbd>[good first issue](https://github.com/angular/angular/labels/good%20first%20issue)</kbd>.
|
||||
|
||||
### Code of Conduct
|
||||
|
||||
Help us keep Angular open and inclusive. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
"prefix": "adev",
|
||||
"architect": {
|
||||
"build": {
|
||||
"builder": "@angular/build:application",
|
||||
"builder": "@angular-devkit/build-angular:application",
|
||||
"options": {
|
||||
"externalDependencies": ["path"],
|
||||
"outputPath": "dist/angular-dev",
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# Generating data for `angular.dev/cli`
|
||||
|
||||
This script updates the Angular CLI help JSON files stored in `adev/src/content/cli/help`. This files are used to generate the [angular.dev CLI](https://angular.dev/cli) pages.
|
||||
@@ -1,154 +0,0 @@
|
||||
import {execSync} from 'node:child_process';
|
||||
import {readFile, writeFile, readdir, mkdtemp, realpath, copyFile, unlink} from 'node:fs/promises';
|
||||
import {tmpdir} from 'node:os';
|
||||
import {get} from 'node:https';
|
||||
import {dirname, resolve as resolvePath, posix, join} from 'node:path';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
import {existsSync, constants as fsConstants} from 'node:fs';
|
||||
|
||||
const GITHUB_API = 'https://api.github.com/repos/';
|
||||
const CLI_BUILDS_REPO = 'angular/cli-builds';
|
||||
const GITHUB_API_CLI_BUILDS = posix.join(GITHUB_API, CLI_BUILDS_REPO);
|
||||
|
||||
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||
const CLI_HELP_CONTENT_PATH = resolvePath(scriptDir, '../../src/content/cli/help');
|
||||
const CLI_SHA_PATH = join(CLI_HELP_CONTENT_PATH, 'build-info.json');
|
||||
|
||||
async function main() {
|
||||
if (!existsSync(CLI_SHA_PATH)) {
|
||||
throw new Error(`${CLI_SHA_PATH} does not exist.`);
|
||||
}
|
||||
|
||||
const branch = process.env.GITHUB_REF;
|
||||
const {sha: currentSha} = JSON.parse(await readFile(CLI_SHA_PATH, 'utf-8'));
|
||||
const latestSha = await getShaFromCliBuilds(branch);
|
||||
|
||||
console.log(`Comparing ${currentSha}...${latestSha}.`);
|
||||
const affectedFiles = await getAffectedFiles(currentSha, latestSha);
|
||||
const changedHelpFiles = affectedFiles.filter((file) => file.startsWith('help/'));
|
||||
|
||||
if (changedHelpFiles.length === 0) {
|
||||
console.log(`No 'help/**' files changed between ${currentSha} and ${latestSha}.`);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(
|
||||
`The below help files changed between ${currentSha} and ${latestSha}:\n` +
|
||||
changedHelpFiles.map((f) => '* ' + f).join('\n'),
|
||||
);
|
||||
|
||||
const temporaryDir = await realpath(await mkdtemp(join(tmpdir(), 'cli-src-')));
|
||||
const execOptions = {cwd: temporaryDir, stdio: 'inherit'};
|
||||
execSync('git init', execOptions);
|
||||
execSync('git remote add origin https://github.com/angular/cli-builds.git', execOptions);
|
||||
// fetch a commit
|
||||
execSync(`git fetch origin ${latestSha}`, execOptions);
|
||||
// reset this repository's main branch to the commit of interest
|
||||
execSync('git reset --hard FETCH_HEAD', execOptions);
|
||||
// get sha when files where changed
|
||||
const shaWhenFilesChanged = execSync(`git rev-list -1 ${latestSha} "help/"`, {
|
||||
encoding: 'utf8',
|
||||
cwd: temporaryDir,
|
||||
stdio: ['ignore', 'pipe', 'ignore'],
|
||||
}).trim();
|
||||
|
||||
// Delete existing JSON help files.
|
||||
const helpFilesUnlink = (await readdir(CLI_HELP_CONTENT_PATH))
|
||||
.filter((f) => f.endsWith('.json'))
|
||||
.map((f) => unlink(join(CLI_HELP_CONTENT_PATH, f)));
|
||||
|
||||
await Promise.allSettled(helpFilesUnlink);
|
||||
|
||||
// Copy new help files
|
||||
const tempHelpDir = join(temporaryDir, 'help');
|
||||
const helpFilesCopy = (await readdir(tempHelpDir)).map((f) => {
|
||||
const src = join(tempHelpDir, f);
|
||||
const dest = join(CLI_HELP_CONTENT_PATH, f);
|
||||
|
||||
return copyFile(src, dest, fsConstants.COPYFILE_FICLONE);
|
||||
});
|
||||
|
||||
await Promise.allSettled(helpFilesCopy);
|
||||
|
||||
// Write SHA to file.
|
||||
await writeFile(
|
||||
CLI_SHA_PATH,
|
||||
JSON.stringify(
|
||||
{
|
||||
branchName: branch,
|
||||
sha: shaWhenFilesChanged,
|
||||
},
|
||||
undefined,
|
||||
2,
|
||||
),
|
||||
);
|
||||
|
||||
console.log('\nChanges: ');
|
||||
execSync(`git status --porcelain`, {stdio: 'inherit'});
|
||||
|
||||
console.log(`Successfully updated help files in '${CLI_HELP_CONTENT_PATH}'.\n`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SHA of a branch.
|
||||
*
|
||||
* @param {string} branch
|
||||
* @param {string} headSha
|
||||
* @returns Promise<string>
|
||||
*/
|
||||
async function getShaFromCliBuilds(branch) {
|
||||
const sha = await httpGet(`${GITHUB_API_CLI_BUILDS}/commits/${branch}`, {
|
||||
headers: {Accept: 'application/vnd.github.VERSION.sha'},
|
||||
});
|
||||
|
||||
if (!sha) {
|
||||
throw new Error(`Unable to extract the SHA for '${branch}'.`);
|
||||
}
|
||||
|
||||
return sha;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the affected files.
|
||||
*
|
||||
* @param {string} baseSha
|
||||
* @param {string} headSha
|
||||
* @returns Promise<string[]>
|
||||
*/
|
||||
async function getAffectedFiles(baseSha, headSha) {
|
||||
const {files} = JSON.parse(
|
||||
await httpGet(`${GITHUB_API_CLI_BUILDS}/compare/${baseSha}...${headSha}`),
|
||||
);
|
||||
return files.map((f) => f.filename);
|
||||
}
|
||||
|
||||
function httpGet(url, options = {}) {
|
||||
options.headers ??= {};
|
||||
options.headers[
|
||||
'Authorization'
|
||||
] = `token ${process.env.ANGULAR_CLI_BUILDS_READONLY_GITHUB_TOKEN}`;
|
||||
// User agent is required
|
||||
// https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#user-agent-required
|
||||
options.headers['User-Agent'] = `AIO_Angular_CLI_Sources_Update`;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
get(url, options, (res) => {
|
||||
let data = '';
|
||||
res
|
||||
.on('data', (chunk) => {
|
||||
data += chunk;
|
||||
})
|
||||
.on('end', () => {
|
||||
resolve(data);
|
||||
});
|
||||
}).on('error', (e) => {
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -61,9 +61,6 @@
|
||||
<nav
|
||||
class="adev-nav-primary docs-scroll-hide"
|
||||
[class.adev-nav-primary--open]="isMobileNavigationOpened()"
|
||||
[class.adev-nav-primary--rc]="currentDocsVersionMode === 'rc'"
|
||||
[class.adev-nav-primary--next]="currentDocsVersionMode === 'next'"
|
||||
[class.adev-nav-primary--deprecated]="currentDocsVersionMode === 'deprecated'"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
@@ -125,6 +122,7 @@
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
<div class="adev-beta-version">Beta Docs</div>
|
||||
</a>
|
||||
|
||||
<!-- Version picker for v18+ -->
|
||||
|
||||
@@ -69,27 +69,6 @@
|
||||
padding-block-end: 2rem;
|
||||
box-sizing: border-box;
|
||||
|
||||
&.adev-nav-primary--rc {
|
||||
// change nav background to indicate this is the rc docs
|
||||
background: linear-gradient(
|
||||
140deg,
|
||||
color-mix(in srgb, var(--orange-red), transparent 60%) 0%,
|
||||
color-mix(in srgb, var(--vivid-pink), transparent 40%) 15%,
|
||||
color-mix(in srgb, var(--electric-violet), transparent 70%) 25%,
|
||||
color-mix(in srgb, var(--bright-blue), transparent 60%) 90%,
|
||||
);
|
||||
}
|
||||
|
||||
&.adev-nav-primary--next {
|
||||
// change nav background to indicate this is the rc docs
|
||||
background-color: color-mix(in srgb, var(--orange-red), transparent 60%);
|
||||
}
|
||||
|
||||
&.adev-nav-primary--deprecated {
|
||||
// change nav background to indicate this is an outdated version of the docs
|
||||
background-color: color-mix(in srgb, var(--symbolic-gray), transparent 30%);
|
||||
}
|
||||
|
||||
// div containing mobile close button and adev-nav_top
|
||||
> div {
|
||||
display: flex;
|
||||
@@ -150,6 +129,13 @@
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.adev-beta-version {
|
||||
font-family: 'Material Symbols Outlined';
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
// version dropdown button
|
||||
.adev-version-button {
|
||||
border: 1px solid var(--senary-contrast);
|
||||
|
||||
@@ -102,8 +102,6 @@ export class Navigation implements OnInit {
|
||||
openedMenu: MenuType | null = null;
|
||||
|
||||
currentDocsVersion = this.versionManager.currentDocsVersion;
|
||||
currentDocsVersionMode = this.versionManager.currentDocsVersion()?.version;
|
||||
|
||||
// Set the values of the search label and title only on the client, because the label is user-agent specific.
|
||||
searchLabel = this.isBrowser
|
||||
? isApple
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
*/
|
||||
|
||||
import {Injector} from '@angular/core';
|
||||
import {ENVIRONMENT, WINDOW, LOCAL_STORAGE} from '@angular/docs';
|
||||
import {ENVIRONMENT, WINDOW} from '@angular/docs';
|
||||
import {AnalyticsService} from './analytics.service';
|
||||
import {MockLocalStorage} from '@angular/docs/testing';
|
||||
|
||||
describe('AnalyticsService', () => {
|
||||
let service: AnalyticsService;
|
||||
@@ -19,7 +18,6 @@ describe('AnalyticsService', () => {
|
||||
let windowOnErrorHandler: (event: ErrorEvent) => void;
|
||||
|
||||
let mockWindow: any;
|
||||
let mockLocalStorage = new MockLocalStorage();
|
||||
|
||||
beforeEach(() => {
|
||||
gtagSpy = jasmine.createSpy('gtag');
|
||||
@@ -41,7 +39,6 @@ describe('AnalyticsService', () => {
|
||||
{provide: ENVIRONMENT, useValue: {}},
|
||||
{provide: AnalyticsService, deps: [WINDOW]},
|
||||
{provide: WINDOW, useFactory: () => mockWindow, deps: []},
|
||||
{provide: LOCAL_STORAGE, useValue: mockLocalStorage},
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import {inject, Injectable} from '@angular/core';
|
||||
|
||||
import {WINDOW, ENVIRONMENT, LOCAL_STORAGE, STORAGE_KEY, setCookieConsent} from '@angular/docs';
|
||||
import {WINDOW, ENVIRONMENT} from '@angular/docs';
|
||||
|
||||
import {formatErrorEventForAnalytics} from './analytics-format-error';
|
||||
|
||||
@@ -28,7 +28,6 @@ interface WindowWithAnalytics extends Window {
|
||||
export class AnalyticsService {
|
||||
private environment = inject(ENVIRONMENT);
|
||||
private window: WindowWithAnalytics = inject(WINDOW);
|
||||
private readonly localStorage = inject(LOCAL_STORAGE);
|
||||
|
||||
constructor() {
|
||||
this._installGlobalSiteTag();
|
||||
@@ -65,21 +64,6 @@ export class AnalyticsService {
|
||||
window.gtag = function () {
|
||||
window.dataLayer?.push(arguments);
|
||||
};
|
||||
|
||||
// Cookie banner consent initial state
|
||||
// This code is modified in the @angular/docs package in the cookie-popup component.
|
||||
// Docs: https://developers.google.com/tag-platform/security/guides/consent
|
||||
if (this.localStorage) {
|
||||
if (this.localStorage.getItem(STORAGE_KEY) === 'true') {
|
||||
setCookieConsent('granted');
|
||||
} else {
|
||||
setCookieConsent('denied');
|
||||
}
|
||||
} else {
|
||||
// In case localStorage is not available, we default to denying cookies.
|
||||
setCookieConsent('denied');
|
||||
}
|
||||
|
||||
window.gtag('js', new Date());
|
||||
|
||||
// Configure properties before loading the script. This is necessary to avoid
|
||||
|
||||
@@ -15,7 +15,7 @@ export interface Version {
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type VersionMode = 'stable' | 'deprecated' | 'rc' | 'next' | number;
|
||||
export type VersionMode = 'stable' | 'rc' | 'next' | number;
|
||||
|
||||
export const INITIAL_DOCS_VERSION = 17;
|
||||
export const VERSION_PATTERN_PLACEHOLDER = '{{version}}';
|
||||
@@ -61,9 +61,7 @@ export class VersionManager {
|
||||
|
||||
private getVersion(versionMode: VersionMode): string {
|
||||
if (versionMode === 'stable') {
|
||||
return 'v17';
|
||||
// Temporarily commenting out till this works correctly
|
||||
// return `v${VERSION.major}`;
|
||||
return `v${VERSION.major}`;
|
||||
}
|
||||
if (Number.isInteger(versionMode)) {
|
||||
return `v${versionMode}`;
|
||||
|
||||
@@ -115,7 +115,7 @@ The following steps are executed on project change:
|
||||
5. The previous project dependencies are compared with the new project dependencies.
|
||||
1. If there are differences, a `npm install` is triggered, hiding the preview and going to the install loading step.
|
||||
2. If there are no differences, the project is ready.
|
||||
6. Some states are reset, for example the "reveal answer" state if the previous project was in the "reveal answer" state.
|
||||
6. Some states are resetted, for example the "reveal answer" state if the previous project was in the "reveal answer" state.
|
||||
|
||||
## Components and services
|
||||
|
||||
@@ -200,7 +200,7 @@ Responsible for handling the download button in the embedded editor, fetching th
|
||||
|
||||
#### [`AlertManager`](./alert-manager.service.ts)
|
||||
|
||||
Manage the alerts displayed in the embedded editor, being the out of memory alert when multiple tabs are opened, and unsupported environments alerts.
|
||||
Manage the alerts displayed in the embedded editor, being the out of memory alert when multiple tabs are opened, and unsupported enviroments alerts.
|
||||
|
||||
#### [`TypingsLoader`](./typings-loader.service.ts)
|
||||
|
||||
|
||||
@@ -10,29 +10,7 @@
|
||||
@for (file of files(); track file) {
|
||||
<mat-tab #tab>
|
||||
<ng-template mat-tab-label>
|
||||
@if (tab.isActive && isRenamingFile()) {
|
||||
<form
|
||||
(submit)="renameFile($event, file.filename)"
|
||||
(docsClickOutside)="closeRenameFile()">
|
||||
<input
|
||||
name="rename-file"
|
||||
class="adev-rename-file-input"
|
||||
#renameFileInput
|
||||
(keydown)="$event.stopPropagation()"
|
||||
/>
|
||||
</form>
|
||||
} @else {
|
||||
{{ file.filename.replace('src/', '') }}
|
||||
}
|
||||
@if (tab.isActive && canRenameFile(file.filename)) {
|
||||
<button
|
||||
class="docs-rename-file"
|
||||
aria-label="rename file"
|
||||
(click)="onRenameButtonClick()"
|
||||
>
|
||||
<docs-icon>edit</docs-icon>
|
||||
</button>
|
||||
}
|
||||
@if (tab.isActive && canDeleteFile(file.filename)) {
|
||||
<button
|
||||
class="docs-delete-file"
|
||||
|
||||
@@ -79,8 +79,7 @@
|
||||
}
|
||||
|
||||
.adev-add-file,
|
||||
.docs-delete-file,
|
||||
.docs-rename-file {
|
||||
.docs-delete-file {
|
||||
docs-icon {
|
||||
color: var(--gray-400);
|
||||
transition: color 0.3s ease;
|
||||
@@ -93,8 +92,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.docs-delete-file,
|
||||
.docs-rename-file {
|
||||
.docs-delete-file {
|
||||
padding-inline-start: 0.1rem;
|
||||
padding-inline-end: 0;
|
||||
margin-block-start: 0.2rem;
|
||||
@@ -103,8 +101,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
.adev-new-file-input,
|
||||
.adev-rename-file-input {
|
||||
.adev-new-file-input {
|
||||
color: var(--primary-contrast);
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
|
||||
@@ -107,7 +107,7 @@ describe('CodeEditor', () => {
|
||||
const tabs = await matTabGroup.getTabs();
|
||||
const expectedLabels = files.map((file, index) => {
|
||||
const label = file.filename.replace('src/', '');
|
||||
if (index === 0) return `${label} editdelete`;
|
||||
if (index === 0) return `${label} delete`;
|
||||
return label;
|
||||
});
|
||||
|
||||
|
||||
@@ -28,13 +28,9 @@ import {EmbeddedTutorialManager} from '../embedded-tutorial-manager.service';
|
||||
import {CodeMirrorEditor} from './code-mirror-editor.service';
|
||||
import {DiagnosticWithLocation, DiagnosticsState} from './services/diagnostics-state.service';
|
||||
import {DownloadManager} from '../download-manager.service';
|
||||
import {ClickOutside, IconComponent} from '@angular/docs';
|
||||
import {IconComponent} from '@angular/docs';
|
||||
|
||||
export const REQUIRED_FILES = new Set([
|
||||
'src/main.ts',
|
||||
'src/index.html',
|
||||
'src/app/app.component.ts',
|
||||
]);
|
||||
export const REQUIRED_FILES = new Set(['src/main.ts', 'src/index.html']);
|
||||
|
||||
@Component({
|
||||
selector: 'docs-tutorial-code-editor',
|
||||
@@ -42,7 +38,7 @@ export const REQUIRED_FILES = new Set([
|
||||
templateUrl: './code-editor.component.html',
|
||||
styleUrls: ['./code-editor.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [NgIf, NgFor, MatTabsModule, IconComponent, ClickOutside],
|
||||
imports: [NgIf, NgFor, MatTabsModule, IconComponent],
|
||||
})
|
||||
export class CodeEditor implements AfterViewInit, OnDestroy {
|
||||
@ViewChild('codeEditorWrapper') private codeEditorWrapperRef!: ElementRef<HTMLDivElement>;
|
||||
@@ -58,16 +54,6 @@ export class CodeEditor implements AfterViewInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
private renameFileInputRef?: ElementRef<HTMLInputElement>;
|
||||
@ViewChild('renameFileInput') protected set setRenameFileInputRef(
|
||||
element: ElementRef<HTMLInputElement>,
|
||||
) {
|
||||
if (element) {
|
||||
element.nativeElement.focus();
|
||||
this.renameFileInputRef = element;
|
||||
}
|
||||
}
|
||||
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
private readonly codeMirrorEditor = inject(CodeMirrorEditor);
|
||||
@@ -96,7 +82,6 @@ export class CodeEditor implements AfterViewInit, OnDestroy {
|
||||
readonly errors = signal<DiagnosticWithLocation[]>([]);
|
||||
readonly files = this.codeMirrorEditor.openFiles;
|
||||
readonly isCreatingFile = signal<boolean>(false);
|
||||
readonly isRenamingFile = signal<boolean>(false);
|
||||
|
||||
ngAfterViewInit() {
|
||||
this.codeMirrorEditor.init(this.codeEditorWrapperRef.nativeElement);
|
||||
@@ -119,12 +104,6 @@ export class CodeEditor implements AfterViewInit, OnDestroy {
|
||||
this.displayErrorsBox.set(false);
|
||||
}
|
||||
|
||||
closeRenameFile(): void {
|
||||
this.isRenamingFile.set(false);
|
||||
}
|
||||
|
||||
canRenameFile = (filename: string) => this.canDeleteFile(filename);
|
||||
|
||||
canDeleteFile(filename: string) {
|
||||
return !REQUIRED_FILES.has(filename);
|
||||
}
|
||||
@@ -139,37 +118,6 @@ export class CodeEditor implements AfterViewInit, OnDestroy {
|
||||
this.matTabGroup.selectedIndex = this.files().length;
|
||||
}
|
||||
|
||||
onRenameButtonClick() {
|
||||
this.isRenamingFile.set(true);
|
||||
}
|
||||
|
||||
async renameFile(event: SubmitEvent, oldPath: string) {
|
||||
if (!this.renameFileInputRef) return;
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
const renameFileInputValue = this.renameFileInputRef.nativeElement.value;
|
||||
|
||||
if (renameFileInputValue) {
|
||||
if (renameFileInputValue.includes('..')) {
|
||||
alert('File name can not contain ".."');
|
||||
return;
|
||||
}
|
||||
|
||||
// src is hidden from users, here we manually add it to the new filename
|
||||
const newFile = 'src/' + renameFileInputValue;
|
||||
|
||||
if (this.files().find(({filename}) => filename.includes(newFile))) {
|
||||
alert('File name already exists');
|
||||
return;
|
||||
}
|
||||
|
||||
await this.codeMirrorEditor.renameFile(oldPath, newFile);
|
||||
}
|
||||
|
||||
this.isRenamingFile.set(false);
|
||||
}
|
||||
|
||||
async createFile(event: SubmitEvent) {
|
||||
if (!this.createFileInputRef) return;
|
||||
|
||||
|
||||
@@ -340,34 +340,6 @@ export class CodeMirrorEditor {
|
||||
this.changeCurrentFile(filename);
|
||||
}
|
||||
|
||||
async renameFile(oldPath: string, newPath: string) {
|
||||
const content = await this.nodeRuntimeSandbox.readFile(oldPath).catch((error) => {
|
||||
// empty content if file does not exist
|
||||
if (error.message.includes('ENOENT')) return '';
|
||||
else throw error;
|
||||
});
|
||||
|
||||
await this.nodeRuntimeSandbox.renameFile(oldPath, newPath).catch((error) => {
|
||||
throw error;
|
||||
});
|
||||
|
||||
this.embeddedTutorialManager.tutorialFiles.update((files) => {
|
||||
delete files[oldPath];
|
||||
files[newPath] = content;
|
||||
return files;
|
||||
});
|
||||
|
||||
this.embeddedTutorialManager.openFiles.update((files) => [
|
||||
...files.filter((file) => file !== oldPath),
|
||||
newPath,
|
||||
]);
|
||||
|
||||
this.setProjectFiles();
|
||||
this.updateVfsEnv();
|
||||
this.saveLibrariesTypes();
|
||||
this.changeCurrentFile(newPath);
|
||||
}
|
||||
|
||||
async deleteFile(deletedFile: string): Promise<void> {
|
||||
await this.nodeRuntimeSandbox.deleteFile(deletedFile);
|
||||
|
||||
|
||||
@@ -177,20 +177,6 @@ describe('NodeRuntimeSandbox', () => {
|
||||
expect(writeFileSpy).toHaveBeenCalledOnceWith(path, content);
|
||||
});
|
||||
|
||||
it('should call renameFile with proper parameters', async () => {
|
||||
setValuesToInitializeProject();
|
||||
|
||||
const fakeWebContainer = new FakeWebContainer();
|
||||
service['webContainerPromise'] = Promise.resolve(fakeWebContainer);
|
||||
const renameFileSpy = spyOn(fakeWebContainer.fs, 'rename');
|
||||
|
||||
const oldPath = 'oldPath';
|
||||
const newPath = 'newPath';
|
||||
|
||||
await service.renameFile(oldPath, newPath);
|
||||
expect(renameFileSpy).toHaveBeenCalledOnceWith(oldPath, newPath);
|
||||
});
|
||||
|
||||
it('should initialize the Angular CLI based on the tutorial config', async () => {
|
||||
setValuesToInitializeAngularCLI();
|
||||
|
||||
|
||||
@@ -270,16 +270,6 @@ export class NodeRuntimeSandbox {
|
||||
}
|
||||
}
|
||||
|
||||
async renameFile(oldPath: string, newPath: string): Promise<void> {
|
||||
const webContainer = await this.webContainerPromise!;
|
||||
|
||||
try {
|
||||
await webContainer.fs.rename(oldPath, newPath);
|
||||
} catch (err: any) {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
async readFile(filePath: string): Promise<string> {
|
||||
const webContainer = await this.webContainerPromise!;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import {inject} from '@angular/core';
|
||||
import {Subject} from 'rxjs';
|
||||
import {Terminal} from '@xterm/xterm';
|
||||
import {Terminal} from 'xterm';
|
||||
|
||||
import {WINDOW} from '@angular/docs';
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Terminal} from '@xterm/xterm';
|
||||
import {Terminal} from 'xterm';
|
||||
import {FitAddon} from 'xterm-addon-fit';
|
||||
import {InteractiveTerminal} from './interactive-terminal';
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<div class="adev-top-content">
|
||||
<!-- Banner(s) can be edited here! -->
|
||||
<a href="https://goo.gle/angular-dot-dev" class="adev-banner" target="_blank">
|
||||
<h1 tabindex="-1">Welcome to Angular.dev — the new home for Angular!</h1>
|
||||
<p class="adev-banner-cta">Read about our launch</p>
|
||||
<h1 tabindex="-1">Welcome to Angular.dev — the future home for Angular!</h1>
|
||||
<p class="adev-banner-cta">Read about our beta launch</p>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<header class="adev-api-items-section-header">
|
||||
<h3 [attr.id]="group.id">
|
||||
@if (group.isFeatured) {
|
||||
<docs-icon aria-hidden>star</docs-icon>
|
||||
}
|
||||
<a routerLink="/api" [fragment]="group.id" class="adev-api-anchor" tabindex="-1">{{ group.title }}</a>
|
||||
</h3>
|
||||
@if (group.isFeatured) {
|
||||
<docs-icon>star</docs-icon>
|
||||
}
|
||||
<h3>{{ group.title }}</h3>
|
||||
</header>
|
||||
|
||||
<ul class="adev-api-items-section-grid">
|
||||
|
||||
+2
-14
@@ -1,7 +1,7 @@
|
||||
@use '@angular/docs/styles/anchor' as anchor;
|
||||
|
||||
.adev-api-items-section-header {
|
||||
display: flex;
|
||||
gap: 0.75em;
|
||||
align-items: center;
|
||||
|
||||
svg {
|
||||
fill: var(--primary-contrast);
|
||||
@@ -9,11 +9,6 @@
|
||||
|
||||
h3 {
|
||||
flex: 1;
|
||||
|
||||
display: flex;
|
||||
gap: 0.75em;
|
||||
align-items: flex-start;
|
||||
|
||||
margin-top: 1.43rem;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
@@ -105,10 +100,3 @@
|
||||
padding: 0.001rem 0.2rem 0.005rem;
|
||||
margin-inline-start: 0.5rem;
|
||||
}
|
||||
|
||||
|
||||
.adev-api-anchor {
|
||||
color: inherit;
|
||||
|
||||
@include anchor.docs-anchor();
|
||||
}
|
||||
@@ -22,7 +22,6 @@ describe('ApiItemsSection', () => {
|
||||
|
||||
const fakeFeaturedGroup: ApiItemsGroup = {
|
||||
title: 'Featured',
|
||||
id: 'featured',
|
||||
isFeatured: true,
|
||||
items: [
|
||||
{
|
||||
@@ -49,7 +48,6 @@ describe('ApiItemsSection', () => {
|
||||
|
||||
const fakeGroup: ApiItemsGroup = {
|
||||
title: 'Example group',
|
||||
id: 'example',
|
||||
isFeatured: false,
|
||||
items: [
|
||||
{title: 'Fake Title', itemType: ApiItemType.CONST, url: 'api/fakeTitle', isFeatured: false},
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
|
||||
import {NgFor, NgIf} from '@angular/common';
|
||||
import {RouterLink} from '@angular/router';
|
||||
import {ApiItemsGroup} from '../interfaces/api-items-group';
|
||||
import ApiItemLabel from '../api-item-label/api-item-label.component';
|
||||
@@ -15,7 +16,7 @@ import {IconComponent} from '@angular/docs';
|
||||
@Component({
|
||||
selector: 'adev-api-items-section',
|
||||
standalone: true,
|
||||
imports: [ApiItemLabel, RouterLink, IconComponent],
|
||||
imports: [NgIf, NgFor, ApiItemLabel, RouterLink, IconComponent],
|
||||
templateUrl: './api-items-section.component.html',
|
||||
styleUrls: ['./api-items-section.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
|
||||
-4
@@ -358,10 +358,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.docs-deprecation-message {
|
||||
border-block-end: 1px solid var(--senary-contrast);
|
||||
}
|
||||
|
||||
.docs-param-group {
|
||||
margin-block-start: 1rem;
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
@for (group of filteredGroups(); track group.id) {
|
||||
@for (group of filteredGroups(); track group) {
|
||||
<adev-api-items-section [group]="group" />
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import {ApiItemType} from '../interfaces/api-item-type';
|
||||
import {ApiReferenceManager} from './api-reference-manager.service';
|
||||
import ApiItemLabel from '../api-item-label/api-item-label.component';
|
||||
import {ApiLabel} from '../pipes/api-label.pipe';
|
||||
import {ApiItemsGroup} from '../interfaces/api-items-group';
|
||||
|
||||
export const ALL_STATUSES_KEY = 'All';
|
||||
|
||||
@@ -46,12 +45,11 @@ export default class ApiReferenceList {
|
||||
type = signal(ALL_STATUSES_KEY);
|
||||
|
||||
featuredGroup = this.apiReferenceManager.featuredGroup;
|
||||
filteredGroups = computed((): ApiItemsGroup[] => {
|
||||
filteredGroups = computed(() => {
|
||||
return this.allGroups()
|
||||
.map((group) => ({
|
||||
title: group.title,
|
||||
isFeatured: group.isFeatured,
|
||||
id: group.id,
|
||||
items: group.items.filter((apiItem) => {
|
||||
return (
|
||||
(this.query()
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
import {Injectable, signal} from '@angular/core';
|
||||
// This file is generated at build-time, error is expected here.
|
||||
import API_MANIFEST_JSON from '../../../../../src/assets/api/manifest.json';
|
||||
import {ANGULAR_PACKAGE_PREFIX, getApiUrl} from '../helpers/manifest.helper';
|
||||
import {ApiItem} from '../interfaces/api-item';
|
||||
@@ -41,7 +40,6 @@ export class ApiReferenceManager {
|
||||
// Represents group of the featured items.
|
||||
featuredGroup = signal<ApiItemsGroup>({
|
||||
title: FEATURED_GROUP_TITLE,
|
||||
id: 'featured',
|
||||
items: [],
|
||||
isFeatured: true,
|
||||
});
|
||||
@@ -60,7 +58,6 @@ export class ApiReferenceManager {
|
||||
|
||||
groups.push({
|
||||
title: packageNameWithoutPrefix,
|
||||
id: packageNameWithoutPrefix.replaceAll('/', '-'),
|
||||
items: packageApis
|
||||
.map((api) => {
|
||||
const url = getApiUrl(packageNameWithoutPrefix, api.name);
|
||||
|
||||
@@ -10,7 +10,6 @@ import {ApiItem} from './api-item';
|
||||
|
||||
export interface ApiItemsGroup {
|
||||
title: string;
|
||||
id: string;
|
||||
items: ApiItem[];
|
||||
isFeatured?: boolean;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class FakeDocViewer {
|
||||
@Input('documentFilePath') documentFilePath: string | undefined;
|
||||
}
|
||||
|
||||
// TODO: export this class, it's a helpful mock we could you on other tests.
|
||||
// TODO: export this class, it's a helpfull mock we could you on other tests.
|
||||
class FakeNodeRuntimeSandbox {
|
||||
loadingStep = signal(0);
|
||||
previewUrl$ = of();
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
import {NavigationItem} from '@angular/docs';
|
||||
|
||||
// These 2 imports are expected to be red because they are generated a build time
|
||||
import FIRST_APP_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/first-app/routes.json';
|
||||
import LEARN_ANGULAR_TUTORIAL_NAV_DATA from '../../src/assets/tutorials/learn-angular/routes.json';
|
||||
|
||||
@@ -932,28 +931,7 @@ const REFERENCE_SUB_NAVIGATION_DATA: NavigationItem[] = [
|
||||
},
|
||||
{
|
||||
label: 'ng analytics',
|
||||
children: [
|
||||
{
|
||||
label: 'Overview',
|
||||
path: 'cli/analytics',
|
||||
},
|
||||
{
|
||||
label: 'disable',
|
||||
path: 'cli/analytics/disable',
|
||||
},
|
||||
{
|
||||
label: 'enable',
|
||||
path: 'cli/analytics/enable',
|
||||
},
|
||||
{
|
||||
label: 'info',
|
||||
path: 'cli/analytics/info',
|
||||
},
|
||||
{
|
||||
label: 'prompt',
|
||||
path: 'cli/analytics/prompt',
|
||||
},
|
||||
],
|
||||
path: 'cli/analytics',
|
||||
},
|
||||
{
|
||||
label: 'ng build',
|
||||
@@ -961,41 +939,11 @@ const REFERENCE_SUB_NAVIGATION_DATA: NavigationItem[] = [
|
||||
},
|
||||
{
|
||||
label: 'ng cache',
|
||||
children: [
|
||||
{
|
||||
label: 'Overview',
|
||||
path: 'cli/cache',
|
||||
},
|
||||
{
|
||||
label: 'clear',
|
||||
path: 'cli/cache/clean',
|
||||
},
|
||||
{
|
||||
label: 'disable',
|
||||
path: 'cli/cache/disable',
|
||||
},
|
||||
{
|
||||
label: 'enable',
|
||||
path: 'cli/cache/enable',
|
||||
},
|
||||
{
|
||||
label: 'info',
|
||||
path: 'cli/cache/info',
|
||||
},
|
||||
],
|
||||
path: 'cli/cache',
|
||||
},
|
||||
{
|
||||
label: 'ng completion',
|
||||
children: [
|
||||
{
|
||||
label: 'Overview',
|
||||
path: 'cli/completion',
|
||||
},
|
||||
{
|
||||
label: 'script',
|
||||
path: 'cli/completion/script',
|
||||
},
|
||||
],
|
||||
path: 'cli/completion',
|
||||
},
|
||||
{
|
||||
label: 'ng config',
|
||||
@@ -1005,6 +953,10 @@ const REFERENCE_SUB_NAVIGATION_DATA: NavigationItem[] = [
|
||||
label: 'ng deploy',
|
||||
path: 'cli/deploy',
|
||||
},
|
||||
{
|
||||
label: 'ng doc',
|
||||
path: 'cli/doc',
|
||||
},
|
||||
{
|
||||
label: 'ng e2e',
|
||||
path: 'cli/e2e',
|
||||
@@ -1015,80 +967,7 @@ const REFERENCE_SUB_NAVIGATION_DATA: NavigationItem[] = [
|
||||
},
|
||||
{
|
||||
label: 'ng generate',
|
||||
children: [
|
||||
{
|
||||
label: 'Overview',
|
||||
path: 'cli/generate',
|
||||
},
|
||||
{
|
||||
label: 'app-shell',
|
||||
path: 'cli/generate/app-shell',
|
||||
},
|
||||
{
|
||||
label: 'application',
|
||||
path: 'cli/generate/application',
|
||||
},
|
||||
{
|
||||
label: 'class',
|
||||
path: 'cli/generate/class',
|
||||
},
|
||||
{
|
||||
label: 'component',
|
||||
path: 'cli/generate/component',
|
||||
},
|
||||
{
|
||||
label: 'config',
|
||||
path: 'cli/generate/config',
|
||||
},
|
||||
{
|
||||
label: 'enum',
|
||||
path: 'cli/generate/enum',
|
||||
},
|
||||
{
|
||||
label: 'environments',
|
||||
path: 'cli/generate/environments',
|
||||
},
|
||||
{
|
||||
label: 'guard',
|
||||
path: 'cli/generate/guard',
|
||||
},
|
||||
{
|
||||
label: 'interceptor',
|
||||
path: 'cli/generate/interceptor',
|
||||
},
|
||||
{
|
||||
label: 'interface',
|
||||
path: 'cli/generate/interface',
|
||||
},
|
||||
{
|
||||
label: 'library',
|
||||
path: 'cli/generate/library',
|
||||
},
|
||||
{
|
||||
label: 'module',
|
||||
path: 'cli/generate/module',
|
||||
},
|
||||
{
|
||||
label: 'pipe',
|
||||
path: 'cli/generate/pipe',
|
||||
},
|
||||
{
|
||||
label: 'resolver',
|
||||
path: 'cli/generate/resolver',
|
||||
},
|
||||
{
|
||||
label: 'service-worker',
|
||||
path: 'cli/generate/service-worker',
|
||||
},
|
||||
{
|
||||
label: 'service',
|
||||
path: 'cli/generate/service',
|
||||
},
|
||||
{
|
||||
label: 'web-worker',
|
||||
path: 'cli/generate/web-worker',
|
||||
},
|
||||
],
|
||||
path: 'cli/generate',
|
||||
},
|
||||
{
|
||||
label: 'ng lint',
|
||||
@@ -1248,16 +1127,6 @@ const REFERENCE_SUB_NAVIGATION_DATA: NavigationItem[] = [
|
||||
path: 'errors/NG0912',
|
||||
contentPath: 'reference/errors/NG0912',
|
||||
},
|
||||
{
|
||||
label: 'NG0955: Track expression resulted in duplicated keys for a given collection',
|
||||
path: 'errors/NG0955',
|
||||
contentPath: 'reference/errors/NG0955',
|
||||
},
|
||||
{
|
||||
label: 'NG0956: Tracking expression caused re-creation of the DOM structure',
|
||||
path: 'errors/NG0956',
|
||||
contentPath: 'reference/errors/NG0956',
|
||||
},
|
||||
{
|
||||
label: 'NG1001: Argument Not Literal',
|
||||
path: 'errors/NG1001',
|
||||
|
||||
@@ -8,7 +8,6 @@ copy_to_directory(
|
||||
"//adev/src/content",
|
||||
"//adev/src/content/best-practices",
|
||||
"//adev/src/content/best-practices/runtime-performance",
|
||||
"//adev/src/content/cli/help:cli_docs",
|
||||
"//adev/src/content/ecosystem",
|
||||
"//adev/src/content/ecosystem/service-workers",
|
||||
"//adev/src/content/guide",
|
||||
@@ -39,6 +38,7 @@ copy_to_directory(
|
||||
"//adev/src/content/tutorials",
|
||||
"//adev/src/content/tutorials/first-app:first-app-guides",
|
||||
"//adev/src/content/tutorials/learn-angular:learn-angular-guides",
|
||||
"//aio/content/cli/help:cli_docs",
|
||||
"//packages/animations:animations_docs",
|
||||
"//packages/animations/browser:animations_browser_docs",
|
||||
"//packages/animations/browser/testing:animations_browser_testing_docs",
|
||||
@@ -74,7 +74,7 @@ copy_to_directory(
|
||||
"//tools/manual_api_docs/elements:elements_docs",
|
||||
],
|
||||
replace_prefixes = {
|
||||
"adev/src/content/cli/help/cli_docs_html": "cli/",
|
||||
"aio/content/cli/**/": "cli/",
|
||||
"adev/src/content": "",
|
||||
"packages/**/": "api/",
|
||||
"tools/**/": "api/",
|
||||
|
||||
@@ -76,15 +76,15 @@ The following example shows how to make a progress bar accessible by using host
|
||||
The ARIA attribute `aria-valuenow` is bound to the user's input.
|
||||
* In the template, the `aria-label` attribute ensures that the control is accessible to screen readers.
|
||||
|
||||
<docs-code-multifile>
|
||||
<docs-code-multifile
|
||||
path="adev/src/content/examples/accessibility/src/app/app.component.ts"
|
||||
preview>
|
||||
<docs-code
|
||||
path="adev/src/content/examples/accessibility/src/app/progress-bar.component.ts"
|
||||
language="ts"
|
||||
linenums
|
||||
highlight="[12, 20]"/>
|
||||
<docs-code
|
||||
path="adev/src/content/examples/accessibility/src/app/app.component.html"
|
||||
language="html"
|
||||
linenums
|
||||
highlight="[8, 9]"/>
|
||||
</docs-code-multifile>
|
||||
|
||||
@@ -19,7 +19,7 @@ For example, in the preceding screenshot, the second recorded change detection c
|
||||
Here are several techniques to remove slow computations:
|
||||
|
||||
* **Optimizing the underlying algorithm**. This is the recommended approach. If you can speed up the algorithm that is causing the problem, you can speed up the entire change detection mechanism.
|
||||
* **Caching using pure pipes**. You can move the heavy computation to a pure [pipe](guide/pipes). Angular reevaluates a pure pipe only if it detects that its inputs have changed, compared to the previous time Angular called it.
|
||||
* **Caching using pure pipes**. You can move the heavy computation to a pure [pipe](/guide/pipes). Angular reevaluates a pure pipe only if it detects that its inputs have changed, compared to the previous time Angular called it.
|
||||
* **Using memoization**. [Memoization](https://en.wikipedia.org/wiki/Memoization) is a similar technique to pure pipes, with the difference that pure pipes preserve only the last result from the computation where memoization could store multiple results.
|
||||
* **Avoid repaints/reflows in lifecycle hooks**. Certain [operations](https://web.dev/avoid-large-complex-layouts-and-layout-thrashing/) cause the browser to either synchronously recalculate the layout of the page or re-render it. Since reflows and repaints are generally slow, you want to avoid performing them in every change detection cycle.
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
filegroup(
|
||||
name = "cli",
|
||||
srcs = glob(
|
||||
["**"],
|
||||
exclude = [
|
||||
"BUILD.bazel",
|
||||
],
|
||||
) + [
|
||||
"//adev/src/content/cli/help",
|
||||
"//adev/src/content/cli/help:build-info.json",
|
||||
],
|
||||
)
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"branchName": "refs/heads/main",
|
||||
"sha": "5bcfd647fd2a4224c03514c852fd0386bce2fbad"
|
||||
}
|
||||
@@ -1,254 +0,0 @@
|
||||
{
|
||||
"name": "build",
|
||||
"command": "ng build [project]",
|
||||
"shortDescription": "Compiles an Angular application or library into an output directory named dist/ at the given output path.",
|
||||
"longDescriptionRelativePath": "@angular/cli/src/commands/build/long-description.md",
|
||||
"longDescription": "The command can be used to build a project of type \"application\" or \"library\".\nWhen used to build a library, a different builder is invoked, and only the `ts-config`, `configuration`, `poll` and `watch` options are applied.\nAll other options apply only to building applications.\n\nThe application builder uses the [esbuild](https://esbuild.github.io/) build tool, with default configuration options specified in the workspace configuration file (`angular.json`) or with a named alternative configuration.\nA \"development\" configuration is created by default when you use the CLI to create the project, and you can use that configuration by specifying the `--configuration development`.\n\nThe configuration options generally correspond to the command options.\nYou can override individual configuration defaults by specifying the corresponding options on the command line.\nThe command can accept option names given in dash-case.\nNote that in the configuration file, you must specify names in camelCase.\n\nSome additional options can only be set through the configuration file,\neither by direct editing or with the `ng config` command.\nThese include `assets`, `styles`, and `scripts` objects that provide runtime-global resources to include in the project.\nResources in CSS, such as images and fonts, are automatically written and fingerprinted at the root of the output folder.\n\nFor further details, see [Workspace Configuration](reference/configs/workspace-config).\n",
|
||||
"aliases": [
|
||||
"b"
|
||||
],
|
||||
"deprecated": false,
|
||||
"options": [
|
||||
{
|
||||
"name": "allowed-common-js-dependencies",
|
||||
"type": "array",
|
||||
"description": "A list of CommonJS or AMD packages that are allowed to be used without a build time warning. Use `'*'` to allow all."
|
||||
},
|
||||
{
|
||||
"name": "aot",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Build using Ahead of Time compilation."
|
||||
},
|
||||
{
|
||||
"name": "app-shell",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Generates an application shell during build time."
|
||||
},
|
||||
{
|
||||
"name": "base-href",
|
||||
"type": "string",
|
||||
"description": "Base url for the application being built."
|
||||
},
|
||||
{
|
||||
"name": "browser",
|
||||
"type": "string",
|
||||
"description": "The full path for the browser entry point to the application, relative to the current workspace."
|
||||
},
|
||||
{
|
||||
"name": "clear-screen",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Automatically clear the terminal screen during rebuilds."
|
||||
},
|
||||
{
|
||||
"name": "configuration",
|
||||
"type": "string",
|
||||
"aliases": [
|
||||
"c"
|
||||
],
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section in angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.dev/reference/configs/workspace-config#alternate-build-configurations."
|
||||
},
|
||||
{
|
||||
"name": "cross-origin",
|
||||
"type": "string",
|
||||
"default": "none",
|
||||
"enum": [
|
||||
"none",
|
||||
"anonymous",
|
||||
"use-credentials"
|
||||
],
|
||||
"description": "Define the crossorigin attribute setting of elements that provide CORS support."
|
||||
},
|
||||
{
|
||||
"name": "delete-output-path",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Delete the output path before building."
|
||||
},
|
||||
{
|
||||
"name": "deploy-url",
|
||||
"type": "string",
|
||||
"description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
|
||||
},
|
||||
{
|
||||
"name": "external-dependencies",
|
||||
"type": "array",
|
||||
"description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime."
|
||||
},
|
||||
{
|
||||
"name": "extract-licenses",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Extract all licenses in a separate file."
|
||||
},
|
||||
{
|
||||
"name": "help",
|
||||
"type": "boolean",
|
||||
"description": "Shows a help message for this command in the console."
|
||||
},
|
||||
{
|
||||
"name": "i18n-duplicate-translation",
|
||||
"type": "string",
|
||||
"default": "warning",
|
||||
"enum": [
|
||||
"warning",
|
||||
"error",
|
||||
"ignore"
|
||||
],
|
||||
"description": "How to handle duplicate translations for i18n."
|
||||
},
|
||||
{
|
||||
"name": "i18n-missing-translation",
|
||||
"type": "string",
|
||||
"default": "warning",
|
||||
"enum": [
|
||||
"warning",
|
||||
"error",
|
||||
"ignore"
|
||||
],
|
||||
"description": "How to handle missing translations for i18n."
|
||||
},
|
||||
{
|
||||
"name": "index",
|
||||
"type": "string",
|
||||
"description": "Configures the generation of the application's HTML index."
|
||||
},
|
||||
{
|
||||
"name": "inline-style-language",
|
||||
"type": "string",
|
||||
"default": "css",
|
||||
"enum": [
|
||||
"css",
|
||||
"less",
|
||||
"sass",
|
||||
"scss"
|
||||
],
|
||||
"description": "The stylesheet language to use for the application's inline component styles."
|
||||
},
|
||||
{
|
||||
"name": "localize",
|
||||
"type": "boolean",
|
||||
"description": "Translate the bundles in one or more locales."
|
||||
},
|
||||
{
|
||||
"name": "named-chunks",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Use file name for lazy loaded chunks."
|
||||
},
|
||||
{
|
||||
"name": "optimization",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration."
|
||||
},
|
||||
{
|
||||
"name": "output-hashing",
|
||||
"type": "string",
|
||||
"default": "none",
|
||||
"enum": [
|
||||
"none",
|
||||
"all",
|
||||
"media",
|
||||
"bundles"
|
||||
],
|
||||
"description": "Define the output filename cache-busting hashing mode."
|
||||
},
|
||||
{
|
||||
"name": "output-path",
|
||||
"type": "string",
|
||||
"description": "Specify the output path relative to workspace root."
|
||||
},
|
||||
{
|
||||
"name": "poll",
|
||||
"type": "number",
|
||||
"description": "Enable and define the file watching poll time period in milliseconds."
|
||||
},
|
||||
{
|
||||
"name": "polyfills",
|
||||
"type": "array",
|
||||
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'."
|
||||
},
|
||||
{
|
||||
"name": "prerender",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Prerender (SSG) pages of your application during build time."
|
||||
},
|
||||
{
|
||||
"name": "preserve-symlinks",
|
||||
"type": "boolean",
|
||||
"description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
|
||||
},
|
||||
{
|
||||
"name": "progress",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Log progress to the console while building."
|
||||
},
|
||||
{
|
||||
"name": "project",
|
||||
"type": "string",
|
||||
"description": "The name of the project to build. Can be an application or a library.",
|
||||
"positional": 0
|
||||
},
|
||||
{
|
||||
"name": "server",
|
||||
"type": "string",
|
||||
"description": "The full path for the server entry point to the application, relative to the current workspace."
|
||||
},
|
||||
{
|
||||
"name": "service-worker",
|
||||
"type": "string",
|
||||
"description": "Generates a service worker configuration."
|
||||
},
|
||||
{
|
||||
"name": "source-map",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration."
|
||||
},
|
||||
{
|
||||
"name": "ssr",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Server side render (SSR) pages of your application during runtime."
|
||||
},
|
||||
{
|
||||
"name": "stats-json",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Generates a 'stats.json' file which can be analyzed with https://esbuild.github.io/analyze/."
|
||||
},
|
||||
{
|
||||
"name": "subresource-integrity",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Enables the use of subresource integrity validation."
|
||||
},
|
||||
{
|
||||
"name": "ts-config",
|
||||
"type": "string",
|
||||
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
|
||||
},
|
||||
{
|
||||
"name": "verbose",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Adds more details to output logging."
|
||||
},
|
||||
{
|
||||
"name": "watch",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Run build when files change."
|
||||
},
|
||||
{
|
||||
"name": "web-worker-ts-config",
|
||||
"type": "string",
|
||||
"description": "TypeScript configuration for Web Worker modules."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
{
|
||||
"name": "cache",
|
||||
"command": "ng cache",
|
||||
"shortDescription": "Configure persistent disk cache and retrieve cache statistics.",
|
||||
"longDescriptionRelativePath": "@angular/cli/src/commands/cache/long-description.md",
|
||||
"longDescription": "Angular CLI saves a number of cachable operations on disk by default.\n\nWhen you re-run the same build, the build system restores the state of the previous build and re-uses previously performed operations, which decreases the time taken to build and test your applications and libraries.\n\nTo amend the default cache settings, add the `cli.cache` object to your [Workspace Configuration](reference/configs/workspace-config).\nThe object goes under `cli.cache` at the top level of the file, outside the `projects` sections.\n\n```jsonc\n{\n \"$schema\": \"./node_modules/@angular/cli/lib/config/schema.json\",\n \"version\": 1,\n \"cli\": {\n \"cache\": {\n // ...\n },\n },\n \"projects\": {},\n}\n```\n\nFor more information, see [cache options](reference/configs/workspace-config#cache-options).\n\n### Cache environments\n\nBy default, disk cache is only enabled for local environments. The value of environment can be one of the following:\n\n- `all` - allows disk cache on all machines.\n- `local` - allows disk cache only on development machines.\n- `ci` - allows disk cache only on continuous integration (CI) systems.\n\nTo change the environment setting to `all`, run the following command:\n\n```bash\nng config cli.cache.environment all\n```\n\nFor more information, see `environment` in [cache options](reference/configs/workspace-config#cache-options).\n\n<div class=\"alert is-helpful\">\n\nThe Angular CLI checks for the presence and value of the `CI` environment variable to determine in which environment it is running.\n\n</div>\n\n### Cache path\n\nBy default, `.angular/cache` is used as a base directory to store cache results.\n\nTo change this path to `.cache/ng`, run the following command:\n\n```bash\nng config cli.cache.path \".cache/ng\"\n```\n",
|
||||
"aliases": [],
|
||||
"deprecated": false,
|
||||
"options": [
|
||||
{
|
||||
"name": "help",
|
||||
"type": "boolean",
|
||||
"description": "Shows a help message for this command in the console."
|
||||
}
|
||||
],
|
||||
"subcommands": [
|
||||
{
|
||||
"name": "clean",
|
||||
"command": "clean",
|
||||
"shortDescription": "Deletes persistent disk cache from disk.",
|
||||
"options": [],
|
||||
"aliases": [],
|
||||
"deprecated": false
|
||||
},
|
||||
{
|
||||
"name": "disable",
|
||||
"command": "disable",
|
||||
"shortDescription": "Disables persistent disk cache for all projects in the workspace.",
|
||||
"options": [],
|
||||
"aliases": [
|
||||
"off"
|
||||
],
|
||||
"deprecated": false
|
||||
},
|
||||
{
|
||||
"name": "enable",
|
||||
"command": "enable",
|
||||
"shortDescription": "Enables disk cache for all projects in the workspace.",
|
||||
"options": [],
|
||||
"aliases": [
|
||||
"on"
|
||||
],
|
||||
"deprecated": false
|
||||
},
|
||||
{
|
||||
"name": "info",
|
||||
"command": "info",
|
||||
"shortDescription": "Prints persistent disk cache configuration and statistics in the console.",
|
||||
"options": [],
|
||||
"aliases": [],
|
||||
"deprecated": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
{
|
||||
"name": "completion",
|
||||
"command": "ng completion",
|
||||
"shortDescription": "Set up Angular CLI autocompletion for your terminal.",
|
||||
"longDescriptionRelativePath": "@angular/cli/src/commands/completion/long-description.md",
|
||||
"longDescription": "Setting up autocompletion configures your terminal, so pressing the `<TAB>` key while in the middle\nof typing will display various commands and options available to you. This makes it very easy to\ndiscover and use CLI commands without lots of memorization.\n\n\n\n## Automated setup\n\nThe CLI should prompt and ask to set up autocompletion for you the first time you use it (v14+).\nSimply answer \"Yes\" and the CLI will take care of the rest.\n\n```\n$ ng serve\n? Would you like to enable autocompletion? This will set up your terminal so pressing TAB while typing Angular CLI commands will show possible options and autocomplete arguments. (Enabling autocompletion will modify configuration files in your home directory.) Yes\nAppended `source <(ng completion script)` to `/home/my-username/.bashrc`. Restart your terminal or run:\n\nsource <(ng completion script)\n\nto autocomplete `ng` commands.\n\n# Serve output...\n```\n\nIf you already refused the prompt, it won't ask again. But you can run `ng completion` to\ndo the same thing automatically.\n\nThis modifies your terminal environment to load Angular CLI autocompletion, but can't update your\ncurrent terminal session. Either restart it or run `source <(ng completion script)` directly to\nenable autocompletion in your current session.\n\nTest it out by typing `ng ser<TAB>` and it should autocomplete to `ng serve`. Ambiguous arguments\nwill show all possible options and their documentation, such as `ng generate <TAB>`.\n\n## Manual setup\n\nSome users may have highly customized terminal setups, possibly with configuration files checked\ninto source control with an opinionated structure. `ng completion` only ever appends Angular's setup\nto an existing configuration file for your current shell, or creates one if none exists. If you want\nmore control over exactly where this configuration lives, you can manually set it up by having your\nshell run at startup:\n\n```bash\nsource <(ng completion script)\n```\n\nThis is equivalent to what `ng completion` will automatically set up, and gives power users more\nflexibility in their environments when desired.\n\n## Platform support\n\nAngular CLI supports autocompletion for the Bash and Zsh shells on MacOS and Linux operating\nsystems. On Windows, Git Bash and [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/)\nusing Bash or Zsh are supported.\n\n## Global install\n\nAutocompletion works by configuring your terminal to invoke the Angular CLI on startup to load the\nsetup script. This means the terminal must be able to find and execute the Angular CLI, typically\nthrough a global install that places the binary on the user's `$PATH`. If you get\n`command not found: ng`, make sure the CLI is installed globally which you can do with the `-g`\nflag:\n\n```bash\nnpm install -g @angular/cli\n```\n",
|
||||
"aliases": [],
|
||||
"deprecated": false,
|
||||
"options": [
|
||||
{
|
||||
"name": "help",
|
||||
"type": "boolean",
|
||||
"description": "Shows a help message for this command in the console."
|
||||
}
|
||||
],
|
||||
"subcommands": [
|
||||
{
|
||||
"name": "script",
|
||||
"command": "script",
|
||||
"shortDescription": "Generate a bash and zsh real-time type-ahead autocompletion script.",
|
||||
"options": [],
|
||||
"aliases": [],
|
||||
"deprecated": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
{
|
||||
"name": "config",
|
||||
"command": "ng config [json-path] [value]",
|
||||
"shortDescription": "Retrieves or sets Angular configuration values in the angular.json file for the workspace.",
|
||||
"longDescriptionRelativePath": "@angular/cli/src/commands/config/long-description.md",
|
||||
"longDescription": "A workspace has a single CLI configuration file, `angular.json`, at the top level.\nThe `projects` object contains a configuration object for each project in the workspace.\n\nYou can edit the configuration directly in a code editor,\nor indirectly on the command line using this command.\n\nThe configurable property names match command option names,\nexcept that in the configuration file, all names must use camelCase,\nwhile on the command line options can be given dash-case.\n\nFor further details, see [Workspace Configuration](reference/configs/workspace-config).\n\nFor configuration of CLI usage analytics, see [ng analytics](cli/analytics).\n",
|
||||
"aliases": [],
|
||||
"deprecated": false,
|
||||
"options": [
|
||||
{
|
||||
"name": "global",
|
||||
"type": "boolean",
|
||||
"aliases": [
|
||||
"g"
|
||||
],
|
||||
"default": false,
|
||||
"description": "Access the global configuration in the caller's home directory."
|
||||
},
|
||||
{
|
||||
"name": "help",
|
||||
"type": "boolean",
|
||||
"description": "Shows a help message for this command in the console."
|
||||
},
|
||||
{
|
||||
"name": "json-path",
|
||||
"type": "string",
|
||||
"description": "The configuration key to set or query, in JSON path format. For example: \"a[3].foo.bar[2]\". If no new value is provided, returns the current value of this key.",
|
||||
"positional": 0
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "string",
|
||||
"description": "If provided, a new value for the given configuration key.",
|
||||
"positional": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "deploy",
|
||||
"command": "ng deploy [project]",
|
||||
"shortDescription": "Invokes the deploy builder for a specified project or for the default project in the workspace.",
|
||||
"longDescriptionRelativePath": "@angular/cli/src/commands/deploy/long-description.md",
|
||||
"longDescription": "The command takes an optional project name, as specified in the `projects` section of the `angular.json` workspace configuration file.\nWhen a project name is not supplied, executes the `deploy` builder for the default project.\n\nTo use the `ng deploy` command, use `ng add` to add a package that implements deployment capabilities to your favorite platform.\nAdding the package automatically updates your workspace configuration, adding a deployment\n[CLI builder](tools/cli/cli-builder).\nFor example:\n\n```json\n\"projects\": {\n \"my-project\": {\n ...\n \"architect\": {\n ...\n \"deploy\": {\n \"builder\": \"@angular/fire:deploy\",\n \"options\": {}\n }\n }\n }\n}\n```\n",
|
||||
"aliases": [],
|
||||
"deprecated": false,
|
||||
"options": [
|
||||
{
|
||||
"name": "configuration",
|
||||
"type": "string",
|
||||
"aliases": [
|
||||
"c"
|
||||
],
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section in angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.dev/reference/configs/workspace-config#alternate-build-configurations."
|
||||
},
|
||||
{
|
||||
"name": "help",
|
||||
"type": "boolean",
|
||||
"description": "Shows a help message for this command in the console."
|
||||
},
|
||||
{
|
||||
"name": "project",
|
||||
"type": "string",
|
||||
"description": "The name of the project to build. Can be an application or a library.",
|
||||
"positional": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "e2e",
|
||||
"command": "ng e2e [project]",
|
||||
"shortDescription": "Builds and serves an Angular application, then runs end-to-end tests.",
|
||||
"aliases": [
|
||||
"e"
|
||||
],
|
||||
"deprecated": false,
|
||||
"options": [
|
||||
{
|
||||
"name": "configuration",
|
||||
"type": "string",
|
||||
"aliases": [
|
||||
"c"
|
||||
],
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section in angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.dev/reference/configs/workspace-config#alternate-build-configurations."
|
||||
},
|
||||
{
|
||||
"name": "help",
|
||||
"type": "boolean",
|
||||
"description": "Shows a help message for this command in the console."
|
||||
},
|
||||
{
|
||||
"name": "project",
|
||||
"type": "string",
|
||||
"description": "The name of the project to build. Can be an application or a library.",
|
||||
"positional": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
{
|
||||
"name": "extract-i18n",
|
||||
"command": "ng extract-i18n [project]",
|
||||
"shortDescription": "Extracts i18n messages from source code.",
|
||||
"aliases": [],
|
||||
"deprecated": false,
|
||||
"options": [
|
||||
{
|
||||
"name": "browser-target",
|
||||
"type": "string",
|
||||
"deprecated": "Use 'buildTarget' instead.",
|
||||
"description": "A browser builder target to extract i18n messages in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`."
|
||||
},
|
||||
{
|
||||
"name": "build-target",
|
||||
"type": "string",
|
||||
"description": "A builder target to extract i18n messages in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`."
|
||||
},
|
||||
{
|
||||
"name": "configuration",
|
||||
"type": "string",
|
||||
"aliases": [
|
||||
"c"
|
||||
],
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section in angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.dev/reference/configs/workspace-config#alternate-build-configurations."
|
||||
},
|
||||
{
|
||||
"name": "format",
|
||||
"type": "string",
|
||||
"default": "xlf",
|
||||
"enum": [
|
||||
"xmb",
|
||||
"xlf",
|
||||
"xlif",
|
||||
"xliff",
|
||||
"xlf2",
|
||||
"xliff2",
|
||||
"json",
|
||||
"arb",
|
||||
"legacy-migrate"
|
||||
],
|
||||
"description": "Output format for the generated file."
|
||||
},
|
||||
{
|
||||
"name": "help",
|
||||
"type": "boolean",
|
||||
"description": "Shows a help message for this command in the console."
|
||||
},
|
||||
{
|
||||
"name": "out-file",
|
||||
"type": "string",
|
||||
"description": "Name of the file to output."
|
||||
},
|
||||
{
|
||||
"name": "output-path",
|
||||
"type": "string",
|
||||
"description": "Path where output will be placed."
|
||||
},
|
||||
{
|
||||
"name": "progress",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Log progress to the console."
|
||||
},
|
||||
{
|
||||
"name": "project",
|
||||
"type": "string",
|
||||
"description": "The name of the project to build. Can be an application or a library.",
|
||||
"positional": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
{
|
||||
"name": "lint",
|
||||
"command": "ng lint [project]",
|
||||
"shortDescription": "Runs linting tools on Angular application code in a given project folder.",
|
||||
"longDescriptionRelativePath": "@angular/cli/src/commands/lint/long-description.md",
|
||||
"longDescription": "The command takes an optional project name, as specified in the `projects` section of the `angular.json` workspace configuration file.\nWhen a project name is not supplied, executes the `lint` builder for all projects.\n\nTo use the `ng lint` command, use `ng add` to add a package that implements linting capabilities. Adding the package automatically updates your workspace configuration, adding a lint [CLI builder](tools/cli/cli-builder).\nFor example:\n\n```json\n\"projects\": {\n \"my-project\": {\n ...\n \"architect\": {\n ...\n \"lint\": {\n \"builder\": \"@angular-eslint/builder:lint\",\n \"options\": {}\n }\n }\n }\n}\n```\n",
|
||||
"aliases": [],
|
||||
"deprecated": false,
|
||||
"options": [
|
||||
{
|
||||
"name": "configuration",
|
||||
"type": "string",
|
||||
"aliases": [
|
||||
"c"
|
||||
],
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section in angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.dev/reference/configs/workspace-config#alternate-build-configurations."
|
||||
},
|
||||
{
|
||||
"name": "help",
|
||||
"type": "boolean",
|
||||
"description": "Shows a help message for this command in the console."
|
||||
},
|
||||
{
|
||||
"name": "project",
|
||||
"type": "string",
|
||||
"description": "The name of the project to build. Can be an application or a library.",
|
||||
"positional": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,144 +0,0 @@
|
||||
{
|
||||
"name": "serve",
|
||||
"command": "ng serve [project]",
|
||||
"shortDescription": "Builds and serves your application, rebuilding on file changes.",
|
||||
"aliases": [
|
||||
"dev",
|
||||
"s"
|
||||
],
|
||||
"deprecated": false,
|
||||
"options": [
|
||||
{
|
||||
"name": "allowed-hosts",
|
||||
"type": "array",
|
||||
"description": "List of hosts that are allowed to access the dev server. This option has no effect when using the 'application' or other esbuild-based builders."
|
||||
},
|
||||
{
|
||||
"name": "browser-target",
|
||||
"type": "string",
|
||||
"deprecated": "Use 'buildTarget' instead.",
|
||||
"description": "A browser builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`."
|
||||
},
|
||||
{
|
||||
"name": "build-target",
|
||||
"type": "string",
|
||||
"description": "A build builder target to serve in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`."
|
||||
},
|
||||
{
|
||||
"name": "configuration",
|
||||
"type": "string",
|
||||
"aliases": [
|
||||
"c"
|
||||
],
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section in angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.dev/reference/configs/workspace-config#alternate-build-configurations."
|
||||
},
|
||||
{
|
||||
"name": "disable-host-check",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Don't verify connected clients are part of allowed hosts. This option has no effect when using the 'application' or other esbuild-based builders."
|
||||
},
|
||||
{
|
||||
"name": "force-esbuild",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Force the development server to use the 'browser-esbuild' builder when building. This is a developer preview option for the esbuild-based build system."
|
||||
},
|
||||
{
|
||||
"name": "help",
|
||||
"type": "boolean",
|
||||
"description": "Shows a help message for this command in the console."
|
||||
},
|
||||
{
|
||||
"name": "hmr",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Enable hot module replacement."
|
||||
},
|
||||
{
|
||||
"name": "host",
|
||||
"type": "string",
|
||||
"default": "localhost",
|
||||
"description": "Host to listen on."
|
||||
},
|
||||
{
|
||||
"name": "live-reload",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Whether to reload the page on change, using live-reload."
|
||||
},
|
||||
{
|
||||
"name": "open",
|
||||
"type": "boolean",
|
||||
"aliases": [
|
||||
"o"
|
||||
],
|
||||
"default": false,
|
||||
"description": "Opens the url in default browser."
|
||||
},
|
||||
{
|
||||
"name": "poll",
|
||||
"type": "number",
|
||||
"description": "Enable and define the file watching poll time period in milliseconds."
|
||||
},
|
||||
{
|
||||
"name": "port",
|
||||
"type": "number",
|
||||
"default": 4200,
|
||||
"description": "Port to listen on."
|
||||
},
|
||||
{
|
||||
"name": "prebundle",
|
||||
"type": "boolean",
|
||||
"description": "Enable and control the Vite-based development server's prebundling capabilities. To enable prebundling, the Angular CLI cache must also be enabled. This option has no effect when using the 'browser' or other Webpack-based builders."
|
||||
},
|
||||
{
|
||||
"name": "project",
|
||||
"type": "string",
|
||||
"description": "The name of the project to build. Can be an application or a library.",
|
||||
"positional": 0
|
||||
},
|
||||
{
|
||||
"name": "proxy-config",
|
||||
"type": "string",
|
||||
"description": "Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server."
|
||||
},
|
||||
{
|
||||
"name": "public-host",
|
||||
"type": "string",
|
||||
"description": "The URL that the browser client (or live-reload client, if enabled) should use to connect to the development server. Use for a complex dev server setup, such as one with reverse proxies. This option has no effect when using the 'application' or other esbuild-based builders."
|
||||
},
|
||||
{
|
||||
"name": "serve-path",
|
||||
"type": "string",
|
||||
"description": "The pathname where the application will be served."
|
||||
},
|
||||
{
|
||||
"name": "ssl",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Serve using HTTPS."
|
||||
},
|
||||
{
|
||||
"name": "ssl-cert",
|
||||
"type": "string",
|
||||
"description": "SSL certificate to use for serving HTTPS."
|
||||
},
|
||||
{
|
||||
"name": "ssl-key",
|
||||
"type": "string",
|
||||
"description": "SSL key to use for serving HTTPS."
|
||||
},
|
||||
{
|
||||
"name": "verbose",
|
||||
"type": "boolean",
|
||||
"description": "Adds more details to output logging."
|
||||
},
|
||||
{
|
||||
"name": "watch",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Rebuild on change."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,127 +0,0 @@
|
||||
{
|
||||
"name": "test",
|
||||
"command": "ng test [project]",
|
||||
"shortDescription": "Runs unit tests in a project.",
|
||||
"longDescriptionRelativePath": "@angular/cli/src/commands/test/long-description.md",
|
||||
"longDescription": "Takes the name of the project, as specified in the `projects` section of the `angular.json` workspace configuration file.\nWhen a project name is not supplied, it will execute for all projects.\n",
|
||||
"aliases": [
|
||||
"t"
|
||||
],
|
||||
"deprecated": false,
|
||||
"options": [
|
||||
{
|
||||
"name": "browsers",
|
||||
"type": "string",
|
||||
"description": "Override which browsers tests are run against. Set to `false` to not use any browser."
|
||||
},
|
||||
{
|
||||
"name": "code-coverage",
|
||||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "Output a code coverage report."
|
||||
},
|
||||
{
|
||||
"name": "code-coverage-exclude",
|
||||
"type": "array",
|
||||
"description": "Globs to exclude from code coverage."
|
||||
},
|
||||
{
|
||||
"name": "configuration",
|
||||
"type": "string",
|
||||
"aliases": [
|
||||
"c"
|
||||
],
|
||||
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section in angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.dev/reference/configs/workspace-config#alternate-build-configurations."
|
||||
},
|
||||
{
|
||||
"name": "exclude",
|
||||
"type": "array",
|
||||
"description": "Globs of files to exclude, relative to the project root."
|
||||
},
|
||||
{
|
||||
"name": "help",
|
||||
"type": "boolean",
|
||||
"description": "Shows a help message for this command in the console."
|
||||
},
|
||||
{
|
||||
"name": "include",
|
||||
"type": "array",
|
||||
"description": "Globs of files to include, relative to project root. \nThere are 2 special cases:\n - when a path to directory is provided, all spec files ending \".spec.@(ts|tsx)\" will be included\n - when a path to a file is provided, and a matching spec file exists it will be included instead."
|
||||
},
|
||||
{
|
||||
"name": "inline-style-language",
|
||||
"type": "string",
|
||||
"default": "css",
|
||||
"enum": [
|
||||
"css",
|
||||
"less",
|
||||
"sass",
|
||||
"scss"
|
||||
],
|
||||
"description": "The stylesheet language to use for the application's inline component styles."
|
||||
},
|
||||
{
|
||||
"name": "karma-config",
|
||||
"type": "string",
|
||||
"description": "The name of the Karma configuration file."
|
||||
},
|
||||
{
|
||||
"name": "main",
|
||||
"type": "string",
|
||||
"description": "The name of the main entry-point file."
|
||||
},
|
||||
{
|
||||
"name": "poll",
|
||||
"type": "number",
|
||||
"description": "Enable and define the file watching poll time period in milliseconds."
|
||||
},
|
||||
{
|
||||
"name": "polyfills",
|
||||
"type": "string",
|
||||
"description": "Polyfills to be included in the build."
|
||||
},
|
||||
{
|
||||
"name": "preserve-symlinks",
|
||||
"type": "boolean",
|
||||
"description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
|
||||
},
|
||||
{
|
||||
"name": "progress",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Log progress to the console while building."
|
||||
},
|
||||
{
|
||||
"name": "project",
|
||||
"type": "string",
|
||||
"description": "The name of the project to build. Can be an application or a library.",
|
||||
"positional": 0
|
||||
},
|
||||
{
|
||||
"name": "reporters",
|
||||
"type": "array",
|
||||
"description": "Karma reporters to use. Directly passed to the karma runner."
|
||||
},
|
||||
{
|
||||
"name": "source-map",
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration."
|
||||
},
|
||||
{
|
||||
"name": "ts-config",
|
||||
"type": "string",
|
||||
"description": "The name of the TypeScript configuration file."
|
||||
},
|
||||
{
|
||||
"name": "watch",
|
||||
"type": "boolean",
|
||||
"description": "Run build when files change."
|
||||
},
|
||||
{
|
||||
"name": "web-worker-ts-config",
|
||||
"type": "string",
|
||||
"description": "TypeScript configuration for Web Worker modules."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
load("//aio/content/examples:examples.bzl", "docs_example")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
docs_example(
|
||||
name = "architecture",
|
||||
)
|
||||
@@ -0,0 +1,94 @@
|
||||
import {protractor, browser, element, by, ElementFinder} from 'protractor';
|
||||
|
||||
const nameSuffix = 'X';
|
||||
|
||||
interface Hero {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
describe('Architecture', () => {
|
||||
const expectedTitle = 'Architecture of Angular';
|
||||
const expectedH2 = ['Hero List', 'Sales Tax Calculator'];
|
||||
|
||||
beforeAll(() => browser.get(''));
|
||||
|
||||
it(`has title '${expectedTitle}'`, async () => {
|
||||
expect(await browser.getTitle()).toEqual(expectedTitle);
|
||||
});
|
||||
|
||||
it(`has h2 '${expectedH2}'`, async () => {
|
||||
const h2 = await element.all(by.css('h2')).map((elt: any) => elt.getText());
|
||||
expect(h2).toEqual(expectedH2);
|
||||
});
|
||||
|
||||
describe('Hero', heroTests);
|
||||
describe('Salex tax', salesTaxTests);
|
||||
});
|
||||
|
||||
function heroTests() {
|
||||
const targetHero: Hero = {id: 2, name: 'Dr Nice'};
|
||||
|
||||
it('has the right number of heroes', async () => {
|
||||
const page = getPageElts();
|
||||
expect(await page.heroes.count()).toEqual(3);
|
||||
});
|
||||
|
||||
it('has no hero details initially', async () => {
|
||||
const page = getPageElts();
|
||||
expect(await page.heroDetail.isPresent()).toBeFalsy('no hero detail');
|
||||
});
|
||||
|
||||
it('shows selected hero details', async () => {
|
||||
await element(by.cssContainingText('li', targetHero.name)).click();
|
||||
const page = getPageElts();
|
||||
const hero = await heroFromDetail(page.heroDetail);
|
||||
expect(hero.id).toEqual(targetHero.id);
|
||||
expect(hero.name).toEqual(targetHero.name);
|
||||
});
|
||||
|
||||
it(`shows updated hero name in details`, async () => {
|
||||
const input = element.all(by.css('input')).first();
|
||||
await input.sendKeys(nameSuffix);
|
||||
const page = getPageElts();
|
||||
const hero = await heroFromDetail(page.heroDetail);
|
||||
const newName = targetHero.name + nameSuffix;
|
||||
expect(hero.id).toEqual(targetHero.id);
|
||||
expect(hero.name).toEqual(newName);
|
||||
});
|
||||
}
|
||||
|
||||
function salesTaxTests() {
|
||||
it('has no sales tax initially', async () => {
|
||||
const page = getPageElts();
|
||||
expect(await page.salesTaxDetail.isPresent()).toBeFalsy('no sales tax info');
|
||||
});
|
||||
|
||||
it('shows sales tax', async () => {
|
||||
const page = getPageElts();
|
||||
await page.salesTaxAmountInput.sendKeys('10', protractor.Key.ENTER);
|
||||
expect(await page.salesTaxDetail.getText()).toEqual('The sales tax is $1.00');
|
||||
});
|
||||
}
|
||||
|
||||
// Helper functions
|
||||
|
||||
function getPageElts() {
|
||||
return {
|
||||
heroes: element.all(by.css('app-root li')),
|
||||
heroDetail: element(by.css('app-root app-hero-detail')),
|
||||
salesTaxAmountInput: element(by.css('app-root app-sales-tax input')),
|
||||
salesTaxDetail: element(by.css('app-root app-sales-tax div')),
|
||||
};
|
||||
}
|
||||
|
||||
async function heroFromDetail(detail: ElementFinder): Promise<Hero> {
|
||||
// Get hero id from the first <div>
|
||||
const id = await detail.all(by.css('div')).first().getText();
|
||||
// Get name from the h2
|
||||
const name = await detail.element(by.css('app-hero-detail h2')).getText();
|
||||
return {
|
||||
id: +id.slice(id.indexOf(' ') + 1),
|
||||
name: name.substring(0, name.lastIndexOf(' ')),
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// #docregion import
|
||||
import {Component} from '@angular/core';
|
||||
// #enddocregion import
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
template: `
|
||||
<h1>Architecture Example</h1>
|
||||
<app-hero-list></app-hero-list>
|
||||
<app-sales-tax></app-sales-tax>
|
||||
`,
|
||||
})
|
||||
export class AppComponent {}
|
||||
@@ -0,0 +1,22 @@
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
// #docregion imports
|
||||
import {NgModule} from '@angular/core';
|
||||
import {AppComponent} from './app.component';
|
||||
// #enddocregion imports
|
||||
import {HeroDetailComponent} from './hero-detail.component';
|
||||
import {HeroListComponent} from './hero-list.component';
|
||||
import {SalesTaxComponent} from './sales-tax.component';
|
||||
import {HeroService} from './hero.service';
|
||||
import {BackendService} from './backend.service';
|
||||
import {Logger} from './logger.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [BrowserModule, FormsModule],
|
||||
declarations: [AppComponent, HeroDetailComponent, HeroListComponent, SalesTaxComponent],
|
||||
providers: [BackendService, HeroService, Logger],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
// #docregion export
|
||||
export class AppModule {}
|
||||
// #enddocregion export
|
||||
@@ -0,0 +1,25 @@
|
||||
import {Injectable, Type} from '@angular/core';
|
||||
|
||||
import {Logger} from './logger.service';
|
||||
import {Hero} from './hero';
|
||||
|
||||
const HEROES = [
|
||||
new Hero('Windstorm', 'Weather mastery'),
|
||||
new Hero('Dr Nice', 'Killing them with kindness'),
|
||||
new Hero('Magneta', 'Manipulates metallic objects'),
|
||||
];
|
||||
|
||||
@Injectable()
|
||||
export class BackendService {
|
||||
constructor(private logger: Logger) {}
|
||||
|
||||
getAll(type: Type<any>): PromiseLike<any[]> {
|
||||
if (type === Hero) {
|
||||
// TODO: get from the database
|
||||
return Promise.resolve<Hero[]>(HEROES);
|
||||
}
|
||||
const err = new Error('Cannot get object of this type');
|
||||
this.logger.error(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<hr>
|
||||
<h2>{{ hero.name }} Detail</h2>
|
||||
<div>Id: {{ hero.id }}</div>
|
||||
<label for="hero-name">Name: </label>
|
||||
<!-- #docregion ngModel -->
|
||||
<input type="text" id="hero-name" [(ngModel)]="hero.name">
|
||||
<!-- #enddocregion ngModel -->
|
||||
|
||||
<label for="hero-power">Power: </label>
|
||||
<input type="text" for="hero-name" [(ngModel)]="hero.power">
|
||||
@@ -0,0 +1,11 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
|
||||
import {Hero} from './hero';
|
||||
|
||||
@Component({
|
||||
selector: 'app-hero-detail',
|
||||
templateUrl: './hero-detail.component.html',
|
||||
})
|
||||
export class HeroDetailComponent {
|
||||
@Input() hero!: Hero;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<!--#docregion binding -->
|
||||
<app-hero-detail [hero]="selectedHero"></app-hero-detail>
|
||||
<button type="button" (click)="selectHero(hero)">
|
||||
{{ hero.name }}
|
||||
</button>
|
||||
<!--#enddocregion binding -->
|
||||
|
||||
<!--#docregion structural -->
|
||||
<li *ngFor="let hero of heroes"></li>
|
||||
<app-hero-detail *ngIf="selectedHero"></app-hero-detail>
|
||||
@@ -0,0 +1,13 @@
|
||||
<!-- #docregion -->
|
||||
<h2>Hero List</h2>
|
||||
|
||||
<p><em>Select a hero from the list to see details.</em></p>
|
||||
<ul>
|
||||
<li *ngFor="let hero of heroes">
|
||||
<button type="button" (click)="selectHero(hero)">
|
||||
{{ hero.name }}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<app-hero-detail *ngIf="selectedHero" [hero]="selectedHero"></app-hero-detail>
|
||||
@@ -0,0 +1,31 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
|
||||
import {Hero} from './hero';
|
||||
import {HeroService} from './hero.service';
|
||||
|
||||
// #docregion metadata, providers
|
||||
@Component({
|
||||
selector: 'app-hero-list',
|
||||
templateUrl: './hero-list.component.html',
|
||||
providers: [HeroService],
|
||||
})
|
||||
// #enddocregion providers
|
||||
// #docregion class
|
||||
export class HeroListComponent implements OnInit {
|
||||
// #enddocregion metadata
|
||||
heroes: Hero[] = [];
|
||||
selectedHero: Hero | undefined;
|
||||
|
||||
// #docregion ctor
|
||||
constructor(private service: HeroService) {}
|
||||
// #enddocregion ctor
|
||||
|
||||
ngOnInit() {
|
||||
this.heroes = this.service.getHeroes();
|
||||
}
|
||||
|
||||
selectHero(hero: Hero) {
|
||||
this.selectedHero = hero;
|
||||
}
|
||||
// #docregion metadata
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
|
||||
import {Hero} from './hero';
|
||||
import {BackendService} from './backend.service';
|
||||
import {Logger} from './logger.service';
|
||||
|
||||
@Injectable()
|
||||
// #docregion class
|
||||
export class HeroService {
|
||||
private heroes: Hero[] = [];
|
||||
|
||||
constructor(
|
||||
private backend: BackendService,
|
||||
private logger: Logger,
|
||||
) {}
|
||||
|
||||
getHeroes() {
|
||||
this.backend.getAll(Hero).then((heroes: Hero[]) => {
|
||||
this.logger.log(`Fetched ${heroes.length} heroes.`);
|
||||
this.heroes.push(...heroes); // fill cache
|
||||
});
|
||||
return this.heroes;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
let nextId = 1;
|
||||
|
||||
export class Hero {
|
||||
id: number;
|
||||
constructor(
|
||||
public name: string,
|
||||
public power?: string,
|
||||
) {
|
||||
this.id = nextId++;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
// #docregion class
|
||||
export class Logger {
|
||||
log(msg: any) {
|
||||
console.log(msg);
|
||||
}
|
||||
error(msg: any) {
|
||||
console.error(msg);
|
||||
}
|
||||
warn(msg: any) {
|
||||
console.warn(msg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// #docplaster
|
||||
// A mini-application
|
||||
import {Injectable} from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
export class Logger {
|
||||
log(message: string) {
|
||||
console.log(message);
|
||||
}
|
||||
}
|
||||
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
template: 'Welcome to Angular',
|
||||
})
|
||||
export class AppComponent {
|
||||
constructor(logger: Logger) {
|
||||
logger.log('Let the fun begin!');
|
||||
}
|
||||
}
|
||||
|
||||
// #docregion module
|
||||
import {NgModule} from '@angular/core';
|
||||
// #docregion import-browser-module
|
||||
import {BrowserModule} from '@angular/platform-browser';
|
||||
// #enddocregion import-browser-module
|
||||
@NgModule({
|
||||
// #docregion ngmodule-imports
|
||||
imports: [BrowserModule],
|
||||
// #enddocregion ngmodule-imports
|
||||
providers: [Logger],
|
||||
declarations: [AppComponent],
|
||||
exports: [AppComponent],
|
||||
bootstrap: [AppComponent],
|
||||
})
|
||||
export class AppModule {}
|
||||
// #enddocregion module
|
||||
|
||||
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
||||
@@ -0,0 +1,26 @@
|
||||
import {Component} from '@angular/core';
|
||||
|
||||
import {SalesTaxService} from './sales-tax.service';
|
||||
import {TaxRateService} from './tax-rate.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-sales-tax',
|
||||
template: `
|
||||
<h2>Sales Tax Calculator</h2>
|
||||
<p><em>Enter a number and press enter to calculate tax.</em></p>
|
||||
<label for="amount-input">Amount: </label>
|
||||
<input type="text" id="amount-input" #amountBox (change)="0">
|
||||
<div *ngIf="amountBox.value">
|
||||
<p>The sales tax is
|
||||
{{ getTax(amountBox.value) | currency:'USD':true:'1.2-2' }}</p>
|
||||
</div>
|
||||
`,
|
||||
providers: [SalesTaxService, TaxRateService],
|
||||
})
|
||||
export class SalesTaxComponent {
|
||||
constructor(private salesTaxService: SalesTaxService) {}
|
||||
|
||||
getTax(value: string | number) {
|
||||
return this.salesTaxService.getVAT(value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
|
||||
import {TaxRateService} from './tax-rate.service';
|
||||
|
||||
@Injectable()
|
||||
export class SalesTaxService {
|
||||
constructor(private rateService: TaxRateService) {}
|
||||
|
||||
getVAT(value: string | number) {
|
||||
const amount = typeof value === 'string' ? parseFloat(value) : value;
|
||||
return (amount || 0) * this.rateService.getRate('VAT');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
|
||||
@Injectable()
|
||||
export class TaxRateService {
|
||||
getRate(rateName: string) {
|
||||
return 0.1;
|
||||
} // 10% everywhere
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
ul {
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style-type: none;
|
||||
border: 1px solid #444;
|
||||
margin-bottom: .5rem;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
li button {
|
||||
background-color: aliceblue;
|
||||
flex: 1;
|
||||
padding: 1rem;
|
||||
margin: 0;
|
||||
text-align: left;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
li button:hover, li button:active {
|
||||
background-color: #444;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
padding-bottom: .4rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Architecture of Angular</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<base href="/">
|
||||
<link rel="stylesheet" href="assets/architecture.css">
|
||||
</head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
// #docregion
|
||||
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
|
||||
import {AppModule} from './app/app.module';
|
||||
|
||||
platformBrowserDynamic()
|
||||
.bootstrapModule(AppModule)
|
||||
.catch((err) => console.error(err));
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"description": "Intro to Angular",
|
||||
"files":[
|
||||
"!**/*.d.ts",
|
||||
"!**/*.js",
|
||||
"!**/*.[1].*"
|
||||
],
|
||||
"file": "src/app/hero-list.component.html"
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
load("//aio/content/examples:examples.bzl", "docs_example")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
docs_example(
|
||||
name = "binding-syntax",
|
||||
)
|
||||
@@ -0,0 +1,74 @@
|
||||
import {browser, element, by} from 'protractor';
|
||||
import {logging} from 'selenium-webdriver';
|
||||
|
||||
describe('Binding syntax e2e tests', () => {
|
||||
beforeEach(() => browser.get(''));
|
||||
|
||||
// helper function used to test what's logged to the console
|
||||
async function logChecker(contents: string) {
|
||||
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
|
||||
const messages = logs.filter(({message}) => (message.indexOf(contents) !== -1 ? true : false));
|
||||
expect(messages.length).toBeGreaterThan(0);
|
||||
}
|
||||
|
||||
it('should display Binding syntax', async () => {
|
||||
expect(await element(by.css('h1')).getText()).toEqual('Binding syntax');
|
||||
});
|
||||
|
||||
it('should display Save button', async () => {
|
||||
expect(await element.all(by.css('button')).get(0).getText()).toBe('Save');
|
||||
});
|
||||
|
||||
it('should display HTML attributes and DOM properties', async () => {
|
||||
expect(await element.all(by.css('h2')).get(1).getText()).toBe(
|
||||
'HTML attributes and DOM properties',
|
||||
);
|
||||
});
|
||||
|
||||
it('should display 1. Use the inspector...', async () => {
|
||||
expect(await element.all(by.css('p')).get(0).getText()).toContain('1. Use the inspector');
|
||||
});
|
||||
|
||||
it('should display Disabled property vs. attribute', async () => {
|
||||
expect(await element.all(by.css('h3')).get(0).getText()).toBe(
|
||||
'Disabled property vs. attribute',
|
||||
);
|
||||
});
|
||||
|
||||
it('should log a message including Sarah', async () => {
|
||||
const attributeButton = element.all(by.css('button')).get(1);
|
||||
await attributeButton.click();
|
||||
const contents = 'Sarah';
|
||||
await logChecker(contents);
|
||||
});
|
||||
|
||||
it('should log a message including Sarah for DOM property', async () => {
|
||||
const DOMPropertyButton = element.all(by.css('button')).get(2);
|
||||
await DOMPropertyButton.click();
|
||||
const contents = 'Sarah';
|
||||
await logChecker(contents);
|
||||
});
|
||||
|
||||
it('should log a message including Sally for DOM property', async () => {
|
||||
const DOMPropertyButton = element.all(by.css('button')).get(2);
|
||||
const input = element(by.css('input'));
|
||||
await input.sendKeys('Sally');
|
||||
await DOMPropertyButton.click();
|
||||
const contents = 'Sally';
|
||||
await logChecker(contents);
|
||||
});
|
||||
|
||||
it('should log a message that Test Button works', async () => {
|
||||
const testButton = element.all(by.css('button')).get(3);
|
||||
await testButton.click();
|
||||
const contents = 'Test';
|
||||
await logChecker(contents);
|
||||
});
|
||||
|
||||
it('should toggle Test Button disabled', async () => {
|
||||
const toggleButton = element.all(by.css('button')).get(4);
|
||||
await toggleButton.click();
|
||||
const contents = 'true';
|
||||
await logChecker(contents);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
div {
|
||||
padding: .25rem 0;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
<div>
|
||||
<h1>Binding syntax</h1>
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h2>Button disabled state bound to isUnchanged property</h2>
|
||||
<!-- #docregion disabled-button -->
|
||||
<!-- Bind button disabled state to `isUnchanged` property -->
|
||||
<button type="button" [disabled]="isUnchanged">Save</button>
|
||||
<!-- #enddocregion disabled-button -->
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div (keyup)="0">
|
||||
<h2>HTML attributes and DOM properties</h2>
|
||||
<p>1. Use the inspector to see the HTML attribute and DOM property values. Click the buttons to log values to the console.</p>
|
||||
|
||||
<label for="html-attr">HTML Attribute Initializes to "Sarah":
|
||||
<input id="html-attr" type="text" value="Sarah" #bindingInput></label>
|
||||
<div>
|
||||
<button type="button" (click)="getHTMLAttributeValue()">Get HTML attribute value</button> Won't change.
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="button" (click)="getDOMPropertyValue()">Get DOM property value</button> Changeable. Angular works with these.
|
||||
</div>
|
||||
|
||||
<p>2. Change the name in the input and click the buttons again.</p>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
<h3>Disabled property vs. attribute</h3>
|
||||
<p>Use the inspector to see the Test Button work and its disabled property toggle.</p>
|
||||
<div>
|
||||
<button type="button" id="testButton" (click)="working()">Test Button</button>
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" (click)="toggleDisabled()">Toggle disabled property for Test Button</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user