Compare commits

...

50 Commits

Author SHA1 Message Date
Andrew Kushnir bf1b51cefe release: cut the v20.1.0 release 2025-07-09 12:25:58 -07:00
Angular Robot fed402f598 build: update dependency aspect_rules_ts to v3.6.3 (#62514)
See associated pull request for more information.

PR Close #62514
2025-07-08 16:02:47 -07:00
Joey Perrott fe50aeb3bf build: migrate usages of protractor_web_test_suite to use new rules_browser based rule (#62525)
Use the protractor_web_test_suite from rules_browser instead of @bazel/protractor

PR Close #62525
2025-07-08 15:59:12 -07:00
Matthieu Riegler dda655f8e8 refactor(devtools): remove unused imports (#62530)
Import had no purpose and was also invalid.

PR Close #62530
2025-07-08 12:12:22 -07:00
sEver c4de0c0671 fix(docs-infra): fix tutorial formatting issues (for v20) (#62457)
Fixes including, but not limited to:
- `visibleLines` values
- all codeblocks normalized to 2 spaces indentation
- lesson 14-http sEverely de-indented
- descriptions and explanations were rewritten to reflect the changes from @Input to input and from ngFor to @for
- missing step added in lesson 11-details-page
- rewritten confusing instructions for adding code that was already added in previous steps

PR Close #62457
2025-07-08 11:30:15 -07:00
Matthieu Riegler b61c8e1d2e fix(devtools): do not emit a route object with functions (#62254)
In the case where a Route has title defined as a function, it eventually throw when it reaches `window.postMessage`

fixes #60595

PR Close #62254
2025-07-08 11:28:28 -07:00
Matthieu Riegler 46d3bb56ea docs(docs-infra): generate llms-full.txt at build time (#61864)
PR Close #61864
2025-07-08 11:27:54 -07:00
Paul Gschwendtner 1a8297bf9e refactor(compiler): fix import manager to be closure property renaming-compatible (#62517)
The `generateUniqueIdentifier` helper relies on the internal `identifiers` property of a `ts.SourceFile`.
As this is not a public-facing API, it is not included in the externs provided to Closure Compiler.
Consequently, it is susceptible to being renamed during advanced optimizations, which would lead to runtime failures.

To prevent this, the property is now accessed via a string literal (`sf['identifiers']`). This change ensures that
the property name is preserved through the compilation process. An explanatory comment has been added to clarify the
necessity of this approach for future reference.

PR Close #62517
2025-07-08 11:31:09 +00:00
Angular Robot efc6405816 build: update devinfra digest to 6f54d14 (#62508)
See associated pull request for more information.

PR Close #62508
2025-07-07 20:55:23 +00:00
Joey Perrott aee83d1629 build: migrate angular-optimization from devinfra to devtools (#62505)
Migrate angular-optimization to devtools instead of loading via npm package

PR Close #62505
2025-07-07 20:21:26 +00:00
Angular Robot 46c920b1bd build: update cross-repo angular dependencies to v20.0.5 (#62501)
See associated pull request for more information.

PR Close #62501
2025-07-07 19:54:47 +00:00
Joey Perrott 2f45910489 build: disable firefox tests in devtools (#62504)
Disabling firefox tests in devtools until we can get them working on OS X as expected

PR Close #62504
2025-07-07 18:29:19 +00:00
Angular Robot bf234143db build: lock file maintenance (#62495)
See associated pull request for more information.

PR Close #62495
2025-07-07 18:10:30 +00:00
Angular Robot 5a60242421 build: update all non-major dependencies (#62478)
See associated pull request for more information.

PR Close #62478
2025-07-07 17:24:01 +00:00
Dzhavat Ushev fec1206f64 docs: update comment (#62482)
PR Close #62482
2025-07-07 16:52:15 +00:00
Paul Gschwendtner 98ecf800fa refactor(compiler): ensure compiler passes closure conformance checks (#62500)
This commit adjusts some code of the compiler that currently results in
conformance checks failures with JSCompiler/Closure.

PR Close #62500
2025-07-07 16:14:17 +00:00
Joey Perrott 35d74d2fb2 build: update to latest @angular/build-tooling (#62499)
Update to the latest @angular/build-tooling package, which drop dependency on @angular/benchpress

PR Close #62499
2025-07-07 16:07:29 +00:00
Angular Robot 30218af593 build: update dependency aspect_rules_ts to v3.6.2 (#62477)
See associated pull request for more information.

PR Close #62477
2025-07-07 15:35:56 +00:00
Kristiyan Kostadinov 918a8d06ca fix(compiler-cli): use proper name for diagnostic type (#62479)
Currently when a diagnostic happens in a template, we always say "Error occurs in ...", however we have other types of diagnostics as well.

PR Close #62479
2025-07-07 15:29:39 +00:00
Joey Perrott 62e3a70519 build: only require workspace build packages for web tests when provided (#62498)
Only use the builds from the workspace as for the bootstrap scripts for web testing

PR Close #62498
2025-07-07 15:26:37 +00:00
Joey Perrott c4863d2f98 build: migrate all dependencies for adev into adev/package.json (#62498)
Migrate the dependencies into the adev/package.json instead of importing from the the root package.json

PR Close #62498
2025-07-07 15:26:37 +00:00
Joey Perrott ffce768115 build: migrate remaing esbuild and nodejs_binary usages to new toolchain (#62498)
Migrate the remaing usages of esbuild and nodejs_binary in adev to the new toolchain versions.

PR Close #62498
2025-07-07 15:26:37 +00:00
Joey Perrott f8807a30be build: migrate adev to use rules_angular based cli rules (#62498)
Use the @angular/cli rules from rules_angular instead of the npm package directly

PR Close #62498
2025-07-07 15:26:37 +00:00
Paul Gschwendtner d7743144d3 refactor(compiler-cli): ensure mock file system can be loaded in the browser (#62493)
The mock file system currently relies on some NodeJS logic. This blocks
the convenient use of the mock file system in the browser. The file
system is useful for creating tests to verify e.g. that our transforms
can work in the browser.

PR Close #62493
2025-07-07 12:59:28 +02:00
Paul Gschwendtner 70deb1fe95 refactor: fix closure compatibility errors in compiler (#62493)
The static fields may be part of advanced compilations where the
receiver would change as part of the static field collapsing
optimization.

The optimization requires us to use the explicit class name, over
`this` that would change to e.g. `globalThis`.

PR Close #62493
2025-07-07 12:59:27 +02:00
Michael DeRazon da99b9ae3a docs: fix typo on guidelines file (#62468)
Correct a minor spelling mistake in the documentation to improve clarity.

PR Close #62468
2025-07-04 11:01:07 +00:00
Matthieu Riegler 2943591c27 docs: improve support for decorator APIs (#60411)
The commit introduce the distinction between

- class like decorators (like Component, Interface, NgModule. They are formatted like classes/interfaces, with each attribute being documents.
- function like decorators (Attribute, Host, Optional...)

PR Close #60411
2025-07-03 11:51:34 +00:00
Paul Gschwendtner fca058a8a1 refactor(migrations): ensure tsurge can properly emit references in g3 (#62447)
Currently when Tsurge runs in g3, it creates a bare bones Angular
compiler plugin. The tsconfigs from compilation units may set options
like "useHostForImportGeneration", but the Ngtsc logic doesn't enable
because the `fileNameToModuleName` method is not defined on the host.

This can break reference emission for Tsurge analyzers/programs and
result in subtle differences to real `ng_module` compilations. This
commit fixes this by making the method available in 1P Tsurge.

Notably, reference emission can occur during analysis— so even if
migrations aren't "emitting TS -> JS" output.

PR Close #62447
2025-07-03 09:36:18 +00:00
Matthieu Riegler cea42d0e6a docs(docs-infra): Load of the typing files from Angular. (#62424)
Following some infra changes, DTS files are now splitted over several files, which aren't referenced in the `package.json` but are directly imported in the root dts.

We chose to not use ATA here because it only pulls the latest version from a CDN whereas we prefer to use the local definitions we have in the `node_modules` of the tutorial.

fixes #62374

PR Close #62424
2025-07-03 09:35:37 +00:00
Jessica Janiuk f5f80d8ac2 ci: update pullapprove reviewers (#62448)
This sets some people to be reviewers, but not actively requested to account for availability.

PR Close #62448
2025-07-03 09:15:20 +00:00
Matthieu Riegler f5a10209e0 docs: display deprecation message for top most symbol (#62427)
For classes, types, functions, enums etc.

fixes #62365

PR Close #62427
2025-07-03 08:35:03 +00:00
Shuaib Hasan Akib 18816a6066 refactor(docs-infra): removed unused imports (#62441)
Cleans up instances of unused imports in a few shared docs components.

PR Close #62441
2025-07-03 08:11:46 +00:00
Shuaib Hasan Akib 7570dfd532 refactor(docs-infra): cleanup lines in scss (#62438)
Cleans up some of the scss code.

PR Close #62438
2025-07-03 08:11:10 +00:00
SkyZeroZx 6819c8b592 refactor(platform-browser): use RuntimeError for hydration feature conflicts (#62414)
Replace generic Error with RuntimeError

PR Close #62414
2025-07-03 08:08:08 +00:00
Angular Robot 026efb116e build: update cross-repo angular dependencies to v20.1.0-rc.0 (#62434)
See associated pull request for more information.

PR Close #62434
2025-07-03 07:47:39 +00:00
Paul Gschwendtner 87056c3b5d refactor(compiler-cli): do not rely on url when loading file system logic (#62431)
When executing the compiler-cli in the browser, or some parts of it—
modules like `url` are stubbed out with `{}`. This commit accounts for
this.

PR Close #62431
2025-07-02 17:05:28 +00:00
Paul Gschwendtner 827b9db370 refactor(compiler-cli): avoid eager typescript top-level usages (#62431)
For some internal refactorings, we want to avoid any direct top-level
`typescript` runtime usages. Usages that interact with `ts` after
synchronous module loading are fine.

More context in:
https://docs.google.com/document/d/1_h8AQRbM3LJrwIlUfGzGzxuwqFu0QI2-5eUTFI6gWws/edit?tab=t.0#heading=h.nunsebe2s3h0.

PR Close #62431
2025-07-02 17:05:28 +00:00
jstnjs d5210f0851 docs: fix formatting (#62400)
PR Close #62400
2025-07-02 16:56:26 +00:00
jstnjs 755b23af0b docs: fix dynamic form reactivity (#62400)
PR Close #62400
2025-07-02 16:56:26 +00:00
Shuaib Hasan Akib 59983efa82 docs(docs-infra): replace deprecated RouterTestingModule with RouterModule.forRoot([]) (#62364)
PR Close #62364
2025-07-02 16:52:32 +00:00
Joey Perrott d1d131a143 build: migrate devtools to use packaged version of @angular/* packages (#62413)
Use the packaged versions of the packages instead of the local ts_project dependencies to prevent multiple versions of the deps to enter test bundles

PR Close #62413
2025-07-02 16:10:25 +00:00
Joey Perrott 0d5363a6d7 build: migrate adev to use packaged version of @angular/* packages (#62413)
Use the packaged versions of the packages instead of the local ts_project dependencies to prevent multiple versions of the deps to enter test bundles

PR Close #62413
2025-07-02 16:10:25 +00:00
SkyZeroZx 42a3dbbd53 docs: Update documentation httpResource with credentials option (#62415)
PR Close #62415
2025-07-02 14:49:09 +00:00
Kristiyan Kostadinov 56769de4d8 perf(core): move property remapping for dom properties to compiler (#62421)
Since we know that DOM properties won't go to an inputs, we can move the remapping logic to the compiler, saving us some processing on the client.

PR Close #62421
2025-07-02 14:28:12 +00:00
Milo cf508935f6 refactor(devtools): update signal body on change (#62410)
when the epoch of a signal changes, update the preview text

PR Close #62410
2025-07-02 14:27:27 +00:00
Angular Robot 743978576e build: update all non-major dependencies (#62420)
See associated pull request for more information.

PR Close #62420
2025-07-02 14:21:25 +00:00
Angular Robot 126204b16a build: update cross-repo angular dependencies (#62426)
See associated pull request for more information.

PR Close #62426
2025-07-02 11:45:34 +00:00
Jessica Janiuk 0dcf3094a4 Revert "fix(service-worker): update service worker to handle seeking better for videos (#60029)" (#62422)
This reverts commit c663277df6.

PR Close #62422
2025-07-02 07:50:16 +00:00
Angular Robot 1cc1500ee0 build: update cross-repo angular dependencies (#62408)
See associated pull request for more information.

PR Close #62408
2025-07-02 07:43:48 +00:00
Jessica Janiuk 41955cf92e release: cut the v20.1.0-rc.0 release 2025-07-01 19:03:03 +02:00
377 changed files with 11361 additions and 23371 deletions
@@ -2,27 +2,31 @@
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
# This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=-1406867100
.pnpmfile.cjs=-2033668682
.pnpmfile.cjs=1437575780
adev/package.json=1817640747
adev/shared-docs/package.json=450629456
adev/shared-docs/pipeline/api-gen/package.json=939673974
integration/package.json=-239561259
modules/package.json=-597456295
package.json=-1928784858
modules/package.json=-2081919225
package.json=644214872
packages/animations/package.json=-678724831
packages/benchpress/package.json=-1908328724
packages/common/package.json=1729763064
packages/compiler-cli/linker/babel/test/package.json=939673974
packages/compiler-cli/package.json=-660047565
packages/compiler-cli/package.json=1178475833
packages/compiler/package.json=1190056499
packages/core/package.json=1154833122
packages/core/test/bundling/package.json=-271224435
packages/core/test/bundling/package.json=1725787122
packages/elements/package.json=-892969618
packages/forms/package.json=-877154917
packages/localize/package.json=912913343
packages/localize/package.json=-1162087867
packages/platform-browser-dynamic/package.json=1901947880
packages/platform-browser/package.json=-1163479450
packages/platform-server/package.json=-737662753
packages/router/package.json=860819913
packages/upgrade/package.json=16347051
packages/zone.js/package.json=-1005735564
pnpm-lock.yaml=1416623477
pnpm-workspace.yaml=-375658197
pnpm-lock.yaml=1343033359
pnpm-workspace.yaml=1738525657
tools/bazel/rules_angular_store/package.json=-239561259
yarn.lock=-774434861
yarn.lock=-623718115
+4
View File
@@ -40,6 +40,8 @@ modules/ssr-benchmarks/node_modules
# For rules_js
adev/node_modules
adev/shared-docs/node_modules
adev/shared-docs/pipeline/api-gen/node_modules
modules/node_modules
integration/node_modules
@@ -51,8 +53,10 @@ packages/compiler-cli/linker/babel/test/node_modules
packages/compiler/node_modules
packages/core/node_modules
packages/core/test/bundling/node_modules
packages/elements/node_modules
packages/forms/node_modules
packages/platform-browser/node_modules
packages/platform-server/node_modules
packages/platform-browser-dynamic/node_modules
packages/router/node_modules
packages/zone.js/node_modules
+2 -2
View File
@@ -5,9 +5,9 @@ runs:
using: 'composite'
steps:
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Saucelabs Variables
uses: angular/dev-infra/github-actions/saucelabs@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/saucelabs@6f54d143077baef582d70873722166fdc040066c
- name: Starting Saucelabs tunnel service
shell: bash
run: ./tools/saucelabs/sauce-service.sh run &
+5 -5
View File
@@ -21,18 +21,18 @@ 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@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Build adev to ensure it continues to work
run: yarn bazel build //adev:build --full_build_adev --config=release
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@6f54d143077baef582d70873722166fdc040066c
with:
workflow-artifact-name: 'adev-preview'
pull-number: '${{github.event.pull_request.number}}'
artifact-build-revision: '${{github.event.pull_request.head.sha}}'
deploy-directory: './dist/bin/adev/build/browser'
deploy-directory: './dist/bin/adev/dist/browser'
+1 -1
View File
@@ -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@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@6f54d143077baef582d70873722166fdc040066c
with:
github-token: '${{secrets.GITHUB_TOKEN}}'
workflow-artifact-name: 'adev-preview'
@@ -16,6 +16,6 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: angular/dev-infra/github-actions/branch-manager@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/branch-manager@6f54d143077baef582d70873722166fdc040066c
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -38,7 +38,7 @@ jobs:
- uses: ./.github/actions/yarn-install
- uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
with:
bazelrc: ./.bazelrc.user
+23 -23
View File
@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
- name: Install node modules
@@ -41,13 +41,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -61,13 +61,13 @@ jobs:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -79,13 +79,13 @@ jobs:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -98,11 +98,11 @@ jobs:
labels: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -117,13 +117,13 @@ jobs:
labels: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
- name: Install node modules
run: yarn install --frozen-lockfile
- run: echo "https://${{secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN}}:@github.com" > ${HOME}/.git_credentials
@@ -135,7 +135,7 @@ jobs:
labels: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
node-module-directories: |
@@ -143,9 +143,9 @@ jobs:
./packages/zone.js/node_modules
./packages/zone.js/test/typings/node_modules
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
@@ -198,11 +198,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Build adev to ensure it continues to work
@@ -213,4 +213,4 @@ jobs:
serviceKey: ${{ secrets.ANGULAR_DEV_SITE_DEPLOY }}
githubReleaseTrainReadToken: ${{ secrets.DOCS_DEPLOY_GITHUB_RELEASE_TRAIN_TOKEN }}
configPath: 'adev/firebase.json'
distDir: 'dist/bin/adev/build/browser'
distDir: 'dist/bin/adev/dist/browser'
+2 -2
View File
@@ -13,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/pull-request-labeling@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/pull-request-labeling@6f54d143077baef582d70873722166fdc040066c
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/post-approval-changes@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/post-approval-changes@6f54d143077baef582d70873722166fdc040066c
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+1 -1
View File
@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/google-internal-tests@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/google-internal-tests@6f54d143077baef582d70873722166fdc040066c
with:
run-tests-guide-url: http://go/angular-g3sync-start
github-token: ${{ secrets.GITHUB_TOKEN }}
+4 -4
View File
@@ -13,17 +13,17 @@ jobs:
JOBS: 2
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
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@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
- name: Setup Saucelabs Variables
uses: angular/dev-infra/github-actions/saucelabs@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/saucelabs@6f54d143077baef582d70873722166fdc040066c
- name: Set up Sauce Tunnel Daemon
run: yarn bazel run //tools/saucelabs-daemon/background-service -- $JOBS &
env:
+1 -1
View File
@@ -9,6 +9,6 @@ jobs:
status:
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/unified-status-check@dfe138678e4edb4789fbe40ae7792c046de3b4bd
- uses: angular/dev-infra/github-actions/unified-status-check@6f54d143077baef582d70873722166fdc040066c
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+3 -3
View File
@@ -21,7 +21,7 @@ jobs:
workflows: ${{ steps.workflows.outputs.workflows }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
- name: Install node modules
run: yarn -s install --frozen-lockfile
- id: workflows
@@ -36,9 +36,9 @@ jobs:
workflow: ${{ fromJSON(needs.list.outputs.workflows) }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Install node modules
run: yarn -s install --frozen-lockfile
# We utilize the google-github-actions/auth action to allow us to get an active credential using workflow
+17 -17
View File
@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
- name: Install node modules
@@ -39,7 +39,7 @@ jobs:
- name: Check code format
run: yarn ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
- name: Check Package Licenses
uses: angular/dev-infra/github-actions/linting/licenses@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/linting/licenses@6f54d143077baef582d70873722166fdc040066c
with:
allow-dependencies-licenses: 'pkg:npm/google-protobuf@'
@@ -47,13 +47,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run unit tests
@@ -65,13 +65,13 @@ jobs:
runs-on: ubuntu-latest-8core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
- name: Install node modules
run: yarn install --frozen-lockfile --network-timeout 100000
- name: Run CI tests for framework
@@ -91,13 +91,13 @@ jobs:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
- name: Install node modules
run: yarn install --frozen-lockfile --network-timeout 100000
- name: Run integration CI tests for framework
@@ -108,11 +108,11 @@ jobs:
labels: ubuntu-latest-8core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
- name: Install node modules
run: yarn install --frozen-lockfile
- name: Run tests
@@ -125,7 +125,7 @@ jobs:
labels: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@6f54d143077baef582d70873722166fdc040066c
with:
cache-node-modules: true
node-module-directories: |
@@ -133,9 +133,9 @@ jobs:
./packages/zone.js/node_modules
./packages/zone.js/test/typings/node_modules
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/setup@6f54d143077baef582d70873722166fdc040066c
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@dfe138678e4edb4789fbe40ae7792c046de3b4bd
uses: angular/dev-infra/github-actions/bazel/configure-remote@6f54d143077baef582d70873722166fdc040066c
- name: Install node modules
run: yarn install --frozen-lockfile
- run: |
+1 -1
View File
@@ -7,7 +7,7 @@ export const format: FormatConfig = {
'prettier': {
'matchers': [
'**/*.{yaml,yml}',
'**/*.{js,ts,mjs,mts,cjs,cts}',
'**/*.{js,ts,mjs,mts,cjs,cts,tsx}',
'devtools/**/*.{js,ts,mjs,mts,cjs,cts,html,scss}',
// Do not format d.ts files as they are generated
+28
View File
@@ -8,6 +8,15 @@ function readPackage(pkg, context) {
// are resolved via these locally-built versions. e.g. compiler-cli's peer deps.
'@angular/compiler': 'workspace:*',
'@angular/compiler-cli': 'workspace:*',
'@angular/core': 'workspace:*',
'@angular/common': 'workspace:*',
'@angular/router': 'workspace:*',
'@angular/platform-browser': 'workspace:*',
'@angular/platform-browser-dynamic': 'workspace:*',
'@angular/platform-server': 'workspace:*',
'@angular/forms': 'workspace:*',
'@angular/elements': 'workspace:*',
'@angular/animations': 'workspace:*',
};
}
@@ -22,6 +31,25 @@ function readPackage(pkg, context) {
};
}
Object.entries(pkg.peerDependencies).forEach(([key, version]) => {
// Any package that has a peerDependency on rxjs, should instead treat the peerDependency as a
// regular dependency.
if (key === 'rxjs') {
pkg.dependencies = {
...pkg.dependencies,
'rxjs': version,
};
}
// Change all locally generated packages to directly depend on the other local packages, instead
// of expecting them as peerDependencies automatically as we do not auto install peer deps.
if (version === '0.0.0-PLACEHOLDER') {
pkg.dependencies = {
...pkg.dependencies,
[key]: 'workspace: *',
};
}
});
return pkg;
}
+16 -16
View File
@@ -126,7 +126,7 @@ groups:
])
reviewers:
users:
- alxhub
- ~alxhub
- AndrewKushnir
- atscott
- crisbeto
@@ -167,7 +167,7 @@ groups:
])
reviewers:
users:
- alxhub
- ~alxhub
- AndrewKushnir
- atscott
- crisbeto
@@ -175,7 +175,7 @@ groups:
- kirjs
- ~jelbourn
- thePunderWoman
- pkozlowski-opensource
- ~pkozlowski-opensource
- mmalerba
# =========================================================
@@ -198,10 +198,10 @@ groups:
])
reviewers:
users:
- alxhub
- ~alxhub
- jelbourn
- josephperrott
- pkozlowski-opensource
- ~pkozlowski-opensource
reviews:
request: -1 # request reviews from everyone
required: 2 # require at least 2 approvals
@@ -221,14 +221,14 @@ groups:
users:
- ~JiaLiPassion
- ~jelbourn
- alxhub
- ~alxhub
- AndrewKushnir
- atscott
- crisbeto
- devversion
- kirjs
- thePunderWoman
- pkozlowski-opensource
- ~pkozlowski-opensource
- mmalerba
# =========================================================
@@ -267,7 +267,7 @@ groups:
reviewers:
users:
- alan-agius4
- alxhub
- ~alxhub
- AndrewKushnir
- atscott
- bencodezen
@@ -278,7 +278,7 @@ groups:
- thePunderWoman
- devversion
- josephperrott
- pkozlowski-opensource
- ~pkozlowski-opensource
- mgechev
- MarkTechson
- kirjs
@@ -384,11 +384,11 @@ groups:
reviewers:
users:
- AndrewKushnir
- alxhub
- ~alxhub
- atscott
- ~jelbourn
- thePunderWoman
- pkozlowski-opensource
- ~pkozlowski-opensource
- kirjs
- mmalerba
- crisbeto
@@ -416,13 +416,13 @@ groups:
])
reviewers:
users:
- alxhub
- ~alxhub
- AndrewKushnir
- atscott
- kirjs
- ~jelbourn
- thePunderWoman
- pkozlowski-opensource
- ~pkozlowski-opensource
- mmalerba
reviews:
request: 2 # Request reviews from 2 people
@@ -445,7 +445,7 @@ groups:
])
reviewers:
users:
- alxhub
- ~alxhub
- AndrewKushnir
- andrewseguin
- dgp1130
@@ -467,8 +467,8 @@ groups:
])
reviewers:
users:
- pkozlowski-opensource # Pawel Kozlowski
- alxhub # Alex Rickabaugh
- ~pkozlowski-opensource # Pawel Kozlowski
- ~alxhub # Alex Rickabaugh
- thePunderWoman # Jessica Janiuk
- AndrewKushnir # Andrew Kushnir
- atscott # Andrew Scott
+46 -92
View File
@@ -1,45 +1,76 @@
<a name="20.0.6"></a>
# 20.0.6 (2025-07-01)
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.0-next.3"></a>
# 20.1.0-next.3 (2025-06-25)
<a name="20.1.0"></a>
# 20.1.0 (2025-07-09)
### common
| Commit | Type | Description |
| -- | -- | -- |
| [58aedc37d1](https://github.com/angular/angular/commit/58aedc37d10208ca40c1b1d4468261dd9aba5356) | feat | add support for a custom EnvironmentInjector to NgComponentOutlet directive ([#54764](https://github.com/angular/angular/pull/54764)) |
| [ef10aa4005](https://github.com/angular/angular/commit/ef10aa400585fb66e1afde08be0f9fd9a70ce7f2) | feat | support decoding in NgOptimizedImage ([#61905](https://github.com/angular/angular/pull/61905)) |
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [0dcf230d52](https://github.com/angular/angular/commit/0dcf230d52694e6d3d6e55d6e675d55f9cf236bc) | feat | add support for new binary assignment operators ([#62064](https://github.com/angular/angular/pull/62064)) |
| [5a76826d26](https://github.com/angular/angular/commit/5a76826d266b4ed0ef863221571e4b6b1b16182f) | fix | only report parser errors on invalid expression ([#61793](https://github.com/angular/angular/pull/61793)) |
| [089ad0ee15](https://github.com/angular/angular/commit/089ad0ee15d6be9b2493bb67519cb59e0454a1ef) | fix | produce more accurate errors for interpolations ([#62258](https://github.com/angular/angular/pull/62258)) |
| [e9fcbb8af1](https://github.com/angular/angular/commit/e9fcbb8af12e7b4370d2e03e6004f3f2fe02c981) | fix | remove TypeScript from linker ([#61618](https://github.com/angular/angular/pull/61618)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [ed5062a91c](https://github.com/angular/angular/commit/ed5062a91cbd96c078736cc354925de15496aa57) | fix | add suggestion when pipe is missing ([#62146](https://github.com/angular/angular/pull/62146)) |
| [d25a6a0120](https://github.com/angular/angular/commit/d25a6a0120b111f3ddbd701d5a67a8baefd2ca0e) | fix | handle initializer APIs wrapped in type casts ([#62203](https://github.com/angular/angular/pull/62203)) |
| [e62fb359d6](https://github.com/angular/angular/commit/e62fb359d6da8e0458b18f24e6bff60602f93fc6) | feat | add experimental support for fast type declaration emission ([#61334](https://github.com/angular/angular/pull/61334)) |
| [0cf1001715](https://github.com/angular/angular/commit/0cf1001715d2f528c61735108d12e29047907d98) | feat | support host directives with direct external references in fast type declaration emission ([#61469](https://github.com/angular/angular/pull/61469)) |
| [b7ab5fa256](https://github.com/angular/angular/commit/b7ab5fa2562524a0e8dfa4f3dff740ec2d31b4c7) | fix | add signal checks to handle negated calls ([#59970](https://github.com/angular/angular/pull/59970)) |
| [77fa204ad1](https://github.com/angular/angular/commit/77fa204ad16fef561c009fcef0ab1fb92a37f986) | fix | rename flag for enabling fast type declaration emission ([#61353](https://github.com/angular/angular/pull/61353)) |
| [c439d6938d](https://github.com/angular/angular/commit/c439d6938de60cb132f7ae4d305efa5b3d853e36) | fix | symbol builder duplicating host directives ([#61240](https://github.com/angular/angular/pull/61240)) |
| [3e1baa5a95](https://github.com/angular/angular/commit/3e1baa5a9565f4930507cdf338e6f9ea7e8702a3) | fix | typo in NG2026 message ([#61325](https://github.com/angular/angular/pull/61325)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [8163a8995e](https://github.com/angular/angular/commit/8163a8995e36bbce74e3d852613c19e56027cc24) | feat | Add `destroyed` property on `DestroyRef` ([#61849](https://github.com/angular/angular/pull/61849)) |
| [737b35b684](https://github.com/angular/angular/commit/737b35b684663bb641939f05ae12fa11b3395159) | feat | Add `destroyed` property to `EnvironmentInjector` ([#61951](https://github.com/angular/angular/pull/61951)) |
| [36a193139a](https://github.com/angular/angular/commit/36a193139ac02ee619a26445669b7c253f33ebb8) | fix | allow to set a resource in an error state ([#62253](https://github.com/angular/angular/pull/62253)) |
| [c4dd258658](https://github.com/angular/angular/commit/c4dd258658fc5e93a83c0eae13fbd8768e7b6619) | fix | avoid injecting `ErrorHandler` from a destroyed injector ([#61886](https://github.com/angular/angular/pull/61886)) |
| [3eee19d892](https://github.com/angular/angular/commit/3eee19d8926d306c7dab238e7d32c8c39bfa7a57) | fix | unable to retrieve defer blocks in tests when component injects ViewContainerRef ([#62156](https://github.com/angular/angular/pull/62156)) |
| [2e0c98bd3f](https://github.com/angular/angular/commit/2e0c98bd3f2efd1181429b486dd1cebe14385c18) | feat | support bindings in TestBed ([#62040](https://github.com/angular/angular/pull/62040)) |
| [4356e85456](https://github.com/angular/angular/commit/4356e8545666f13033bb2c4b7fa018d0b97e6f01) | fix | fakeAsync should not depend on module import order ([#61375](https://github.com/angular/angular/pull/61375)) |
| [8424b3bcd5](https://github.com/angular/angular/commit/8424b3bcd5b9c78f37dc8ba636c87775937bcc03) | fix | Fixes template outlet hydration ([#61989](https://github.com/angular/angular/pull/61989)) |
| [583b9a7be5](https://github.com/angular/angular/commit/583b9a7be56310f247dcf83dd1ce297b9c6be682) | fix | missing useExisting providers throwing for optional calls ([#61137](https://github.com/angular/angular/pull/61137)) |
| [8f65223bd8](https://github.com/angular/angular/commit/8f65223bd83ee5cdbff6a3c8e99f85d1c69f5375) | fix | update min Node.js support to 20.19, 22.12, and 24.0 ([#61499](https://github.com/angular/angular/pull/61499)) |
| [b785256b9e](https://github.com/angular/angular/commit/b785256b9e7f83c9f05fb1afd561f0af49a42e9d) | perf | avoid intermediate arrays in definition ([#61445](https://github.com/angular/angular/pull/61445)) |
| [56769de4d8](https://github.com/angular/angular/commit/56769de4d83a08b8044cd2463341cbd60d40191f) | perf | move property remapping for dom properties to compiler ([#62421](https://github.com/angular/angular/pull/62421)) |
### forms
| Commit | Type | Description |
| -- | -- | -- |
| [610bebfce9](https://github.com/angular/angular/commit/610bebfce98d879677244b2ef08b24886891ca76) | fix | Allow ControlState as reset arguments for `FormGroup`/`FormRecord` ([#55860](https://github.com/angular/angular/pull/55860)) |
| [4f0221e193](https://github.com/angular/angular/commit/4f0221e1933675b24bdbf95be3825fdacee13c00) | fix | improve select performance ([#61949](https://github.com/angular/angular/pull/61949)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [55fa38a1e5](https://github.com/angular/angular/commit/55fa38a1e53926d114b2290c084f3540f50b7266) | feat | add cache & priority support for fetch requests in httpResource ([#62301](https://github.com/angular/angular/pull/62301)) |
| [b6ef42843c](https://github.com/angular/angular/commit/b6ef42843c49e50239b678bb4d8f01ab30589dd3) | feat | add credentials support for fetch requests in httpResource ([#62390](https://github.com/angular/angular/pull/62390)) |
| [73269cf5ce](https://github.com/angular/angular/commit/73269cf5ceb4c32473a81a101a79decd06cfe274) | feat | add keepalive support for fetch requests in httpResource ([#61833](https://github.com/angular/angular/pull/61833)) |
| [27b7ec0a62](https://github.com/angular/angular/commit/27b7ec0a6219645a5af07c2d409c34311a458374) | feat | add mode & redirect for fetch request in httpResource ([#62337](https://github.com/angular/angular/pull/62337)) |
| [f0965c7acd](https://github.com/angular/angular/commit/f0965c7acd2fc2a4a4c18e5a47f3447c4fc7c668) | feat | Add support for fetch credentials options in HttpClient ([#62354](https://github.com/angular/angular/pull/62354)) |
| [87322449a3](https://github.com/angular/angular/commit/87322449a33fc727ad8c80b6cc6d0a87a900a6fa) | feat | add support for fetch mode and redirect options in HttpClient ([#62315](https://github.com/angular/angular/pull/62315)) |
| [9791ab1b6f](https://github.com/angular/angular/commit/9791ab1b6f8694ada6a0e359003243d89d6c7c97) | feat | Add support for fetch request cache and priority options ([#61766](https://github.com/angular/angular/pull/61766)) |
| [aa861c42ff](https://github.com/angular/angular/commit/aa861c42fface06563669c188327700085774e89) | feat | add timeout option on httpResource. ([#62326](https://github.com/angular/angular/pull/62326)) |
| [c4cffe2063](https://github.com/angular/angular/commit/c4cffe2063e790d2f8e4dc8b9c9817f2c4fcc4e7) | feat | Add timeout option to HTTP requests ([#57194](https://github.com/angular/angular/pull/57194)) |
| [cfbbb08437](https://github.com/angular/angular/commit/cfbbb0843727dd7959d73c496307153234ee20b9) | feat | add warning when withCredentials overrides explicit credentials ([#62383](https://github.com/angular/angular/pull/62383)) |
### language-service
| Commit | Type | Description |
| -- | -- | -- |
| [20c1f991e6](https://github.com/angular/angular/commit/20c1f991e63b8fc3023a302964d0438bfbfba8f0) | feat | add semantic tokens for templates ([#60260](https://github.com/angular/angular/pull/60260)) |
| [cf55d1bdd4](https://github.com/angular/angular/commit/cf55d1bdd4201ed99dd876138c50a497b611acb7) | feat | Support importing the external module's export about the angular metadata. ([#61122](https://github.com/angular/angular/pull/61122)) |
| [5d2e85920e](https://github.com/angular/angular/commit/5d2e85920e714560e8d06bfb9c41d9312eeaae3b) | feat | support to fix missing required inputs diagnostic ([#50911](https://github.com/angular/angular/pull/50911)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [9833d9ea47](https://github.com/angular/angular/commit/9833d9ea47b717293c9df0d8a5c285a3c4ad35d0) | feat | Run `loadComponent` and `loadChildren` functions in the route's injection context ([#62133](https://github.com/angular/angular/pull/62133)) |
| [7600bec71d](https://github.com/angular/angular/commit/7600bec71d65366f5eaed94a54d6b848e0a670b5) | fix | handle scrollRestoration error in restricted environments ([#62186](https://github.com/angular/angular/pull/62186)) |
### upgrade
### service-worker
| Commit | Type | Description |
| -- | -- | -- |
| [900cd37f68](https://github.com/angular/angular/commit/900cd37f68c0beca0f19ccba2e3ccd4c34bdab91) | fix | Make zoneless work with hybrid apps ([#61660](https://github.com/angular/angular/pull/61660)) |
| [c67dbda8ff](https://github.com/angular/angular/commit/c67dbda8ff76410e0bb7e4b1719125f3197227dd) | feat | support notification closes ([#61442](https://github.com/angular/angular/pull/61442)) |
| [6e1df54799](https://github.com/angular/angular/commit/6e1df5479967c2c8b0fadf75e9a9f8c33a342245) | feat | support push subscription changes ([#61856](https://github.com/angular/angular/pull/61856)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.0.6"></a>
# 20.0.6 (2025-07-01)
<!-- CHANGELOG SPLIT MARKER -->
@@ -67,22 +98,6 @@
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.0-next.2"></a>
# 20.1.0-next.2 (2025-06-18)
### core
| Commit | Type | Description |
| -- | -- | -- |
| [2e0c98bd3f](https://github.com/angular/angular/commit/2e0c98bd3f2efd1181429b486dd1cebe14385c18) | feat | support bindings in TestBed ([#62040](https://github.com/angular/angular/pull/62040)) |
| [8424b3bcd5](https://github.com/angular/angular/commit/8424b3bcd5b9c78f37dc8ba636c87775937bcc03) | fix | Fixes template outlet hydration ([#61989](https://github.com/angular/angular/pull/61989)) |
| [31da435854](https://github.com/angular/angular/commit/31da435854379e2a97b9b746751617e9979f01b0) | fix | inject `APP_ID` before injector is destroyed ([#61885](https://github.com/angular/angular/pull/61885)) |
| [572c32a038](https://github.com/angular/angular/commit/572c32a03876a5dbb6d0400ab0a217541407a0f9) | fix | Wrap ErrorEvent with no error property ([#62081](https://github.com/angular/angular/pull/62081)) |
### migrations
| Commit | Type | Description |
| -- | -- | -- |
| [34adfdea82](https://github.com/angular/angular/commit/34adfdea82997c43325e541c016c5c5d6f6f4a31) | fix | more robust trailing comma removal in unused imports migration ([#62118](https://github.com/angular/angular/pull/62118)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.0.4"></a>
# 20.0.4 (2025-06-18)
### core
@@ -98,28 +113,6 @@
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.0-next.1"></a>
# 20.1.0-next.1 (2025-06-11)
### common
| Commit | Type | Description |
| -- | -- | -- |
| [ef10aa4005](https://github.com/angular/angular/commit/ef10aa400585fb66e1afde08be0f9fd9a70ce7f2) | feat | support decoding in NgOptimizedImage ([#61905](https://github.com/angular/angular/pull/61905)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [b7ab5fa256](https://github.com/angular/angular/commit/b7ab5fa2562524a0e8dfa4f3dff740ec2d31b4c7) | fix | add signal checks to handle negated calls ([#59970](https://github.com/angular/angular/pull/59970)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [3aa933acb7](https://github.com/angular/angular/commit/3aa933acb796c6c85181c798b5353caaae17e809) | fix | components marked for traversal resets reactive context ([#61663](https://github.com/angular/angular/pull/61663)) |
| [e81ea0c3dd](https://github.com/angular/angular/commit/e81ea0c3dd67fc86c7203de65896c3119813fe4c) | fix | unregister `onDestroy` in `outputToObservable` ([#61882](https://github.com/angular/angular/pull/61882)) |
### forms
| Commit | Type | Description |
| -- | -- | -- |
| [4f0221e193](https://github.com/angular/angular/commit/4f0221e1933675b24bdbf95be3825fdacee13c00) | fix | improve select performance ([#61949](https://github.com/angular/angular/pull/61949)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.0.3"></a>
# 20.0.3 (2025-06-11)
@@ -135,45 +128,6 @@
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.0-next.0"></a>
# 20.1.0-next.0 (2025-06-04)
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [5a76826d26](https://github.com/angular/angular/commit/5a76826d266b4ed0ef863221571e4b6b1b16182f) | fix | only report parser errors on invalid expression ([#61793](https://github.com/angular/angular/pull/61793)) |
| [e9fcbb8af1](https://github.com/angular/angular/commit/e9fcbb8af12e7b4370d2e03e6004f3f2fe02c981) | fix | remove TypeScript from linker ([#61618](https://github.com/angular/angular/pull/61618)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [e62fb359d6](https://github.com/angular/angular/commit/e62fb359d6da8e0458b18f24e6bff60602f93fc6) | feat | add experimental support for fast type declaration emission ([#61334](https://github.com/angular/angular/pull/61334)) |
| [0cf1001715](https://github.com/angular/angular/commit/0cf1001715d2f528c61735108d12e29047907d98) | feat | support host directives with direct external references in fast type declaration emission ([#61469](https://github.com/angular/angular/pull/61469)) |
| [77fa204ad1](https://github.com/angular/angular/commit/77fa204ad16fef561c009fcef0ab1fb92a37f986) | fix | rename flag for enabling fast type declaration emission ([#61353](https://github.com/angular/angular/pull/61353)) |
| [c439d6938d](https://github.com/angular/angular/commit/c439d6938de60cb132f7ae4d305efa5b3d853e36) | fix | symbol builder duplicating host directives ([#61240](https://github.com/angular/angular/pull/61240)) |
| [3e1baa5a95](https://github.com/angular/angular/commit/3e1baa5a9565f4930507cdf338e6f9ea7e8702a3) | fix | typo in NG2026 message ([#61325](https://github.com/angular/angular/pull/61325)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [8163a8995e](https://github.com/angular/angular/commit/8163a8995e36bbce74e3d852613c19e56027cc24) | feat | Add `destroyed` property on `DestroyRef` ([#61849](https://github.com/angular/angular/pull/61849)) |
| [4356e85456](https://github.com/angular/angular/commit/4356e8545666f13033bb2c4b7fa018d0b97e6f01) | fix | fakeAsync should not depend on module import order ([#61375](https://github.com/angular/angular/pull/61375)) |
| [583b9a7be5](https://github.com/angular/angular/commit/583b9a7be56310f247dcf83dd1ce297b9c6be682) | fix | missing useExisting providers throwing for optional calls ([#61137](https://github.com/angular/angular/pull/61137)) |
| [8f65223bd8](https://github.com/angular/angular/commit/8f65223bd83ee5cdbff6a3c8e99f85d1c69f5375) | fix | update min Node.js support to 20.19, 22.12, and 24.0 ([#61499](https://github.com/angular/angular/pull/61499)) |
| [b785256b9e](https://github.com/angular/angular/commit/b785256b9e7f83c9f05fb1afd561f0af49a42e9d) | perf | avoid intermediate arrays in definition ([#61445](https://github.com/angular/angular/pull/61445)) |
### forms
| Commit | Type | Description |
| -- | -- | -- |
| [610bebfce9](https://github.com/angular/angular/commit/610bebfce98d879677244b2ef08b24886891ca76) | fix | Allow ControlState as reset arguments for `FormGroup`/`FormRecord` ([#55860](https://github.com/angular/angular/pull/55860)) |
### language-service
| Commit | Type | Description |
| -- | -- | -- |
| [cf55d1bdd4](https://github.com/angular/angular/commit/cf55d1bdd4201ed99dd876138c50a497b611acb7) | feat | Support importing the external module's export about the angular metadata. ([#61122](https://github.com/angular/angular/pull/61122)) |
### service-worker
| Commit | Type | Description |
| -- | -- | -- |
| [c67dbda8ff](https://github.com/angular/angular/commit/c67dbda8ff76410e0bb7e4b1719125f3197227dd) | feat | support notification closes ([#61442](https://github.com/angular/angular/pull/61442)) |
| [6e1df54799](https://github.com/angular/angular/commit/6e1df5479967c2c8b0fadf75e9a9f8c33a342245) | feat | support push subscription changes ([#61856](https://github.com/angular/angular/pull/61856)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.0.1"></a>
# 20.0.1 (2025-06-04)
### compiler
+16 -5
View File
@@ -110,6 +110,8 @@ npm_translate_lock(
"//:.pnpmfile.cjs",
"//:package.json",
"//:pnpm-workspace.yaml",
"//adev:package.json",
"//adev/shared-docs:package.json",
"//adev/shared-docs/pipeline/api-gen:package.json",
"//integration:package.json",
"//modules:package.json",
@@ -121,10 +123,12 @@ npm_translate_lock(
"//packages/compiler-cli/linker/babel/test:package.json",
"//packages/core:package.json",
"//packages/core/test/bundling:package.json",
"//packages/elements:package.json",
"//packages/forms:package.json",
"//packages/localize:package.json",
"//packages/platform-browser:package.json",
"//packages/platform-browser-dynamic:package.json",
"//packages/platform-server:package.json",
"//packages/router:package.json",
"//packages/upgrade:package.json",
"//packages/zone.js:package.json",
@@ -143,9 +147,9 @@ npm_repositories()
http_archive(
name = "aspect_rules_ts",
sha256 = "6b15ac1c69f2c0f1282e41ab469fd63cd40eb2e2d83075e19b68a6a76669773f",
strip_prefix = "rules_ts-3.6.0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.6.0/rules_ts-v3.6.0.tar.gz",
sha256 = "09af62a0d46918d815b5f48b5ed0f5349b62c15fc42fcc3fef5c246504ff8d99",
strip_prefix = "rules_ts-3.6.3",
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.6.3/rules_ts-v3.6.3.tar.gz",
)
load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")
@@ -276,7 +280,7 @@ yarn_install(
git_repository(
name = "devinfra",
commit = "dfe138678e4edb4789fbe40ae7792c046de3b4bd",
commit = "6f54d143077baef582d70873722166fdc040066c",
remote = "https://github.com/angular/dev-infra.git",
)
@@ -311,7 +315,7 @@ rules_angular_step3(
git_repository(
name = "rules_browsers",
commit = "800d91c06d3ac174b789ad6a9b6772f358230c40",
commit = "0d8211868d682a9880f4fe6e735d3c82ff63889d",
remote = "https://github.com/devversion/rules_browsers.git",
)
@@ -358,3 +362,10 @@ git_repository(
load("@rules_sass//src/toolchain:repositories.bzl", "setup_rules_sass")
setup_rules_sass()
http_archive(
name = "jq.bzl",
sha256 = "7b63435aa19cc6a0cfd1a82fbdf2c7a2f0a94db1a79ff7a4469ffa94286261ab",
strip_prefix = "jq.bzl-0.1.0",
url = "https://github.com/bazel-contrib/jq.bzl/releases/download/v0.1.0/jq.bzl-v0.1.0.tar.gz",
)
+92 -133
View File
@@ -1,41 +1,21 @@
load("@bazel_skylib//lib:collections.bzl", "collections")
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin")
load("@devinfra//bazel/remote-execution:index.bzl", "ENABLE_NETWORK")
load("@npm//@angular-devkit/architect-cli:index.bzl", "architect", "architect_test")
load("//adev/tools/local_deps:index.bzl", "ensure_local_package_deps", "link_local_packages")
load("//tools:defaults.bzl", "http_server")
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("@rules_angular//src/architect:ng_application.bzl", "ng_application")
load("@rules_angular//src/architect:ng_config.bzl", "ng_config")
load("@rules_angular//src/architect:ng_test.bzl", "ng_test")
package(default_visibility = ["//visibility:public"])
npm_link_all_packages(
name = "node_modules",
)
exports_files([
"tsconfig.json",
])
# All source and configuration files required to build the docs app
APPLICATION_FILES = [
"angular.json",
"tsconfig.app.json",
"tsconfig.json",
"tsconfig.worker.json",
] + glob(
["src/**/*"],
exclude = [
"src/**/*.spec.ts",
],
) + [
"//adev/src/content/examples:embeddable",
]
TEST_FILES = APPLICATION_FILES + [
"karma.conf.js",
"test-main.ts",
"tsconfig.spec.json",
] + glob(
["src/**/*.spec.ts"],
)
APPLICATION_ASSETS = [
"//adev/src/context:llms_full",
"//adev/src/assets/images",
"//adev/src/assets/others",
"//adev/src/assets/previews",
@@ -44,77 +24,75 @@ APPLICATION_ASSETS = [
"//adev/src/assets:api",
"//adev/src/assets:content",
"//adev/src/assets:context",
]
"//adev/src/content/examples:embeddable",
] + glob(
["src/**/*"],
exclude = ["src/**/*.spec.ts"],
)
APPLICATION_DEPS = [
"@npm//@angular/docs",
"@npm//@angular/build",
"@npm//@angular-devkit/build-angular",
"@npm//@angular/animations",
"@npm//@angular/cdk",
"@npm//@angular/common",
"@npm//@angular/compiler",
"@npm//@angular/compiler-cli",
"@npm//@angular/core",
"@npm//@angular/forms",
"@npm//@angular/material",
"@npm//@angular/platform-browser",
"@npm//@angular/platform-server",
"@npm//@angular/router",
"@npm//@angular/ssr",
"@npm//@types/dom-navigation",
"@npm//fflate",
"@npm//marked",
"@npm//ngx-progressbar",
"@npm//rxjs",
"@npm//xhr2",
"@npm//typescript",
"@npm//@typescript/vfs",
"@npm//@codemirror/state",
"@npm//@codemirror/view",
"@npm//@codemirror/language",
"@npm//@codemirror/commands",
"@npm//@codemirror/search",
"@npm//@codemirror/autocomplete",
"@npm//@codemirror/lint",
"@npm//@codemirror/lang-html",
"@npm//@codemirror/lang-angular",
"@npm//@codemirror/lang-css",
"@npm//@codemirror/lang-sass",
"@npm//@codemirror/lang-javascript",
"@npm//@lezer/highlight",
"@npm//@lezer/javascript",
"@npm//@lezer/common",
"@npm//@stackblitz/sdk",
"@npm//open-in-idx",
"@npm//@webcontainer/api",
"@npm//@xterm/xterm",
"@npm//@xterm/addon-fit",
"@npm//algoliasearch",
"@npm//angular-split",
"//adev:node_modules/@angular-devkit/build-angular",
"//adev:node_modules/@codemirror/autocomplete",
"//adev:node_modules/@codemirror/commands",
"//adev:node_modules/@codemirror/lang-angular",
"//adev:node_modules/@codemirror/lang-css",
"//adev:node_modules/@codemirror/lang-html",
"//adev:node_modules/@codemirror/lang-javascript",
"//adev:node_modules/@codemirror/lang-sass",
"//adev:node_modules/@codemirror/language",
"//adev:node_modules/@codemirror/lint",
"//adev:node_modules/@codemirror/search",
"//adev:node_modules/@codemirror/state",
"//adev:node_modules/@codemirror/view",
"//adev:node_modules/@lezer/common",
"//adev:node_modules/@lezer/highlight",
"//adev:node_modules/@lezer/javascript",
"//adev:node_modules/@stackblitz/sdk",
"//adev:node_modules/@typescript/vfs",
"//adev:node_modules/@webcontainer/api",
"//adev:node_modules/@xterm/addon-fit",
"//adev:node_modules/@xterm/xterm",
"//adev:node_modules/algoliasearch",
"//adev:node_modules/angular-split",
"//adev:node_modules/fflate",
"//adev:node_modules/marked",
"//adev:node_modules/ngx-progressbar",
"//adev:node_modules/open-in-idx",
"//adev:node_modules/typescript",
"//adev:node_modules/xhr2",
"//adev:node_modules/@types/node",
"//adev:node_modules/@types/dom-navigation",
# Deep imports
"//adev:node_modules/@algolia/client-common",
"//adev:node_modules/@algolia/requester-browser-xhr",
"//adev:node_modules/@algolia/requester-node-http",
"//adev:node_modules/@lezer/css",
"//adev:node_modules/@lezer/html",
"//adev:node_modules/@lezer/lr",
"//adev:node_modules/@lezer/sass",
"//adev:node_modules/@marijn/find-cluster-break",
"//adev:node_modules/crelt",
"//adev:node_modules/style-mod",
"//adev:node_modules/w3c-keyname",
]
TEST_DEPS = APPLICATION_DEPS + [
"@npm//@types/jasmine",
"@npm//@types/node",
"@npm//jasmine",
"@npm//jasmine-core",
"@npm//karma-chrome-launcher",
"@npm//karma-coverage",
"@npm//karma-jasmine",
"@npm//karma-jasmine-html-reporter",
TEST_FILES = APPLICATION_FILES + [
"karma.conf.js",
"test-main.ts",
] + glob(["src/**/*.spec.ts"])
TEST_DEPS = [
dep
for dep in APPLICATION_DEPS
if dep != "//adev:node_modules/@types/node"
] + [
"@rules_browsers//src/browsers/chromium",
"@rules_browsers//src/browsers/firefox",
"//adev/tools:windows-chromium-path",
]
# Create `npm_link` targets for all dependencies that correspond to a
# first-party Angular package that can be built from `HEAD`.
link_local_packages(
all_deps = collections.uniq(APPLICATION_DEPS + TEST_DEPS),
)
copy_to_bin(
name = "application_files_bin",
srcs = APPLICATION_FILES,
)
ng_config(name = "ng_config")
bool_flag(
name = "full_build_adev",
@@ -146,57 +124,38 @@ config_based_architect_env = select({
config_based_architect_flags = select({
":dev_build": [
"angular-dev:build:development",
"--configuration",
"development",
],
":prod_build": [
"angular-dev:build:production",
"--configuration",
"production",
],
})
architect(
ng_application(
name = "build",
args = config_based_architect_flags + [
"--output-path=build",
"",
],
chdir = "$(RULEDIR)",
data = ensure_local_package_deps(APPLICATION_DEPS) + APPLICATION_ASSETS + [
":application_files_bin",
],
srcs = APPLICATION_FILES + APPLICATION_DEPS,
args = config_based_architect_flags,
env = config_based_architect_env,
# Network is required to inline fonts.
exec_properties = ENABLE_NETWORK,
output_dir = True,
tags = [
"no-remote-exec",
],
ng_config = ":ng_config",
node_modules = "//adev:node_modules",
project_name = "angular-dev",
)
http_server(
name = "serve",
additional_root_paths = [
"angular/adev/build/browser",
],
enable_dev_ui = True,
relax_cors = True,
deps = [":build"],
)
architect_test(
ng_test(
name = "test",
args = [
"angular-dev:test",
"--no-watch",
],
chdir = package_name(),
data = ensure_local_package_deps(TEST_DEPS) + TEST_FILES + APPLICATION_ASSETS + [
"//adev/tools:windows-chromium-path",
"@npm//@angular/build-tooling/bazel/browsers/chromium",
],
srcs = TEST_FILES + TEST_DEPS,
env = {
"CHROME_BIN": "../$(CHROMIUM)",
# Move one level up because we are in `//adev`
"CHROME_BIN": "../" + "$(CHROME-HEADLESS-SHELL)",
"CHROMEDRIVER_BIN": "../" + "$(CHROMEDRIVER)",
},
ng_config = ":ng_config",
node_modules = "//adev:node_modules",
project_name = "angular-dev",
toolchains = [
"@npm//@angular/build-tooling/bazel/browsers/chromium:toolchain_alias",
"@rules_browsers//src/browsers/chromium:toolchain_alias",
"@rules_browsers//src/browsers/firefox:toolchain_alias",
],
)
+3 -15
View File
@@ -20,16 +20,8 @@
"builder": "@angular/build:application",
"options": {
"externalDependencies": ["path"],
"define": {
// We need this until xterm 5.6.0 is released
// see https://github.com/xtermjs/xterm.js/pull/4940
"self": "this"
},
// Ensures we don't escape sandbox to the workspace root with the full node modules that
// might contain e.g. `@angular/core` from npm.
"preserveSymlinks": true,
"outputMode": "static",
"outputPath": "dist/angular-dev",
"outputPath": "dist",
"index": "src/index.html",
"browser": "src/main.ts",
"server": "src/main.server.ts",
@@ -40,16 +32,14 @@
"src/favicon.ico",
"src/robots.txt",
"src/assets",
"src/llms.txt",
"src/llms-full.txt",
"src/context"
"src/context",
"src/llms.txt"
],
"styles": ["@angular/docs/styles/global-styles.scss", "./src/local-styles.scss"],
"scripts": [],
"webWorkerTsConfig": "tsconfig.worker.json",
"optimization": {
"fonts": {
// TODO(josephperrott): enabled inline scripts
"inline": false
}
}
@@ -111,8 +101,6 @@
"cli": {
"analytics": "dca119a9-da31-47f7-a6cb-b60541037021",
"cache": {
// Disable build caching as the cache folder will just be dropped
// when run under Bazel sandboxed execution.
"enabled": false
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const {getAdjustedChromeBinPathForWindows} = require('../adev/tools/windows-chromium-path');
const {getAdjustedChromeBinPathForWindows} = require('./tools/windows-chromium-path');
process.env.CHROME_BIN = getAdjustedChromeBinPathForWindows();
+85
View File
@@ -0,0 +1,85 @@
{
"dependencies": {
"@angular-devkit/build-angular": "20.0.5",
"@angular/animations": "workspace:*",
"@angular/build": "20.0.5",
"@angular/cdk": "20.0.5",
"@angular/cli": "20.0.5",
"@angular/common": "workspace:*",
"@angular/compiler-cli": "workspace:*",
"@angular/compiler": "workspace:*",
"@angular/core": "workspace:*",
"@angular/docs": "workspace:*",
"@angular/forms": "workspace:*",
"@angular/material": "20.0.5",
"@angular/platform-browser": "workspace:*",
"@angular/platform-server": "workspace:*",
"@angular/router": "workspace:*",
"@angular/ssr": "20.0.5",
"@bazel/runfiles": "6.3.1",
"@codemirror/autocomplete": "6.18.6",
"@codemirror/commands": "6.8.1",
"@codemirror/lang-angular": "0.1.4",
"@codemirror/lang-css": "6.3.1",
"@codemirror/lang-html": "6.4.9",
"@codemirror/lang-javascript": "6.2.4",
"@codemirror/lang-sass": "6.0.2",
"@codemirror/language": "6.11.2",
"@codemirror/lint": "6.8.5",
"@codemirror/search": "6.5.11",
"@codemirror/state": "6.5.2",
"@codemirror/view": "6.38.0",
"@lezer/common": "1.2.3",
"@lezer/highlight": "1.2.1",
"@lezer/javascript": "1.5.1",
"@stackblitz/sdk": "1.11.0",
"@types/dom-navigation": "1.0.5",
"@types/jasmine": "5.1.8",
"@types/jsdom": "21.1.7",
"@types/node": "24.0.10",
"@typescript/vfs": "1.6.1",
"@webcontainer/api": "1.6.1",
"@xterm/addon-fit": "0.10.0",
"@xterm/xterm": "5.5.0",
"algoliasearch": "5.31.0",
"angular-split": "19.0.0",
"diff": "8.0.2",
"emoji-regex": "10.4.0",
"fflate": "0.8.2",
"html-entities": "2.6.0",
"jasmine-core": "5.8.0",
"jsdom": "26.1.0",
"karma-chrome-launcher": "3.2.0",
"karma-coverage": "2.2.1",
"karma-jasmine-html-reporter": "2.1.0",
"karma-jasmine": "5.1.0",
"marked": "16.0.0",
"mermaid": "11.8.1",
"ngx-progressbar": "14.0.0",
"open-in-idx": "0.1.1",
"playwright-core": "1.53.2",
"preact-render-to-string": "6.5.13",
"preact": "10.26.9",
"prettier": "3.6.2",
"rxjs": "7.8.2",
"shiki": "3.7.0",
"tinyglobby": "0.2.14",
"tslib": "2.8.1",
"typescript": "5.8.3",
"xhr2": "0.2.1",
"zone.js": "0.15.1",
"@algolia/client-common": "5.31.0",
"@algolia/requester-browser-xhr": "5.31.0",
"@algolia/requester-node-http": "5.31.0",
"@lezer/css": "1.3.0",
"@lezer/html": "1.3.10",
"@lezer/lr": "1.4.2",
"@lezer/sass": "1.1.0",
"@marijn/find-cluster-break": "1.0.2",
"crelt": "1.0.6",
"style-mod": "4.1.2",
"w3c-keyname": "2.2.8"
}
}
+4 -4
View File
@@ -22,7 +22,7 @@ rules_js_tsconfig(
],
deps = [
":tsconfig_build",
"//:node_modules/@types/jasmine",
"//adev:node_modules/@types/jasmine",
],
)
@@ -53,12 +53,12 @@ ng_package(
"//adev/shared-docs/pipeline:_playground.bzl",
"//adev/shared-docs/pipeline:_stackblitz.bzl",
"//adev/shared-docs/pipeline:_tutorial.bzl",
"//adev/shared-docs/pipeline:playground.mjs",
"//adev/shared-docs/pipeline:stackblitz.mjs",
"//adev/shared-docs/pipeline:tutorial.mjs",
"//adev/shared-docs/pipeline/examples/stackblitz:stackblitz.mjs",
"//adev/shared-docs/pipeline/examples/template:files",
"//adev/shared-docs/pipeline/guides:guides.mjs",
"//adev/shared-docs/pipeline/guides:guides-no-mermaid.mjs",
"//adev/shared-docs/pipeline/tutorials:playground.mjs",
"//adev/shared-docs/pipeline/tutorials:tutorial.mjs",
"//adev/shared-docs/pipeline/tutorials/common:files",
"//adev/shared-docs/styles",
],
@@ -15,6 +15,6 @@ ng_project(
"//adev/shared-docs/components/search-dialog:__pkg__",
],
deps = [
"//packages/core:core_rjs",
"//adev:node_modules/@angular/core",
],
)
@@ -1,5 +1,5 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -17,11 +17,11 @@ ng_project(
"//adev/shared-docs/components/viewers:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -38,13 +38,11 @@ ts_project(
),
deps = [
":breadcrumb_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
@@ -12,7 +12,7 @@ import {Breadcrumb} from './breadcrumb.component';
import {NavigationState} from '../../services';
import {NavigationItem} from '../../interfaces';
import {By} from '@angular/platform-browser';
import {RouterTestingModule} from '@angular/router/testing';
import {provideRouter} from '@angular/router';
import {provideZonelessChangeDetection} from '@angular/core';
describe('Breadcrumb', () => {
@@ -23,8 +23,9 @@ describe('Breadcrumb', () => {
navigationStateSpy = jasmine.createSpyObj('NavigationState', ['activeNavigationItem']);
TestBed.configureTestingModule({
imports: [Breadcrumb, RouterTestingModule],
imports: [Breadcrumb],
providers: [
provideRouter([]),
provideZonelessChangeDetection(),
{
provide: NavigationState,
@@ -1,5 +1,5 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -16,10 +16,10 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/utils:utils_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
],
)
@@ -36,10 +36,9 @@ ts_project(
),
deps = [
":cookie-popup_rjs",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/testing:testing_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
],
)
@@ -1,7 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults.bzl", "karma_web_test_suite")
package(default_visibility = ["//visibility:private"])
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
ng_project(
name = "copy-source-code-button",
@@ -16,10 +13,10 @@ ng_project(
"//adev/shared-docs/components/viewers:__pkg__",
],
deps = [
"//:node_modules/@angular/cdk",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/components/icon:icon_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
],
)
@@ -31,14 +28,13 @@ ts_project(
),
deps = [
":copy-source-code-button_rjs",
"//:node_modules/@angular/cdk",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
],
)
karma_web_test_suite(
ng_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
+2 -2
View File
@@ -21,8 +21,8 @@ ng_project(
"//adev/shared-docs/components/viewers:__pkg__",
],
deps = [
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
],
)
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults.bzl", "karma_web_test_suite")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -17,14 +16,14 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//:node_modules/@angular/material",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/material",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/icon:icon_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/pipes:pipes_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -44,17 +43,15 @@ ts_project(
),
deps = [
":navigation-list_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
karma_web_test_suite(
ng_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -7,15 +7,20 @@
<li class="docs-faceted-list-item">
@if (item.path) {
@if (item.isExternal) {
<a
[href]="item.path" target="_blank"
<a
[href]="item.path"
target="_blank"
[matTooltip]="item.label"
[matTooltipDisabled]="item.label.length < 27"
matTooltipPosition="after"
[attr.aria-label]="item.label"
[matTooltipClass]="'API-tooltip'"
>
<span [class.docs-external-link]="item.isExternal" class="docs-faceted-list-item-text">{{ item.label }}</span>
<span
[class.docs-external-link]="item.isExternal"
class="docs-faceted-list-item-text"
>{{ item.label }}</span
>
@if (item.children && item.level! > 1 && !item.isExpanded) {
<docs-icon>chevron_right</docs-icon>
}
@@ -23,13 +28,6 @@
} @else {
<a
[routerLink]="'/' + item.path"
routerLinkActive="docs-faceted-list-item-active"
[routerLinkActiveOptions]="{ exact: true }"
(click)="emitClickOnLink()"
@@ -48,7 +46,8 @@
} @else {
<!-- Nav Section Header -->
@if (item.level !== collapsableLevel() && item.level !== expandableLevel()) {
<div class="docs-secondary-nav-header"
<div
class="docs-secondary-nav-header"
[matTooltip]="item.label"
[matTooltipDisabled]="item.label.length < 27"
matTooltipPosition="after"
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults.bzl", "karma_web_test_suite")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -17,8 +16,12 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//:node_modules/@angular/cdk",
"//:node_modules/rxjs",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/forms",
"//adev:node_modules/@angular/router",
"//adev:node_modules/rxjs",
"//adev/shared-docs/components/algolia-icon:algolia-icon_rjs",
"//adev/shared-docs/components/search-history:search-history_rjs",
"//adev/shared-docs/components/text-field:text-field_rjs",
@@ -26,10 +29,6 @@ ng_project(
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/pipes:pipes_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/forms:forms_rjs",
"//packages/router:router_rjs",
],
)
@@ -46,20 +45,18 @@ ts_project(
),
deps = [
":search-dialog_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/algolia-icon:algolia-icon_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/services:services_rjs",
"//adev/shared-docs/testing:testing_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
karma_web_test_suite(
ng_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -14,8 +14,7 @@ import {ALGOLIA_CLIENT, Search} from '../../services';
import {FakeEventTarget} from '../../testing/index';
import {By} from '@angular/platform-browser';
import {AlgoliaIcon} from '../algolia-icon/algolia-icon.component';
import {RouterTestingModule} from '@angular/router/testing';
import {Router} from '@angular/router';
import {Router, provideRouter} from '@angular/router';
import {ApplicationRef, provideZonelessChangeDetection, ResourceStatus} from '@angular/core';
import {SearchResult} from '../../interfaces';
@@ -32,8 +31,9 @@ describe('SearchDialog', () => {
searchResults.and.returnValue([]);
TestBed.configureTestingModule({
imports: [SearchDialog, RouterTestingModule],
imports: [SearchDialog],
providers: [
provideRouter([]),
provideZonelessChangeDetection(),
{provide: ENVIRONMENT, useValue: {algolia: {index: 'fakeIndex'}}},
{provide: ALGOLIA_CLIENT, useValue: {search: searchResults}},
@@ -84,7 +84,7 @@ export class SearchDialog {
this.searchQuery.set(value);
});
// Thinkig about refactoring this to a single afterRenderEffect ?
// Thinking about refactoring this to a single afterRenderEffect ?
// Answer: It won't have the same behavior
effect(() => {
this.items();
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults.bzl", "karma_web_test_suite")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -23,12 +22,12 @@ ng_project(
"//adev/shared-docs/components/search-dialog:__pkg__",
],
deps = [
"//:node_modules/@angular/cdk",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/directives:directives_rjs",
"//adev/shared-docs/pipes:pipes_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -38,15 +37,14 @@ ts_project(
srcs = ["search-history.component.spec.ts"],
deps = [
":search-history_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev/shared-docs/services:services_rjs",
"//adev/shared-docs/testing:testing_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
],
)
karma_web_test_suite(
ng_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -1,5 +1,5 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -16,9 +16,9 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/forms:forms_rjs",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/forms",
],
)
@@ -35,8 +35,7 @@ ts_project(
),
deps = [
":select_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//adev:node_modules/@angular/core",
],
)
@@ -1,5 +1,5 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -16,9 +16,9 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/forms:forms_rjs",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/forms",
],
)
@@ -35,8 +35,7 @@ ts_project(
),
deps = [
":slide-toggle_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//adev:node_modules/@angular/core",
],
)
@@ -1,5 +1,5 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -17,12 +17,12 @@ ng_project(
"//adev/shared-docs/components/viewers:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/icon:icon_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -42,13 +42,11 @@ ts_project(
),
deps = [
":table-of-contents_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
@@ -8,7 +8,7 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {TableOfContents} from './table-of-contents.component';
import {RouterTestingModule} from '@angular/router/testing';
import {provideRouter} from '@angular/router';
import {TableOfContentsItem, TableOfContentsLevel} from '../../interfaces/index';
import {TableOfContentsLoader} from '../../services/index';
import {WINDOW} from '../../providers/index';
@@ -41,8 +41,9 @@ describe('TableOfContents', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [TableOfContents, RouterTestingModule],
imports: [TableOfContents],
providers: [
provideRouter([]),
provideZonelessChangeDetection(),
{
provide: WINDOW,
@@ -1,5 +1,5 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -17,10 +17,10 @@ ng_project(
"//adev/shared-docs/components/search-dialog:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/forms",
"//adev/shared-docs/components/icon:icon_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/forms:forms_rjs",
],
)
@@ -37,8 +37,7 @@ ts_project(
),
deps = [
":text-field_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//adev:node_modules/@angular/core",
],
)
@@ -1,5 +1,5 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite", "sass_binary")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -16,11 +16,11 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/components/icon:icon_rjs",
"//adev/shared-docs/directives:directives_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
],
)
@@ -37,9 +37,8 @@ ts_project(
),
deps = [
":top-level-banner_rjs",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/providers:providers_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
],
)
+14 -18
View File
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults.bzl", "karma_web_test_suite")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
load("//tools:defaults2.bzl", "sass_binary")
package(default_visibility = ["//visibility:private"])
@@ -19,17 +18,17 @@ ng_project(
"//adev/shared-docs/components:__pkg__",
],
deps = [
"//:node_modules/@angular/cdk",
"//:node_modules/@angular/material",
"//:node_modules/rxjs",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/material",
"//adev:node_modules/@angular/router",
"//adev:node_modules/rxjs",
"//adev/shared-docs/components/breadcrumb:breadcrumb_rjs",
"//adev/shared-docs/components/copy-source-code-button:copy-source-code-button_rjs",
"//adev/shared-docs/components/table-of-contents:table-of-contents_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -54,8 +53,11 @@ ts_project(
),
deps = [
":viewers_rjs",
"//:node_modules/@angular/cdk",
"//:node_modules/@angular/material",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/material",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/breadcrumb:breadcrumb_rjs",
"//adev/shared-docs/components/copy-source-code-button:copy-source-code-button_rjs",
"//adev/shared-docs/components/icon:icon_rjs",
@@ -63,16 +65,10 @@ ts_project(
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/services:services_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/platform-browser/animations:animations_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
karma_web_test_suite(
ng_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {CommonModule, DOCUMENT, isPlatformBrowser, Location} from '@angular/common';
import {DOCUMENT, isPlatformBrowser, Location} from '@angular/common';
import {
ApplicationRef,
ChangeDetectionStrategy,
@@ -18,9 +18,7 @@ import {
EnvironmentInjector,
inject,
Injector,
Input,
PLATFORM_ID,
SimpleChanges,
Type,
ViewContainerRef,
ViewEncapsulation,
@@ -270,7 +270,7 @@ describe('ExampleViewer', () => {
By.css('button.docs-example-copy-link'),
).nativeElement;
button.click();
expect(spy.calls.argsFor(0)[0].trim()).toBe(`${window.origin}/context.html#example-1`);
expect(spy.calls.argsFor(0)[0].trim()).toBe(`${window.location.href}#example-1`);
}));
});
+23 -3
View File
@@ -1,25 +1,45 @@
load("//tools:defaults2.bzl", _ng_project = "ng_project", _ts_project = "ts_project")
load(
"//tools:defaults2.bzl",
_ng_project = "ng_project",
_ng_web_test_suite = "ng_web_test_suite",
_ts_project = "ts_project",
)
def ts_project(name, tsconfig = None, testonly = False, **kwargs):
def ts_project(name, tsconfig = None, testonly = False, enable_runtime_rnjs_interop = False, **kwargs):
if tsconfig == None:
if native.package_name().startswith("adev/shared-docs"):
tsconfig = "//adev/shared-docs:tsconfig_test" if testonly else "//adev/shared-docs:tsconfig_build"
_ts_project(
name = name,
enable_runtime_rnjs_interop = enable_runtime_rnjs_interop,
tsconfig = tsconfig,
testonly = testonly,
**kwargs
)
def ng_project(name, tsconfig = None, testonly = False, **kwargs):
def ng_project(name, tsconfig = None, testonly = False, enable_runtime_rnjs_interop = False, **kwargs):
if tsconfig == None:
if native.package_name().startswith("adev/shared-docs"):
tsconfig = "//adev/shared-docs:tsconfig_test" if testonly else "//adev/shared-docs:tsconfig_build"
_ng_project(
name = name,
enable_runtime_rnjs_interop = enable_runtime_rnjs_interop,
tsconfig = tsconfig,
testonly = testonly,
**kwargs
)
def ng_web_test_suite(deps = [], **kwargs):
# Provide required modules for the imports in //tools/testing/browser_tests.init.mts
deps = deps + [
"//:node_modules/@angular/compiler",
"//:node_modules/@angular/core",
"//:node_modules/@angular/platform-browser",
]
_ng_web_test_suite(
deps = deps,
tsconfig = "//adev/shared-docs:tsconfig_test",
**kwargs
)
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
package(default_visibility = ["//visibility:private"])
@@ -12,8 +11,8 @@ ng_project(
"//adev/shared-docs/directives:__pkg__",
],
deps = [
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
],
)
@@ -25,11 +24,9 @@ ts_project(
),
deps = [
":click-outside_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
],
)
@@ -8,7 +8,7 @@
import {Component} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {provideRouter} from '@angular/router';
import {ClickOutside} from './click-outside.directive';
import {By} from '@angular/platform-browser';
@@ -18,7 +18,8 @@ describe('ClickOutside', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ExampleComponent, RouterTestingModule],
imports: [ExampleComponent],
providers: [provideRouter([])],
});
fixture = TestBed.createComponent(ExampleComponent);
component = fixture.componentInstance;
@@ -1,5 +1,4 @@
load("//adev/shared-docs:defaults.bzl", "ng_project", "ts_project")
load("//tools:defaults2.bzl", "ng_web_test_suite")
load("//adev/shared-docs:defaults.bzl", "ng_project", "ng_web_test_suite", "ts_project")
package(default_visibility = ["//visibility:private"])
@@ -12,11 +11,11 @@ ng_project(
"//adev/shared-docs/directives:__pkg__",
],
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/utils:utils_rjs",
"//packages/common:common_rjs",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
],
)
@@ -28,12 +27,10 @@ ts_project(
),
deps = [
":external-link_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/providers:providers_rjs",
"//packages/core:core_rjs",
"//packages/core/testing:testing_rjs",
"//packages/platform-browser:platform-browser_rjs",
"//packages/router:router_rjs",
"//packages/router/testing:testing_rjs",
],
)
@@ -8,10 +8,9 @@
import {Component} from '@angular/core';
import {ExternalLink} from './external-link.directive';
import {RouterLink} from '@angular/router';
import {provideRouter, RouterLink} from '@angular/router';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {WINDOW} from '../../providers';
import {RouterTestingModule} from '@angular/router/testing';
import {By} from '@angular/platform-browser';
describe('ExternalLink', () => {
@@ -24,8 +23,9 @@ describe('ExternalLink', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [ExampleComponentWithLinks, RouterTestingModule],
imports: [ExampleComponentWithLinks],
providers: [
provideRouter([]),
{
provide: WINDOW,
useValue: fakeWindow,
@@ -11,8 +11,8 @@ ng_project(
"//adev/shared-docs/directives:__pkg__",
],
deps = [
"//:node_modules/@angular/cdk",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//packages/core:core_rjs",
],
)
+4 -4
View File
@@ -25,9 +25,9 @@ ts_project(
],
),
deps = [
"//:node_modules/@types/node",
"//:node_modules/@webcontainer/api",
"//packages/core:core_rjs",
"//packages/router:router_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev:node_modules/@types/node",
"//adev:node_modules/@webcontainer/api",
],
)
+21 -113
View File
@@ -1,10 +1,4 @@
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
# BEGIN-DEV-ONLY
# This section is only used here in the dev-infra repo as the resulting bundle is published in
# the package.
load("//tools:defaults.bzl", "esbuild_esm_bundle")
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_library")
package(default_visibility = ["//adev/shared-docs/pipeline:__subpackages__"])
@@ -13,90 +7,6 @@ js_library(
srcs = ["esbuild.config.mjs"],
)
esbuild_esm_bundle(
name = "stackblitz-bundle",
entry_point = "//adev/shared-docs/pipeline/examples/stackblitz:index.mts",
# JSDOM should not be bundled because it has workers and dynamic imports.
external = ["jsdom"],
metafile = False,
output = "stackblitz.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/examples/stackblitz:index",
],
)
esbuild_esm_bundle(
name = "previews-bundle",
entry_point = "//adev/shared-docs/pipeline/examples/previews:index.mts",
external = [
"typescript",
],
metafile = False,
output = "previews.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/examples/previews:index",
"@npm//typescript",
],
)
esbuild_esm_bundle(
name = "zip-bundle",
entry_point = "//adev/shared-docs/pipeline/examples/zip:index.mts",
metafile = False,
output = "zip.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/examples/zip:index",
],
)
esbuild_esm_bundle(
name = "playground-bundle",
entry_point = "//adev/shared-docs/pipeline/tutorials:playground.mts",
metafile = False,
output = "playground.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/tutorials:playground",
],
)
esbuild_esm_bundle(
name = "tutorial-bundle",
entry_point = "//adev/shared-docs/pipeline/tutorials:tutorial.mts",
metafile = False,
output = "tutorial.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/tutorials",
],
)
esbuild_esm_bundle(
name = "navigation-bundle",
entry_point = "//adev/shared-docs/pipeline/navigation:index.mts",
metafile = False,
output = "navigation.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/navigation",
],
)
exports_files([
"_guides.bzl",
"_stackblitz.bzl",
@@ -107,38 +17,36 @@ exports_files([
"BUILD.bazel",
])
# END-DEV-ONLY
nodejs_binary(
js_binary(
name = "stackblitz",
data = [
"@npm//jsdom",
"//adev:node_modules/jsdom",
],
entry_point = "//adev/shared-docs/pipeline:stackblitz.mjs",
entry_point = "//adev/shared-docs/pipeline/examples/stackblitz:stackblitz.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "previews",
data = [
"@npm//typescript",
"//adev:node_modules/typescript",
],
entry_point = "//adev/shared-docs/pipeline:previews.mjs",
entry_point = "//adev/shared-docs/pipeline/examples/previews:previews.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "zip",
entry_point = "//adev/shared-docs/pipeline:zip.mjs",
entry_point = "//adev/shared-docs/pipeline/examples/zip:zip.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "markdown",
data = [
"@npm//jsdom",
"@npm//mermaid",
"@npm//playwright-core",
"//adev:node_modules/jsdom",
"//adev:node_modules/mermaid",
"//adev:node_modules/playwright-core",
"@rules_browsers//src/browsers/chromium",
],
entry_point = "//adev/shared-docs/pipeline/guides:guides.mjs",
@@ -149,29 +57,29 @@ nodejs_binary(
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "markdown_no_mermaid",
data = [
"@npm//jsdom",
"//adev:node_modules/jsdom",
],
entry_point = "//adev/shared-docs/pipeline/guides:guides-no-mermaid.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "playground",
entry_point = "//adev/shared-docs/pipeline:playground.mjs",
entry_point = "//adev/shared-docs/pipeline/tutorials:playground.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "tutorial",
entry_point = "//adev/shared-docs/pipeline:tutorial.mjs",
entry_point = "//adev/shared-docs/pipeline/tutorials:tutorial.mjs",
visibility = ["//visibility:public"],
)
nodejs_binary(
js_binary(
name = "navigation",
entry_point = "//adev/shared-docs/pipeline:navigation.mjs",
entry_point = "//adev/shared-docs/pipeline/navigation:navigation.mjs",
visibility = ["//visibility:public"],
)
+10 -7
View File
@@ -1,4 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
load("@devinfra//bazel/private:path_relative_to_label.bzl", "path_relative_to_label")
def _generate_guides(ctx):
@@ -33,20 +32,24 @@ def _generate_guides(ctx):
# Define an action that runs the nodejs_binary executable. This is the main thing that this
# rule does. If mermaid blocks are enabled then a different executable is used.
if (ctx.attr.mermaid_blocks):
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.srcs + ctx.files.data),
executable = "_generate_guides",
executable = ctx.executable._generate_guides,
outputs = html_outputs,
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
else:
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.srcs + ctx.files.data),
executable = "_generate_guides_no_mermaid",
executable = ctx.executable._generate_guides_no_mermaid,
outputs = html_outputs,
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -5
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_nav_items(ctx):
"""Implementation of the navigation items data generator rule"""
@@ -25,12 +23,14 @@ def _generate_nav_items(ctx):
# Add the path to the output file to the arguments.
args.add(json_output.path)
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.srcs),
executable = "_generate_nav_items",
executable = ctx.executable._generate_nav_items,
outputs = [json_output],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -5
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_playground(ctx):
"""Implementation of the playground generator rule"""
@@ -29,12 +27,14 @@ def _generate_playground(ctx):
ctx.runfiles(files = ctx.files.common_srcs)
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.playground_srcs + ctx.files.common_srcs),
executable = "_generate_playground",
executable = ctx.executable._generate_playground,
outputs = [playground_directory],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -5
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_previews_impl(ctx):
"""Implementation of the previews generator rule"""
@@ -20,12 +18,14 @@ def _generate_previews_impl(ctx):
ctx.runfiles(files = ctx.files._template_src)
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.example_srcs + ctx.files._template_src),
executable = "_generate_previews",
executable = ctx.executable._generate_previews,
outputs = [ts_output],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -4
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_stackblitz(ctx):
"""Implementation of the stackblitz generator rule"""
@@ -35,12 +33,15 @@ def _generate_stackblitz(ctx):
ctx.runfiles(files = ctx.files.template_srcs)
run_node(
ctx.actions.run(
ctx = ctx,
inputs = depset(ctx.files.example_srcs + ctx.files.template_srcs),
executable = "_generate_stackblitz",
executable = ctx.executable._generate_stackblitz,
outputs = [html_output, tmp_directory],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -5
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_tutorial(ctx):
"""Implementation of the tutorial generator rule"""
@@ -29,12 +27,14 @@ def _generate_tutorial(ctx):
ctx.runfiles(files = ctx.files.common_srcs)
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.tutorial_srcs + ctx.files.common_srcs),
executable = "_generate_tutorial",
executable = ctx.executable._generate_tutorial,
outputs = [tutorial_directory],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
+5 -4
View File
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_zip(ctx):
"""Implementation of the zip generator rule"""
@@ -35,12 +33,15 @@ def _generate_zip(ctx):
ctx.runfiles(files = ctx.files.template_srcs)
run_node(
ctx.actions.run(
ctx = ctx,
inputs = depset(ctx.files.example_srcs + ctx.files.template_srcs),
executable = "_generate_zip",
executable = ctx.executable._generate_zip,
outputs = [zip_output, tmp_directory],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
@@ -15,9 +15,9 @@ ts_project(
# TODO(rules_js): Explore how this could work alternatively at runtime with the module names.
"//adev/shared-docs/pipeline/api-gen:node_modules/@angular/compiler-cli",
"//adev/shared-docs/pipeline/api-gen:node_modules/@angular/compiler",
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/node",
"//:node_modules/typescript",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/node",
"//adev:node_modules/typescript",
],
)
@@ -125,7 +125,7 @@ function getEntriesFromMembers(entry: DocEntry): string[] {
}
function hasMembers(entry: DocEntry): entry is InterfaceEntry | ClassEntry {
return 'members' in entry;
return 'members' in entry && Array.isArray(entry.members);
}
main();
@@ -55,7 +55,7 @@ ts_project(
"@angular//packages/compiler-cli",
],
deps = [
"//:node_modules/@types/node",
"//adev:node_modules/@types/node",
"//adev/shared-docs/pipeline/api-gen/extraction:extract_api_to_json_lib_rjs",
],
)
@@ -1,34 +1,32 @@
load("@angular//tools/esm-interop:index.bzl", "nodejs_binary")
load("@devinfra//bazel/esbuild:index.bzl", "esbuild_esm_bundle")
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("//adev/shared-docs:defaults.bzl", "ts_project")
package(default_visibility = ["//adev/shared-docs/pipeline/api-gen:__subpackages__"])
esbuild_esm_bundle(
esbuild(
name = "bin",
entry_point = ":index.mts",
external = [
"@angular/compiler-cli",
],
metafile = False,
format = "esm",
output = "bin.mjs",
platform = "node",
target = "es2022",
deps = [
":generate_api_manifest_lib",
"@angular//packages/compiler-cli",
":generate_api_manifest_lib_rjs",
"//adev:node_modules/@angular/compiler-cli",
],
)
ts_project(
name = "generate_api_manifest_lib",
srcs = glob(["**/*.mts"]),
interop_deps = [
"@angular//packages/compiler-cli",
],
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/node",
"//adev:node_modules/@angular/compiler-cli",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/node",
],
)
@@ -1,5 +1,3 @@
load("@build_bazel_rules_nodejs//:providers.bzl", "run_node")
def _generate_api_manifest(ctx):
"""Implementation of the generate_api_manifest rule"""
@@ -19,12 +17,14 @@ def _generate_api_manifest(ctx):
# Define an action that runs the nodejs_binary executable. This is
# the main thing that this rule does.
run_node(
ctx = ctx,
ctx.actions.run(
inputs = depset(ctx.files.srcs),
executable = "_generate_api_manifest",
executable = ctx.executable._generate_api_manifest,
outputs = [manifest],
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
@@ -27,10 +27,8 @@ ts_project(
srcs = [
"manifest.spec.mts",
],
interop_deps = [
"//packages/compiler-cli",
],
deps = [
"//adev:node_modules/@angular/compiler-cli",
"//adev/shared-docs/pipeline/api-gen/manifest:generate_api_manifest_lib_rjs",
],
)
@@ -1,18 +1,18 @@
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")
load("@devinfra//bazel/esbuild:index.bzl", "esbuild_esm_bundle")
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("@aspect_rules_js//js:defs.bzl", "js_binary")
load("//adev/shared-docs:defaults.bzl", "ts_project")
package(default_visibility = ["//adev/shared-docs/pipeline/api-gen:__subpackages__"])
esbuild_esm_bundle(
esbuild(
name = "bin",
entry_point = ":index.mts",
metafile = False,
format = "esm",
output = "bin.mjs",
platform = "node",
target = "es2022",
deps = [
":render_api_to_html_lib",
":render_api_to_html_lib_rjs",
],
)
@@ -28,16 +28,17 @@ ts_project(
"entities.mts",
],
),
enable_runtime_rnjs_interop = True,
deps = [
":entities_rjs",
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/node",
"//:node_modules/html-entities",
"//:node_modules/marked",
"//:node_modules/preact",
"//:node_modules/preact-render-to-string",
"//:node_modules/prettier",
"//:node_modules/shiki",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/node",
"//adev:node_modules/html-entities",
"//adev:node_modules/marked",
"//adev:node_modules/preact",
"//adev:node_modules/preact-render-to-string",
"//adev:node_modules/prettier",
"//adev:node_modules/shiki",
],
)
@@ -53,7 +54,7 @@ ts_project(
)
# Action binary for the api_gen bazel rule.
nodejs_binary(
js_binary(
name = "render_api_to_html",
data = [
":render_api_to_html_lib",
@@ -62,8 +63,7 @@ nodejs_binary(
# Do not use the NodeJS linker because:
# - it's brittle and causes race conditions on Windows.
# - it requires additional work to setup the runtime linker.
templated_args = [
"--bazel_patch_module_resolver",
fixed_args = [
"--node_options=--preserve-symlinks-main",
],
visibility = ["//visibility:public"],
@@ -120,7 +120,11 @@ export interface EnumEntry extends DocEntry {
/** Documentation entity for an Angular decorator. */
export interface DecoratorEntry extends DocEntry {
decoratorType: DecoratorType;
members: PropertyEntry[];
signatures?: {
parameters: ParameterEntry[];
jsdocTags: JsDocTagEntry[];
}[];
members: MemberEntry[];
}
/** Documentation entity for an Angular directives and components. */
@@ -142,7 +142,10 @@ export function isDeprecatedEntry<T extends HasJsDocTags>(entry: T): boolean {
}
export function getDeprecatedEntry<T extends HasJsDocTags>(entry: T) {
return entry.jsdocTags.find((tag) => tag.name === 'deprecated')?.comment ?? null;
const comment = entry.jsdocTags.find((tag) => tag.name === 'deprecated')?.comment;
// Dropping the eventual version number in front of the comment.
return comment?.match(/(?:\d+(?:\.\d+)?\s*)?(.*)/s)?.[1] ?? null;
}
/** Gets whether the given entry has a given JsDoc tag. */
@@ -70,11 +70,7 @@ export type PipeEntryRenderable = PipeEntry &
members: MemberEntryRenderable[];
};
export type DecoratorEntryRenderable = DecoratorEntry &
DocEntryRenderable &
HasRenderableToc & {
members: MemberEntryRenderable[];
};
export type DecoratorEntryRenderable = DecoratorEntry & DocEntryRenderable & HasRenderableToc;
/** Documentation entity for a TypeScript enum augmented transformed content for rendering. */
export type EnumEntryRenderable = EnumEntry &
@@ -25,6 +25,9 @@ def _render_api_to_html(ctx):
executable = ctx.executable._render_api_to_html,
outputs = outputs,
arguments = [args],
env = {
"BAZEL_BINDIR": ".",
},
)
# The return value describes what the rule is producing. In this case we need to specify
@@ -19,7 +19,11 @@ import {
isInterfaceEntry,
isTypeAliasEntry,
} from './entities/categorization.mjs';
import {CliCommandRenderable, DocEntryRenderable} from './entities/renderables.mjs';
import {
ClassEntryRenderable,
CliCommandRenderable,
DocEntryRenderable,
} from './entities/renderables.mjs';
import {ClassReference} from './templates/class-reference';
import {CliCommandReference} from './templates/cli-reference';
import {ConstantReference} from './templates/constant-reference';
@@ -28,6 +32,7 @@ import {EnumReference} from './templates/enum-reference';
import {FunctionReference} from './templates/function-reference';
import {InitializerApiFunction} from './templates/initializer-api-function';
import {TypeAliasReference} from './templates/type-alias-reference';
import {DecoratorReference} from './templates/decorator-reference';
import {setCurrentSymbol} from './symbol-context.mjs';
/** Given a doc entry, get the transformed version of the entry for rendering. */
@@ -37,8 +42,11 @@ export function renderEntry(renderable: DocEntryRenderable | CliCommandRenderabl
return render(CliCommandReference(renderable));
}
if (isClassEntry(renderable) || isInterfaceEntry(renderable) || isDecoratorEntry(renderable)) {
return render(ClassReference(renderable));
if (isClassEntry(renderable) || isInterfaceEntry(renderable)) {
return render(ClassReference(renderable as ClassEntryRenderable));
}
if (isDecoratorEntry(renderable)) {
return render(DecoratorReference(renderable));
}
if (isConstantEntry(renderable)) {
return render(ConstantReference(renderable));
@@ -43,17 +43,36 @@ export function codeToHtml(code: string, language: string | undefined): string {
return html;
}
/**
* This function is used to post-process the HTML generated by Shiki
*/
export function replaceKeywordFromShikiHtml(
keyword: string,
shikiHtml: string,
replaceWith = '',
replaceWith: string,
): string {
return (
shikiHtml
// remove the leading space of the element after the "function" element
.replace(new RegExp(`(<[^>]*>${keyword}<\\/\\w+><[^>]*>)(\\s)(\\w+<\\/\\w+>)`, 'g'), '$1$3')
// Shiki requires the keyword function for highlighting functions signatures
// We don't want to display it so we remove elements with the keyword
.replace(new RegExp(`<[^>]*>${keyword}<\\/\\w+>`, 'g'), replaceWith)
// remove the leading space of the element after the keyword
.replace(
new RegExp(`(<[^>]*>(?:${keyword})<\\/\\w+><[^>]*>)(\\s)(\\w+<\\/\\w+>)`, 'g'),
'$1$3',
)
// Shiki requires the keywords (eg. function,interface) for highlighting signatures
// here we are replacing it
.replace(new RegExp(`<[^>]*>(?:${keyword})<\\/\\w+>`, 'g'), replaceWith)
);
}
export function insertParenthesesForDecoratorInShikiHtml(shikiHtml: string): string {
// TODO: Look if we can use JSDom instead of regex
return shikiHtml.replace(
// This will match a structure like this:
// @<span>decoratorName</span><span> {</span><span>...</span><span> }</span>
// and insert a parenthese around the curly braces
// @<span>decoratorName</span><span> ({</span><span>...</span><span> })</span>
/(@\s*<[^>]*>.*?<\/\w+>\s*<[^>]*>)(\s*\{)(<\/\w+>.*<[^>]*>)(\s*\})(<\/\w+>)/gms,
'$1({$3})$5',
);
}
@@ -8,11 +8,7 @@
import {Fragment, h} from 'preact';
import {PipeEntry} from '../entities.mjs';
import {
ClassEntryRenderable,
DecoratorEntryRenderable,
PipeEntryRenderable,
} from '../entities/renderables.mjs';
import {ClassEntryRenderable, PipeEntryRenderable} from '../entities/renderables.mjs';
import {ClassMemberList} from './class-member-list';
import {HeaderApi} from './header-api';
import {
@@ -26,11 +22,10 @@ import {SectionApi} from './section-api';
import {SectionHeading} from './section-heading';
import {codeToHtml} from '../shiki/shiki.mjs';
import {RawHtml} from './raw-html';
import {DeprecationWarning} from './deprecation-warning';
/** Component to render a class API reference document. */
export function ClassReference(
entry: ClassEntryRenderable | DecoratorEntryRenderable | PipeEntryRenderable,
) {
export function ClassReference(entry: ClassEntryRenderable | PipeEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
@@ -44,6 +39,7 @@ export function ClassReference(
) : (
''
)}
<DeprecationWarning entry={entry} />
<SectionApi entry={entry} />
{entry.members.length > 0 ? (
<div class={REFERENCE_MEMBERS}>
@@ -13,12 +13,14 @@ import {SectionDescription} from './section-description';
import {SectionUsageNotes} from './section-usage-notes';
import {SectionApi} from './section-api';
import {API_REFERENCE_CONTAINER} from '../styling/css-classes.mjs';
import {DeprecationWarning} from './deprecation-warning';
/** Component to render a constant API reference document. */
export function ConstantReference(entry: ConstantEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<DeprecationWarning entry={entry} />
<SectionApi entry={entry} />
<SectionDescription entry={entry} />
<SectionUsageNotes entry={entry} />
@@ -0,0 +1,27 @@
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {h} from 'preact';
import {HeaderApi} from './header-api';
import {SectionDescription} from './section-description';
import {SectionUsageNotes} from './section-usage-notes';
import {SectionApi} from './section-api';
import {API_REFERENCE_CONTAINER} from '../styling/css-classes.mjs';
import {DecoratorEntryRenderable} from '../entities/renderables.mjs';
/** Component to render a decorator API reference document. */
export function DecoratorReference(entry: DecoratorEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<SectionApi entry={entry} />
<SectionDescription entry={entry} />
<SectionUsageNotes entry={entry} />
</div>
);
}
@@ -13,13 +13,16 @@ export function DeprecatedLabel(props: {
entry:
| {deprecated: {version: string | undefined} | undefined}
| {deprecationMessage: string | null};
hideLabel?: true;
}) {
const entry = props.entry;
if ('deprecationMessage' in entry && entry.deprecationMessage !== null) {
return (
<div className={'docs-deprecation-message'}>
<span className={`${PARAM_KEYWORD_CLASS_NAME} docs-deprecated`}>@deprecated</span>
{!props.hideLabel && (
<span className={`${PARAM_KEYWORD_CLASS_NAME} docs-deprecated`}>@deprecated</span>
)}
<span dangerouslySetInnerHTML={{__html: entry.deprecationMessage}}></span>
</div>
);
@@ -0,0 +1,27 @@
/*!
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import {h} from 'preact';
import {DeprecatedLabel} from './deprecated-label';
export function DeprecationWarning(props: {
entry:
| {deprecated: {version: string | undefined} | undefined}
| {deprecationMessage: string | null};
}) {
const entry = props.entry;
return (
'deprecationMessage' in entry &&
entry.deprecationMessage && (
<div class="docs-alert docs-alert-important">
<p>Deprecation warning</p>
<DeprecatedLabel entry={entry} hideLabel={true} />
</div>
)
);
}
@@ -13,12 +13,14 @@ import {SectionDescription} from './section-description';
import {SectionApi} from './section-api';
import {API_REFERENCE_CONTAINER, REFERENCE_MEMBERS} from '../styling/css-classes.mjs';
import {ClassMember} from './class-member';
import {DeprecationWarning} from './deprecation-warning';
/** Component to render a enum API reference document. */
export function EnumReference(entry: EnumEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<DeprecationWarning entry={entry} />
<SectionApi entry={entry} />
{entry.members.length > 0 ? (
<div class={REFERENCE_MEMBERS}>
@@ -27,6 +27,7 @@ import {HighlightTypeScript} from './highlight-ts';
import {SectionApi} from './section-api';
import {SectionDescription} from './section-description';
import {SectionUsageNotes} from './section-usage-notes';
import {DeprecationWarning} from './deprecation-warning';
export const signatureCard = (
name: string,
@@ -70,6 +71,7 @@ export function FunctionReference(entry: FunctionEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<DeprecationWarning entry={entry} />
<SectionApi entry={entry} />
<div className={REFERENCE_MEMBERS}>
{entry.signatures.map((s, i) =>
@@ -13,12 +13,14 @@ import {SectionDescription} from './section-description';
import {SectionUsageNotes} from './section-usage-notes';
import {SectionApi} from './section-api';
import {API_REFERENCE_CONTAINER} from '../styling/css-classes.mjs';
import {DeprecationWarning} from './deprecation-warning';
/** Component to render a type alias API reference document. */
export function TypeAliasReference(entry: TypeAliasEntryRenderable) {
return (
<div className={API_REFERENCE_CONTAINER}>
<HeaderApi entry={entry} />
<DeprecationWarning entry={entry} />
<SectionApi entry={entry} />
<SectionDescription entry={entry} />
<SectionUsageNotes entry={entry} />
@@ -19,9 +19,9 @@ ts_project(
],
),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/api-gen/rendering:render_api_to_html_lib_rjs",
],
)
@@ -30,7 +30,7 @@ jasmine_test(
name = "unit_tests",
data = [
":unit_test_lib_rjs",
"//:node_modules/jsdom",
"//adev:node_modules/jsdom",
] + glob([
"**/*.json",
]),
@@ -12,6 +12,7 @@ import {
FunctionSignatureMetadata,
GenericEntry,
MemberEntry,
DecoratorEntry,
MemberTags,
ParameterEntry,
PropertyEntry,
@@ -34,12 +35,21 @@ import {
import {CodeLineRenderable} from '../entities/renderables.mjs';
import {HasModuleName, HasRenderableToc} from '../entities/traits.mjs';
import {getModuleName} from '../symbol-context.mjs';
import {codeToHtml, replaceKeywordFromShikiHtml} from '../shiki/shiki.mjs';
import {
codeToHtml,
insertParenthesesForDecoratorInShikiHtml,
replaceKeywordFromShikiHtml,
} from '../shiki/shiki.mjs';
import {filterLifecycleMethods, mergeGettersAndSetters} from './member-transforms.mjs';
import {getLinkToModule} from './url-transforms.mjs';
import {formatJs} from './format-code.mjs';
const INDENT = ' ';
const SPACE = ' ';
const LN_BREAK = '\n';
const INDENTED_NEW_LINE = `${LN_BREAK}${INDENT}`;
// Allows to generate links for code lines.
interface CodeTableOfContentsData {
// The contents of code block.
@@ -71,7 +81,7 @@ export async function addRenderableCodeToc<T extends DocEntry & HasModuleName>(
// For now we only format functions with prettier
let formattedCode: string | null = null;
if (entry.entryType === EntryType.Function) {
if (entry.entryType === EntryType.Function || entry.entryType === EntryType.Decorator) {
formattedCode = await formatJs(metadata.contents);
}
@@ -81,12 +91,23 @@ export async function addRenderableCodeToc<T extends DocEntry & HasModuleName>(
// Shiki requires a keyword for correct formating of Decorators
// We use an interface and then replace it with a '@'
codeWithSyntaxHighlighting = replaceKeywordFromShikiHtml(
'interface',
'class|function',
codeWithSyntaxHighlighting,
'@',
);
// if (entry.entryType === EntryType.InterfaceLikeDecorator) {
// We need to add parentheses around the curly braces for this kind of decorators
codeWithSyntaxHighlighting = insertParenthesesForDecoratorInShikiHtml(
codeWithSyntaxHighlighting,
);
// }
}
// Note: Don't expect enum value in signatures to be linked correctly
// as shiki already splits them into separate span blocks.
// Only the enum itself will recieve a link
codeWithSyntaxHighlighting = addApiLinksToHtml(codeWithSyntaxHighlighting);
// shiki returns the lines wrapped by 2 node : 1 pre node, 1 code node.
// As leveraging jsdom isn't trivial here, we rely on a regex to extract the line nodes
const pattern = /(.*?)<code.*?>(.*?)<\/code>(.*)/s;
@@ -104,12 +125,7 @@ export async function addRenderableCodeToc<T extends DocEntry & HasModuleName>(
const insideCode = match[2];
const afterCode = match[3];
// Note: Don't expect enum value in signatures to be linked correctly
// as skihi already splits them into separate span blocks.
// Only the enum itself will recieve a link
const codeWithLinks = addApiLinksToHtml(insideCode);
const lines = splitLines(codeWithLinks);
const lines = splitLines(insideCode);
const groups = groupCodeLines(lines, metadata, entry);
return {
@@ -142,17 +158,27 @@ function groupCodeLines(lines: string[], metadata: CodeTableOfContentsData, entr
}, new Map<string, CodeLineRenderable[]>());
}
export function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
const isDeprecated = isDeprecatedEntry(entry);
const deprecatedLineNumbers = isDeprecated ? [0] : [];
if (isClassEntry(entry)) {
const members = filterLifecycleMethods(mergeGettersAndSetters(entry.members));
return getCodeTocData(members, true, isDeprecated);
if (isClassEntry(entry) || (isDecoratorEntry(entry) && isClassLikeDecorator(entry))) {
const members = filterLifecycleMethods(mergeGettersAndSetters(entry.members!));
return getCodeTocData(members, isDeprecated);
}
if (isDecoratorEntry(entry)) {
return getCodeTocData(entry.members, true, isDeprecated);
if (isDecoratorEntry(entry) && !isClassLikeDecorator(entry)) {
return {
contents: entry
.signatures!.map((sig) =>
sig.parameters
.map((param) => `${param.name}${param.isOptional ? '?' : ''}: ${param.type}`)
.join(', '),
)
.join(LN_BREAK),
codeLineNumbersWithIdentifiers: new Map<number, string>(),
deprecatedLineNumbers: [],
};
}
if (isConstantEntry(entry)) {
@@ -164,17 +190,18 @@ export function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
}
if (isEnumEntry(entry)) {
return getCodeTocData(entry.members, true, isDeprecated);
return getCodeTocData(entry.members, isDeprecated);
}
if (isInterfaceEntry(entry)) {
return getCodeTocData(mergeGettersAndSetters(entry.members), true, isDeprecated);
return getCodeTocData(mergeGettersAndSetters(entry.members), isDeprecated);
}
if (isFunctionEntry(entry)) {
const codeLineNumbersWithIdentifiers = new Map<number, string>();
const hasSingleSignature = entry.signatures.length === 1;
// Specifically handling the case of overloaded functions
if (entry.signatures.length > 0) {
const initialMetadata: CodeTableOfContentsData = {
contents: '',
@@ -186,7 +213,7 @@ export function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
(acc: CodeTableOfContentsData, curr: FunctionSignatureMetadata, index: number) => {
const lineNumber = index;
acc.codeLineNumbersWithIdentifiers.set(lineNumber, `${curr.name}_${index}`);
acc.contents += getMethodCodeLine(curr, [], hasSingleSignature, true);
acc.contents += getFunctionCodeLine(curr, []);
// We don't want to add line break after the last item
if (!hasSingleSignature && index < entry.signatures.length - 1) {
@@ -203,8 +230,7 @@ export function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
}
return {
// It is important to add the function keyword as shiki will only highlight valid ts
contents: `function ${getMethodCodeLine(entry.implementation, [], true)}`,
contents: getMethodCodeLine(entry.implementation, []),
codeLineNumbersWithIdentifiers,
deprecatedLineNumbers,
};
@@ -281,25 +307,20 @@ export function mapDocEntryToCode(entry: DocEntry): CodeTableOfContentsData {
};
}
// TODO(matthieu): This whole part should be refactored to rely on a formatter (like prettier)
// to handle formatting (See also #59211)
/** Generate code ToC data for list of members. */
function getCodeTocData(
members: MemberEntry[],
hasPrefixLine: boolean,
isDeprecated: boolean,
): CodeTableOfContentsData {
function getCodeTocData(members: MemberEntry[], isDeprecated: boolean): CodeTableOfContentsData {
const initialMetadata: CodeTableOfContentsData = {
contents: '',
codeLineNumbersWithIdentifiers: new Map<number, string>(),
deprecatedLineNumbers: isDeprecated ? [0] : [],
};
// In case when hasPrefixLine is true we should take it into account when we're generating
// `codeLineNumbersWithIdentifiers` below.
const skip = !!hasPrefixLine ? 1 : 0;
let lineNumber = skip;
let lineNumber = 1;
return members.reduce((acc: CodeTableOfContentsData, curr: MemberEntry, index: number) => {
const setTocData = (entry: DocEntry | MemberEntry, content: string) => {
acc.contents += ` ${content.trim()}\n`;
acc.contents += `${INDENTED_NEW_LINE}${content}`;
acc.codeLineNumbersWithIdentifiers.set(lineNumber, entry.name);
if (isDeprecatedEntry(entry)) {
acc.deprecatedLineNumbers.push(lineNumber);
@@ -309,14 +330,17 @@ function getCodeTocData(
};
if (isClassMethodEntry(curr)) {
// class methods
if (curr.signatures.length > 0) {
curr.signatures.forEach((signature) => {
setTocData(signature, getMethodCodeLine(signature, curr.memberTags));
});
} else {
// Constructors, methods on interfaces, Decorators
setTocData(curr, getMethodCodeLine(curr.implementation, curr.memberTags));
}
} else {
// class props
setTocData(curr, getCodeLine(curr));
}
return acc;
@@ -337,24 +361,21 @@ function getPropertyCodeLine(member: PropertyEntry): string {
const isOptional = isOptionalMember(member);
const tags = getTags(member);
return `${tags.join(' ')} ${member.name}${markOptional(isOptional)}: ${member.type};`;
return `${tags.join(SPACE)}${tags.length ? SPACE : ''}${member.name}${markOptional(isOptional)}: ${member.type};`;
}
/** Map method entry to text */
function getMethodCodeLine(
member: FunctionSignatureMetadata,
memberTags: MemberTags[] = [],
displayParamsInNewLines: boolean = false,
isFunction: boolean = false,
): string {
function getMethodCodeLine(member: FunctionSignatureMetadata, memberTags: MemberTags[]): string {
const generics = makeGenericsText(member.generics);
return (
`${memberTags.join(SPACE)}${memberTags.length ? ' ' : ''}${member.name}${generics}(` +
`${member.params.map((param) => mapParamEntry(param)).join(`, `)}` +
`): ${member.returnType};`
);
}
displayParamsInNewLines &&= member.params.length > 0;
return `${isFunction ? 'function' : ''}${memberTags.join(' ')} ${member.name}${generics}(${displayParamsInNewLines ? '\n ' : ''}${member.params
.map((param) => mapParamEntry(param))
.join(`,${displayParamsInNewLines ? '\n ' : ' '}`)}${
displayParamsInNewLines ? '\n' : ''
}): ${member.returnType};`.trim();
function getFunctionCodeLine(member: FunctionSignatureMetadata, memberTags: MemberTags[]) {
return `function ${getMethodCodeLine(member, memberTags).trim()}`;
}
function mapParamEntry(entry: ParameterEntry) {
@@ -366,13 +387,13 @@ function mapParamEntry(entry: ParameterEntry) {
function getGetterCodeLine(member: PropertyEntry): string {
const tags = getTags(member);
return `${tags.join(' ')} get ${member.name}(): ${member.type};`;
return `${tags.join(SPACE)} get ${member.name}(): ${member.type};`;
}
function getSetterCodeLine(member: PropertyEntry): string {
const tags = getTags(member);
return `${tags.join(' ')} set ${member.name}(value: ${member.type});`;
return `${tags.join(SPACE)} set ${member.name}(value: ${member.type});`;
}
function markOptional(isOptional: boolean): string {
@@ -455,33 +476,40 @@ function appendPrefixAndSuffix(entry: DocEntry, codeTocData: CodeTableOfContents
firstLine: string,
lastLine: string,
) => {
data.contents = `${firstLine}\n${data.contents}${lastLine}`;
data.contents = `${firstLine}${data.contents}${lastLine}`;
};
if (isClassEntry(entry) || isInterfaceEntry(entry)) {
const generics = makeGenericsText(entry.generics);
const extendsStr = entry.extends ? ` extends ${entry.extends}` : '';
// TODO: remove the ? when we distinguish Class & Decorator entries
const implementsStr =
entry.implements?.length > 0 ? ` implements ${entry.implements.join(' ,')}` : '';
entry.implements.length > 0 ? ` implements ${entry.implements.join(' ,')}` : '';
const signature = `${entry.name}${generics}${extendsStr}${implementsStr}`;
if (isClassEntry(entry)) {
const abstractPrefix = entry.isAbstract ? 'abstract ' : '';
appendFirstAndLastLines(codeTocData, `${abstractPrefix}class ${signature} {`, `}`);
appendFirstAndLastLines(codeTocData, `${abstractPrefix}class ${signature} {`, `\n}`);
}
if (isInterfaceEntry(entry)) {
appendFirstAndLastLines(codeTocData, `interface ${signature} {`, `}`);
appendFirstAndLastLines(codeTocData, `interface ${signature} {`, `\n}`);
}
}
if (isEnumEntry(entry)) {
appendFirstAndLastLines(codeTocData, `enum ${entry.name} {`, `}`);
appendFirstAndLastLines(codeTocData, `enum ${entry.name} {`, `\n}`);
}
if (isDecoratorEntry(entry)) {
appendFirstAndLastLines(codeTocData, `interface ${entry.name} ({`, `})`);
if (isClassLikeDecorator(entry)) {
appendFirstAndLastLines(codeTocData, `class ${entry.name} {`, `\n}`);
} else {
let lines = splitLines(codeTocData.contents);
if (lines.length === 0) {
codeTocData.contents = `function ${entry.name}()`;
} else {
codeTocData.contents = lines.map((line) => `function ${entry.name}(${line})`).join('\n');
}
}
}
}
@@ -497,11 +525,11 @@ export function addApiLinksToHtml(htmlString: string): string {
// The captured content ==> vvvvvvvv
/(?<!<a[^>]*>)(<(?:(?:span)|(?:code))(?!\sdata-skip-anchor)[^>]*>\s*)([^<]*?)(\s*<\/(?:span|code)>)/g,
(type: string, span1: string, potentialSymbolName: string, span2: string) => {
let [symbol, subSymbol] = potentialSymbolName.split(/(?:#|\.)/) as [string, string?];
const [symbol, subSymbol] = potentialSymbolName.split(/(?:#|\.)/) as [string, string?];
// mySymbol() => mySymbol
const symbolWithoutInvocation = symbol.replace(/\([^)]*\);?/g, '');
const moduleName = getModuleName(symbolWithoutInvocation)!;
const moduleName = getModuleName(symbolWithoutInvocation);
if (moduleName) {
return `${span1}<a href="${getLinkToModule(moduleName, symbol, subSymbol)}">${potentialSymbolName}</a>${span2}`;
@@ -555,3 +583,7 @@ export function makeGenericsText(generics: GenericEntry[] | undefined): string {
return parts.join('');
}
function isClassLikeDecorator(entry: DecoratorEntry): boolean {
return !!entry.members;
}
@@ -22,18 +22,16 @@ import {addRepo} from './repo.mjs';
/** Given an unprocessed class entry, get the fully renderable class entry. */
export async function getDecoratorRenderable(
classEntry: DecoratorEntry,
decoratorEntry: DecoratorEntry,
moduleName: string,
repo: string,
): Promise<DecoratorEntryRenderable> {
return setEntryFlags(
await addRenderableCodeToc(
addRenderableMembers(
addHtmlAdditionalLinks(
addHtmlUsageNotes(
addHtmlJsDocTagComments(
addHtmlDescription(addRepo(addModuleName(classEntry, moduleName), repo)),
),
addHtmlAdditionalLinks(
addHtmlUsageNotes(
addHtmlJsDocTagComments(
addHtmlDescription(addRepo(addModuleName(decoratorEntry, moduleName), repo)),
),
),
),
@@ -1,19 +1,25 @@
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("//adev/shared-docs:defaults.bzl", "ts_project")
package(default_visibility = ["//visibility:public"])
exports_files([
"previews.template",
])
ts_project(
name = "index",
srcs = [
"index.mts",
],
enable_runtime_rnjs_interop = True,
visibility = [
"//adev/shared-docs:__subpackages__",
],
deps = [
"//:node_modules/@types/node",
"//:node_modules/tinyglobby",
"//:node_modules/typescript",
"//adev:node_modules/@types/node",
"//adev:node_modules/tinyglobby",
"//adev:node_modules/typescript",
],
)
@@ -23,7 +29,23 @@ filegroup(
visibility = ["//visibility:public"],
)
exports_files([
"index.mts",
"previews.template",
])
esbuild(
name = "bundle",
srcs = [
"//adev/shared-docs:tsconfig_build",
],
config = "//adev/shared-docs/pipeline:esbuild-config",
entry_point = ":index.mts",
external = [
"typescript",
"path",
],
format = "esm",
output = "previews.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
"//adev/shared-docs/pipeline/examples/previews:index_rjs",
],
)
@@ -9,7 +9,8 @@ ts_project(
"*.mts",
],
),
enable_runtime_rnjs_interop = True,
deps = [
"//:node_modules/@types/node",
"//adev:node_modules/@types/node",
],
)
@@ -1,3 +1,4 @@
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("//adev/shared-docs:defaults.bzl", "ts_project")
package(default_visibility = ["//visibility:public"])
@@ -12,11 +13,12 @@ ts_project(
"index.mts",
],
),
enable_runtime_rnjs_interop = True,
deps = [
"//:node_modules/@types/jsdom",
"//:node_modules/@types/node",
"//:node_modules/jsdom",
"//:node_modules/tinyglobby",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/@types/node",
"//adev:node_modules/jsdom",
"//adev:node_modules/tinyglobby",
"//adev/shared-docs/pipeline/examples/shared:shared_rjs",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
@@ -27,15 +29,31 @@ ts_project(
srcs = [
"index.mts",
],
enable_runtime_rnjs_interop = True,
visibility = [
"//adev/shared-docs:__subpackages__",
],
deps = [
":stackblitz_rjs",
"//:node_modules/@types/node",
"//adev:node_modules/@types/node",
],
)
exports_files([
"index.mts",
])
esbuild(
name = "bundle",
srcs = [
"//adev/shared-docs:tsconfig_build",
],
config = "//adev/shared-docs/pipeline:esbuild-config",
entry_point = ":index.mts",
# JSDOM should not be bundled because it has workers and dynamic imports.
external = ["jsdom"],
format = "esm",
output = "stackblitz.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
":index_rjs",
],
)
@@ -1,3 +1,4 @@
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("//adev/shared-docs:defaults.bzl", "ts_project")
package(default_visibility = ["//visibility:public"])
@@ -12,10 +13,11 @@ ts_project(
"index.mts",
],
),
enable_runtime_rnjs_interop = True,
deps = [
"//:node_modules/@types/node",
"//:node_modules/fflate",
"//:node_modules/tinyglobby",
"//adev:node_modules/@types/node",
"//adev:node_modules/fflate",
"//adev:node_modules/tinyglobby",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/pipeline/examples/shared:shared_rjs",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
@@ -27,15 +29,29 @@ ts_project(
srcs = [
"index.mts",
],
enable_runtime_rnjs_interop = True,
visibility = [
"//adev/shared-docs:__subpackages__",
],
deps = [
":zip_rjs",
"//:node_modules/@types/node",
"//adev:node_modules/@types/node",
],
)
exports_files([
"index.mts",
])
esbuild(
name = "bundle",
srcs = [
"//adev/shared-docs:tsconfig_build",
],
config = "//adev/shared-docs/pipeline:esbuild-config",
entry_point = ":index.mts",
format = "esm",
output = "zip.mjs",
platform = "node",
target = "es2022",
visibility = ["//visibility:public"],
deps = [
":index_rjs",
],
)
+12 -12
View File
@@ -62,17 +62,17 @@ ts_project(
"//adev/shared-docs:__subpackages__",
],
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/@types/node",
"//:node_modules/diff",
"//:node_modules/emoji-regex",
"//:node_modules/html-entities",
"//:node_modules/jsdom",
"//:node_modules/marked",
"//:node_modules/mermaid",
"//:node_modules/playwright-core",
"//:node_modules/shiki",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/@types/node",
"//adev:node_modules/diff",
"//adev:node_modules/emoji-regex",
"//adev:node_modules/html-entities",
"//adev:node_modules/jsdom",
"//adev:node_modules/marked",
"//adev:node_modules/mermaid",
"//adev:node_modules/playwright-core",
"//adev:node_modules/shiki",
],
)
@@ -86,6 +86,6 @@ ts_project(
],
deps = [
":guides_lib_rjs",
"//:node_modules/@types/node",
"//adev:node_modules/@types/node",
],
)
@@ -33,7 +33,7 @@ function getMermaidScriptTagData() {
}
return (mermaidScriptTagData = {
path: resolve(join(runfilesDir, 'npm/node_modules/mermaid/dist/mermaid.js')),
path: resolve(join(runfilesDir, 'angular/adev/node_modules/mermaid/dist/mermaid.js')),
});
}
@@ -8,9 +8,9 @@ ts_project(
"**/*.spec.mts",
]),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
)
@@ -8,9 +8,9 @@ ts_project(
"*.spec.mts",
]),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
)
@@ -8,9 +8,9 @@ ts_project(
"**/*.spec.mts",
]),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
)
@@ -6,9 +6,9 @@ ts_project(
testonly = True,
srcs = glob(["*.spec.mts"]),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
)
@@ -8,9 +8,9 @@ ts_project(
"**/*.spec.mts",
]),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
)
@@ -8,9 +8,9 @@ ts_project(
"**/*.spec.mts",
]),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
)
@@ -8,9 +8,9 @@ ts_project(
"**/*.spec.mts",
]),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
)
@@ -8,9 +8,9 @@ ts_project(
"**/*.spec.mts",
]),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
)
@@ -8,9 +8,9 @@ ts_project(
"**/*.spec.mts",
]),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
)
@@ -8,9 +8,9 @@ ts_project(
"**/*.spec.mts",
]),
deps = [
"//:node_modules/@bazel/runfiles",
"//:node_modules/@types/jsdom",
"//:node_modules/jsdom",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/jsdom",
"//adev:node_modules/jsdom",
"//adev/shared-docs/pipeline/guides:guides_lib_rjs",
],
)

Some files were not shown because too many files have changed in this diff Show More