Compare commits

..

144 Commits

Author SHA1 Message Date
Kirill Cherkashin d53649c8fb release: cut the v20.1.3 release 2025-07-23 16:54:37 -04:00
Andrew Scott 006eaf3d90 build: update bazel rules_browsers dependency (#62772)
Updates only rules_browsers since
https://github.com/angular/angular/pull/62542 is having difficulty with
other deps updated at the same time

PR Close #62772
2025-07-23 15:42:05 -04:00
Matthieu Riegler 155dbee71a docs: guard a resource error with hasValue() (#62708)
fixes #62687

PR Close #62708
2025-07-23 14:00:47 -04:00
Jan Martin 6398baa215 release: bump Angular DevTools version to 1.0.40 (#62767)
PR Close #62767
2025-07-23 09:25:24 -07:00
Kristiyan Kostadinov 2fd1f7beb5 fix(platform-browser): resolve component resources before bootstrapping in JIT mode (#62758)
Currently if the app has some external resources and it gets bootstrapped in JIT mode, the user will get an error about calling `resolveComponentResources`. These changes add a call to `resolveComponentResources` automatically inside `bootstrapApplication`.

Note that we don't need similar logic for `bootstrapModule`, because it calls into `compileNgModuleFactory` internally which in turn calls `resolveComponentResources`.

PR Close #62758
2025-07-23 11:05:20 -04:00
Angular Robot f38ee0d0e9 build: update all non-major dependencies (#62755)
See associated pull request for more information.

PR Close #62755
2025-07-23 11:04:41 -04:00
Charles Lyding b7c745b12d docs: create MCP server setup guide (#62746)
Introduces a new guide for setting up the Angular CLI's Model Context Protocol (MCP) server.

The guide includes:
- Instructions on how to use the command.
- IDE-specific JSON configurations for VS Code, JetBrains, Firebase Studio, and Cursor.
- Clarification on the different JSON structures required by each IDE.

PR Close #62746
2025-07-23 07:24:48 -04:00
Jessica Janiuk c00359dd14 ci: update renovate reviewers (#62761)
This restores the framework-team availability, since the setting was not working as intended.

PR Close #62761
2025-07-23 07:24:13 -04:00
Angular Robot 91bdd178f4 build: update @angular/ng-dev digest to 75a2aee (#62745)
See associated pull request for more information.

PR Close #62745
2025-07-22 12:32:30 -04:00
Joey Perrott db8f7ce0ba build: move generating doc files for @angular/ssr to using an intermediate typescript file (#62734)
Use an intermediate typescript file to rexport all of all of @angular/ssr rather than reaching into the npm package files

PR Close #62734
2025-07-22 10:13:28 -04:00
Joey Perrott e361deae30 build: remove unused @bazel/* npm packages (#62711)
Remove the unused bazel npm packages

PR Close #62711
2025-07-22 10:10:18 -04:00
Joey Perrott 807c4d7973 build: move nodejs_test to js_test (#62711)
Move nodejs_test to js_test and remove unnecessary files after move

PR Close #62711
2025-07-22 10:10:18 -04:00
Joey Perrott ca10fbde5a build: remove unused rules/macros from defaults.bzl (#62711)
Remove rules/macros that are not longer used in the repo

PR Close #62711
2025-07-22 10:10:18 -04:00
Joey Perrott 91f5a3c0ec build: migrate tslint rules from dev-infra to local (#62711)
Migrate the tslint rules used in dev-infra to locally defined rules as they are unused in other repos

PR Close #62711
2025-07-22 10:10:17 -04:00
Angular Robot 1151c45086 build: update github/codeql-action action to v3.29.3 (#62741)
See associated pull request for more information.

PR Close #62741
2025-07-22 10:05:41 -04:00
Matthieu Riegler 38b7ab26fb refactor(core): add a getTransferState for the devtools (#62722)
`getTransferState` will expose public data from the transfer state. It will for example remove internal hydration data.

PR Close #62722
2025-07-21 17:00:28 -04:00
AleksanderBodurri 45d3eeffaf test(devtools): bump cypress timeout to 10 seconds (#62726)
By default this is 4 seconds. In CI we have unreliable runtime performance so we this change gives us a bit of wiggle room to validate application behaviour.

PR Close #62726
2025-07-21 16:35:40 -04:00
Angular Robot f041042947 build: update cross-repo angular dependencies (#62731)
See associated pull request for more information.

PR Close #62731
2025-07-21 16:12:26 -04:00
Aristeidis Bampakos 74e47782c6 docs: fix minor typos in styleguide (#62706)
PR Close #62706
2025-07-21 13:38:40 -04:00
Joey Perrott b388f1e518 build: remove all usages of the interop_deps attr for ts_project and ng_project (#62733)
Remove all of the usages of interop_deps as attributes in the repo

PR Close #62733
2025-07-21 13:10:18 -04:00
AleksanderBodurri aee5260610 fix(devtools): stop reseting currentlyMatchedIndex when a node is selected in the component explorer (#62727)
This was causing some unintended behaviour when paired with our new zoneless configuration. I'm not sure why currentlyMatchedIndex was getting set to -1 here. With this removed it seems like things are working as expected. Previously a select call would reset this index *after* a search filter was applied, which would cause weird behaviour with the "next" and "prev" buttons.

PR Close #62727
2025-07-21 12:15:02 -04:00
Angular Robot 70d0c10d6c docs: update Angular CLI help (#62730)
Updated Angular CLI help contents.

PR Close #62730
2025-07-21 12:06:28 -04:00
Angular Robot bca8a3c73b build: update dependency node to v22.17.1 (#62715)
See associated pull request for more information.

PR Close #62715
2025-07-21 10:54:11 -04:00
Angular Robot a1a78b2e13 build: update all non-major dependencies (#62716)
See associated pull request for more information.

PR Close #62716
2025-07-21 10:22:12 -04:00
Johnny Huang cf48b13706 docs: fix code snippet (#62720)
changes code snippet on first-app tutorials (https://angular.dev/tutorials/first-app/09-services) for the step "Add a new file level import for the HousingService:" from 

imports: [HousingLocation], 

to

import {HousingService} from '../housing.service';
PR Close #62720
2025-07-21 09:37:46 -04:00
Angular Robot c36de9e6ca build: update cross-repo angular dependencies (#62651)
See associated pull request for more information.

PR Close #62651
2025-07-18 10:19:36 -04:00
Matthieu Riegler 409287add3 docs: split devtools doc to prepare for upcomming updates (#62597)
PR Close #62597
2025-07-18 10:07:46 -04:00
Elizabeth 2c522efbe5 fix(core): fix change tracking for Resource#hasValue (#62595)
When using `hasValue()` I would expect it to behave like any other
reactive value such that changes to the internal `value()` that do not
cause `hasValue()` to return anything different do not trigger change
detection, but this was not the case. This change wraps the value
checking in a `computed` such that it behaves as expected again while
still preserving the type narrowing.

PR Close #62595
2025-07-18 10:01:44 -04:00
Andrew Scott ba8a5d826e refactor(core): Use promise.finally for task removal (#62674)
Updates the approach from https://github.com/angular/angular/pull/62631 to
use Promise.finally for task removal. This is a bit cleaner and also handles
rejections from the donePromise

PR Close #62674
2025-07-18 07:19:49 -04:00
Joey Perrott 1e9bfe54b1 build: migrate to new toolchain usage for api goldens (#62688)
Migrate api golden usage to be based on rules_js toolchain implementation

PR Close #62688
2025-07-17 18:13:43 -04:00
Kirill Cherkashin c53abd96f1 release: cut the v20.1.2 release 2025-07-17 17:47:43 -04:00
Jonathan Pribesh e7e2dea9c8 docs: fixes binding box typo in httpResource.value() template example (#62661)
PR Close #62661
2025-07-17 14:31:08 -04:00
Matthieu Riegler 8ad10fd63b fix(compiler): fix detection of directive deps in JIT (#62666)
This fix also matches the implementation to the jsdoc for `hasDirectiveDependencies` "Whether any of the component's dependencies are directives"

fixes #62573

PR Close #62666
2025-07-17 14:20:32 -04:00
Joey Perrott c2625575aa build: remove ts_library definition (#62686)
Remove the ts_library macro from our defaults.bzl file

PR Close #62686
2025-07-17 14:16:02 -04:00
Joey Perrott 8b62b313e1 build: migrate zone.js to use ts_project instead of ts_library (#62686)
Use ts_project instead of ts_library for building zone.js

PR Close #62686
2025-07-17 14:16:02 -04:00
hawkgs dcab8c928b refactor(devtools): rearrange main toolbar menu buttons (#62684)
Place the version in the info menu and move both the info and gear buttons to the right-hand side of the toolbar.

PR Close #62684
2025-07-17 14:06:32 -04:00
Tony Conway 1930e99e14 docs: Update versions.md to use canonical Baseline site (#62680)
replace `tonypconway` fork URL with canonical `web-platform-dx` URL

PR Close #62680
2025-07-17 13:26:41 -04:00
Joey Perrott 0db3613565 build: remove rules_nodejs based protractor tooling (#62649)
Remove the protractor setup based on rules_nodejs

PR Close #62649
2025-07-16 16:39:50 -04:00
Joey Perrott bcf07e4559 build: remove extra toolchain registration (#62649)
Remove extra toolchain registration that is redundant as we already add the toolchains elsewhere

PR Close #62649
2025-07-16 16:39:50 -04:00
Joey Perrott 3e8e16bce7 build: migrate protractor test to new toolchain (#62649)
Migrate to new toolchain for protractor test in packages/examples/upgrade

PR Close #62649
2025-07-16 16:39:50 -04:00
Joey Perrott 5aed352abd ci: use new size tracking in integration tests (#62652)
Use the new size tracking within integration tests

PR Close #62652
2025-07-16 16:36:13 -04:00
Joey Perrott 2bcdc66159 build: move all rule/macro loading into adev/defaults.bzl and fix intellisense loading (#62629)
Move all of our loading into a local defaults.bzl file instead of mixed loading via tools/defaults and adev/defaults

PR Close #62629
2025-07-16 16:34:05 -04:00
Joey Perrott 7bf66f0c52 build: move all rule/macro loading into devtools/defaults.bzl (#62629)
Move all of our loading into a local defaults.bzl file instead of mixed loading via tools/defaults and devtolls/defaults

PR Close #62629
2025-07-16 16:34:04 -04:00
Jan Martin 4b9385f468 release: bump Angular DevTools version to 1.0.39 (#62670)
PR Close #62670
2025-07-16 16:13:12 -04:00
Andrew Kushnir 44784f175d release: cut the v20.1.1 release 2025-07-16 10:58:44 -07:00
Kristiyan Kostadinov 9506cdfaad fix(compiler-cli): infer type of event target for void elements (#62648)
Currently we infer the target of DOM events to be `EventTarget | null` which is consistent with the built-in types for `addEventListener`. This is due to the fact that users can dispatch custom events, or the event might've bubbled. However, this typing is also inconvenient for some other common use cases like `<input (input)="query($event.target.value)">`, because we don't have the ability to type cast in a template.

These changes aim to make some of the cases simpler by inferring the type of `$event.target` if the event is bound on a void element which guarantees that it couldn't have bubbled.

PR Close #62648
2025-07-16 12:40:26 +02:00
Kristiyan Kostadinov 2ab638d514 refactor(core): expose function to assert type of variables (#62648)
Adds the `ɵassertType` function that will be used during type checking to assert the type of a value.

PR Close #62648
2025-07-16 12:40:26 +02:00
Kristiyan Kostadinov 53963e910e refactor(compiler): indicate whether element is void at AST level (#62648)
Updates the HTML AST to indicate whether a specific element is a void element.

PR Close #62648
2025-07-16 12:40:25 +02:00
Kristiyan Kostadinov 70c8780c54 fix(compiler): more permissive parsing of @ characters (#62644)
When we introduced blocks, we made a deliberate decision to treat the `@` character as a reserved character in case we need to use it for other syntax in the future. This meant that some common cases, like writing out an email address in the template, can be broken.

After some recent discussions we decided to relax the requirement and only treat `@` as a reserve character if it's followed by a character sequence that matches a known block.

PR Close #62644
2025-07-15 13:24:47 -07:00
Kristiyan Kostadinov f531370281 test(compiler): remove duplicated lexer tests (#62644)
There were 26 duplicated block tests in `lexer_spec.ts`, likely due to merge conflicts. These changes remove the duplicates while keeping the 6 tests that were different.

PR Close #62644
2025-07-15 13:24:47 -07:00
Angular Robot acf8b742d8 build: update all non-major dependencies (#62643)
See associated pull request for more information.

PR Close #62643
2025-07-15 09:35:03 -07:00
SkyZeroZx 6f5bd5f964 docs: Update documentation httpResource with referrer & integrity options (#62637)
PR Close #62637
2025-07-15 09:33:15 -07:00
muhammadali1658 72605a42c4 docs: fix missing 'of' in Style Guide sentence (#62628)
PR Close #62628
2025-07-15 07:59:20 -07:00
Kristiyan Kostadinov 75d2a349b4 fix(compiler): incorrect spans for left side of binary operation (#62641)
Fixes that the span for the `left` side of a `Binary` AST included the range up to and including the operator.

Fixes #62617.

PR Close #62641
2025-07-15 07:57:32 -07:00
Kristiyan Kostadinov e8234095ca docs: update best practices prompt (#62640)
Updates the `best-practices.md` with results from recent testing.

PR Close #62640
2025-07-15 07:56:05 -07:00
Milo d381e3b05b refactor(devtools): simplify vendored deps to make importing into google3 easier (#62636)
prefer using node_modules/webtreemap, and remove memo-decorator

PR Close #62636
2025-07-15 07:53:51 -07:00
Andrew Scott 26ade4a337 fix(core): Ensure application remains unstable during bootstrap (#62631)
This commit ensures the application remains unstable during the entire
bootstrap process. This ensures all bootstrap listeners and app
initializers observe the application as being unstable until each one
has gotten a chance to execute the synchronous block (potentially adding
more pending tasks).

Prior to this commit, application initializers or bootstrap
listeners may observe the application as being stable, even though other
initializers/listeners had not yet executed. This created an ordering
issue whereby the hydration bootstrap listener would observe the
application as stable prior to the router performing its initial
navigation.

fixes #62592

PR Close #62631
2025-07-15 07:52:36 -07:00
aparziale a81f0faa1a fix(core): InputBinding marks component a dirty. (#62613)
This fix ensures that CD runs on OnPush component when an input binding is set.

PR Close #62613
2025-07-14 15:46:29 -07:00
Joey Perrott 74beeeca3f docs: correctly look for examples in the bin_dir instead of execPath (#62632)
Properly look for the example files for live previews in the bin_dir

PR Close #62632
2025-07-14 14:49:16 -07:00
Ben Hong f202160e6e docs: add dedicated data resolvers router guide (#62250)
PR Close #62250
2025-07-14 14:17:50 -07:00
Matthieu Riegler c526238751 build: set paths for devtools & adev (#62574)
This allows the IDE to find the right imports

PR Close #62574
2025-07-14 14:11:09 -07:00
arturovt 5949373692 fix(router): handle errors from view transition readiness (#62535)
This commit adds a `.catch()` handler to `transition.ready` from `document.startViewTransition` to prevent `AbortError`s in Safari when `startViewTransition` is called synchronously multiple times.

PR Close #62535
2025-07-14 11:39:57 -07:00
Matthieu Riegler 22b56ca66f test(docs-infra): Use the zoneless testing rule (#62596)
This will spare use the warning logs when the tests run.

```
      NG0914: The application is using zoneless change detection, but is still loading Zone.js. Consider removing Zone.js to get the full benefits of zoneless. In applications using the Angular CLI, Zone.js is typically included in the "polyfills" section of the angular.json file.
```

PR Close #62596
2025-07-14 11:36:44 -07:00
Matthieu Riegler 5aa69ff0a2 refactor(devtools): Use OnPush on all components (#62610)
The end goal is to move the devtools app to zoneless.

PR Close #62610
2025-07-14 11:35:48 -07:00
Angular Robot a5b45ca2f6 build: update all non-major dependencies (#62604)
See associated pull request for more information.

PR Close #62604
2025-07-14 11:34:36 -07:00
Emily Marigold Klassen 0ce086e967 docs: update forgotten change to input signals (#62612)
PR Close #62612
2025-07-14 10:03:24 -07:00
Matthieu Riegler c9d7a70fb5 refactor(devtools): update the patch branch with the content of main. (#62623)
This is a technical commit.

PR Close #62623
2025-07-14 10:02:53 -07:00
Dmitry Kostyuk 546d7b8329 docs(docs-infra): fix nested routes example (#62608)
PR Close #62608
2025-07-14 10:00:49 -07:00
Matthieu Riegler b935eff007 docs: fix CLI reference layout (#62609)
fixes #62602

PR Close #62609
2025-07-14 09:59:55 -07:00
Matthieu Riegler ebfc946683 docs: add note about difference between class bindings and ngClass (#62611)
fixes #40623

PR Close #62611
2025-07-14 09:59:17 -07:00
Matthieu Riegler ddd92585a9 docs(docs-infra): Add status to some guide entries. (#62614)
Guide entries can now have "new" or "updated" tags.

PR Close #62614
2025-07-14 09:58:14 -07:00
Joao da Silva 4dd0586978 docs: fix lazy load example in define-routes.md (#62620)
Fixes #62619

PR Close #62620
2025-07-14 09:57:27 -07:00
Angular Robot 1fa10c07ce docs: update Angular CDK apis (#62601)
Updated Angular CDK api files.

PR Close #62601
2025-07-11 16:07:38 -07:00
Angular Robot db11cdd389 build: update all non-major dependencies (#62583)
See associated pull request for more information.

PR Close #62583
2025-07-11 14:46:59 -07:00
Jessica Janiuk 02dce8ee11 ci: add to public-api approvers list (#62591)
This appends reviewers to the approvers list.

PR Close #62591
2025-07-11 10:43:28 -07:00
fortnite misogynist 4bd178a68c docs: fix comment breaking Highlighter (#62577)
This fixes a comment that was causing issues with docs highlighting

PR Close #62577
2025-07-11 10:41:47 -07:00
Angular Robot cfdd04b2ac build: update cross-repo angular dependencies (#62565)
See associated pull request for more information.

PR Close #62565
2025-07-11 10:40:41 -07:00
Joey Perrott 4f1e88e598 build: use esbuild from aspect rules (#62568)
Use the esbuild ruleset from aspect rules instead of via @bazel/esbuild

PR Close #62568
2025-07-10 13:45:15 -07:00
Jessica Janiuk aea0a70c1d ci: adjust renovate teams (#62578)
This switches framework team to approve but not requested, and adds the currently active caretaker group to the teams for renovate.

PR Close #62578
2025-07-10 12:52:31 -07:00
Andrew Kushnir 6549418e39 refactor(core): include DI path into cyclic dependency error message (#50902)
This commit updates the logic to better handle a situation when there is a cyclic DI dependency detected. Previously, the error message used to contain the name of the token that triggered the problem. With this change, the DI resolution path would also be included, so that it's easier to find and resolve the cycle.

PR Close #50902
2025-07-10 10:35:12 -07:00
Alan Agius 66a85ab190 docs: update browsers support versions (#62572)
The current URL is not correct as it incorrectly includes browsers. We now replace the URL with the comparer provided by baseline which will be available soonish via `web-platform-dx.github.io`

PR Close #62572
2025-07-10 10:26:24 -07:00
Joey Perrott 6b271c88f2 build: use tsc from @npm2// instead of @npm// (#62558)
Use tsc from the new node_modules layout

PR Close #62558
2025-07-10 10:25:36 -07:00
Angular Robot e9905f7b7f build: update all non-major dependencies (#62515)
See associated pull request for more information.

PR Close #62515
2025-07-10 10:21:04 -07:00
Joey Perrott b4ae55ae68 build: use rollup directory instead of rollup through @bazel/rollup (#62556)
Use rollup directly instead of using the previous toolchain implementation

PR Close #62556
2025-07-09 16:53:25 -07:00
Angular Robot 6274ea7e8b docs: update Angular CLI help (#62519)
Updated Angular CLI help contents.

PR Close #62519
2025-07-09 14:03:50 -07:00
Alan Agius 276836ee73 fix(http): do not display warnings Angular detected that a HttpClient request with the keepalive option was sent using XHR when option is not true (#62536)
Currently, this warning is always displayed as the option defaults to false. We update the logic to only display the warning when it's true.

PR Close #62536
2025-07-09 12:45:27 -07:00
ice-blaze 11d817348c docs(forms): remove unecessary FormGroup casting (#62555)
Fixes #62554

PR Close #62555
2025-07-09 12:43:50 -07:00
Miles Malerba 317ae4443a ci: add gemini code assist config (#62560)
Configures gemini to not interact with new pull requests, only review on
demand

PR Close #62560
2025-07-09 12:42:46 -07:00
Matthieu Riegler 053cd3c747 docs(docs-infra): do not cache the versions.json file (#62534)
Without the flag, the file gets inline in the transfer cache making the resource useless.

PR Close #62534
2025-07-09 12:42:06 -07:00
Joey Perrott f038803693 build: migrate esbuild usages to aspect_rules_esbuild esbuild rule (#62529)
Migrate more usages of esbuild to new toolchain

PR Close #62529
2025-07-09 12:41:27 -07:00
Matthieu Riegler ee16715c68 docs(docs-infra): run analytics only on the browser (#62531)
We don't care about server, adev only uses SSG.
Also `setCookieConsent` is throwing on node.

PR Close #62531
2025-07-09 12:40:37 -07:00
Matthieu Riegler 59de6400fa docs(docs-infra): update update guide when changing level (#62526)
This commit also fixes the colors of the material button toggle

fixes #62432

PR Close #62526
2025-07-09 12:40:01 -07:00
Matthieu Riegler 2f969c8ac4 docs(docs-infra): fix banner position on mobile & tablet (#62521)
#62509

PR Close #62521
2025-07-09 12:39:14 -07:00
Ben Hong d5d692766c docs: add dedicated routing lifecycle and events guide (#62225)
doc: apply suggestions from code review

Co-authored-by: Enea Jahollari <jahollarienea14@gmail.com>

Co-authored-by: Matthieu Riegler <kyro38@gmail.com>

PR Close #62225
2025-07-09 12:38:34 -07:00
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
1750 changed files with 54308 additions and 76021 deletions
@@ -0,0 +1,32 @@
# @generated
# 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=1437575780
adev/package.json=802893591
adev/shared-docs/package.json=735765359
adev/shared-docs/pipeline/api-gen/package.json=939673974
integration/package.json=-239561259
modules/package.json=285483536
package.json=269293473
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=1178475833
packages/compiler/package.json=1190056499
packages/core/package.json=1154833122
packages/core/test/bundling/package.json=-41696443
packages/elements/package.json=-892969618
packages/forms/package.json=-877154917
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=-1752804703
pnpm-workspace.yaml=1738525657
tools/bazel/rules_angular_store/package.json=-239561259
yarn.lock=-482312644
-2
View File
@@ -55,7 +55,6 @@ packages/core/node_modules
packages/core/test/bundling/node_modules
packages/elements/node_modules
packages/forms/node_modules
packages/language-service/node_modules
packages/platform-browser/node_modules
packages/platform-server/node_modules
packages/platform-browser-dynamic/node_modules
@@ -63,5 +62,4 @@ packages/router/node_modules
packages/zone.js/node_modules
packages/upgrade/node_modules
packages/benchpress/node_modules
packages/service-worker/node_modules
tools/bazel/rules_angular_store/node_modules
+3 -6
View File
@@ -12,9 +12,6 @@ common --@aspect_rules_ts//ts:default_to_tsc_transpiler
# Needed as otherwise `env` of TS actions would be ignored.
common --incompatible_merge_fixed_and_default_shell_env
# Frozen lockfile
common --lockfile_mode=error
###############################
# Filesystem interactions #
###############################
@@ -41,7 +38,7 @@ test --nolegacy_external_runfiles
# in Bazel 0.21.0 but turned off again in 0.22.0. Follow
# https://github.com/bazelbuild/bazel/issues/7026 for more details.
# This flag is needed to so that the bazel cache is not invalidated
# when running bazel via `pnpm bazel`.
# when running bazel via `yarn bazel`.
# See https://github.com/angular/angular/issues/27514.
build --incompatible_strict_action_env
run --incompatible_strict_action_env
@@ -63,11 +60,11 @@ build --enable_runfiles
# Releases should always be stamped with version control info
# This command assumes node on the path and is a workaround for
# https://github.com/bazelbuild/bazel/issues/4802
build:release --workspace_status_command="pnpm --silent ng-dev release build-env-stamp --mode=release"
build:release --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=release"
build:release --stamp
# Snapshots should also be stamped with version control information.
build:snapshot-build --workspace_status_command="pnpm --silent ng-dev release build-env-stamp --mode=snapshot"
build:snapshot-build --workspace_status_command="yarn -s ng-dev release build-env-stamp --mode=snapshot"
build:snapshot-build --stamp
# Angular DevTools for Firefox releases *cannot* be stamped and `--config snapshot-build-firefox` is a no-op.
+1 -1
View File
@@ -1 +1 @@
7.6.1
6.5.0
+1 -1
View File
@@ -3,7 +3,7 @@
"name": "Angular dev container",
"dockerFile": "Dockerfile",
"appPort": [4000, 4200, 4433, 5000, 8080, 9876],
"postCreateCommand": "pnpm install",
"postCreateCommand": "yarn install",
"extensions": [
"devondcarew.bazel-code",
"ms-vscode.vscode-typescript-tslint-plugin"
+4 -3
View File
@@ -1,4 +1,5 @@
load("//tools:defaults.bzl", "esbuild_checked_in", "ts_config", "ts_project")
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
load("//tools:defaults2.bzl", "esbuild_checked_in", "ts_project")
package(default_visibility = ["//.github/actions/deploy-docs-site:__subpackages__"])
@@ -17,11 +18,11 @@ esbuild_checked_in(
platform = "node",
target = "node20",
deps = [
":lib",
":lib_rjs",
],
)
ts_config(
rules_js_tsconfig(
name = "tsconfig",
src = "tsconfig.json",
)
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -5,9 +5,9 @@ runs:
using: 'composite'
steps:
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Saucelabs Variables
uses: angular/dev-infra/github-actions/saucelabs@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/saucelabs@5293c189424a61f7255d8171e3d653f983404851
- name: Starting Saucelabs tunnel service
shell: bash
run: ./tools/saucelabs/sauce-service.sh run &
@@ -34,7 +34,7 @@ runs:
run: ./tools/saucelabs/sauce-service.sh ready-wait
- name: Running tests on Saucelabs.
shell: bash
run: KARMA_WEB_TEST_MODE=SL_REQUIRED pnpm karma start ./karma-js.conf.js --single-run
run: KARMA_WEB_TEST_MODE=SL_REQUIRED yarn karma start ./karma-js.conf.js --single-run
- name: Stop Saucelabs tunnel service
shell: bash
run: ./tools/saucelabs/sauce-service.sh stop
+17
View File
@@ -0,0 +1,17 @@
name: 'Installing Yarn dependencies'
description: 'Installs the dependencies using Yarn'
runs:
using: 'composite'
steps:
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
with:
path: |
./node_modules/
# If just `WORKSPACE` or `yarn.lock` is changed, the most recent cache can be restored.
# See: https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action.
key: v1-angular-main-deps-${{hashFiles('WORKSPACE')}}-${{hashFiles('yarn.lock')}}
restore-keys: v1-angular-main-deps-
- run: yarn install --frozen-lockfile --non-interactive
shell: bash
+6 -6
View File
@@ -21,16 +21,16 @@ jobs:
(github.event.action == 'synchronize' && contains(github.event.pull_request.labels.*.name, 'adev: preview'))
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- name: Build adev to ensure it continues to work
run: pnpm bazel build //adev:build --full_build_adev --config=release
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@80db036355181684ed07021a175e9f039190d3d6
run: yarn bazel build //adev:build --full_build_adev --config=release
- uses: angular/dev-infra/github-actions/previews/pack-and-upload-artifact@5293c189424a61f7255d8171e3d653f983404851
with:
workflow-artifact-name: 'adev-preview'
pull-number: '${{github.event.pull_request.number}}'
+2 -2
View File
@@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
token: '${{secrets.GITHUB_TOKEN}}'
@@ -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@80db036355181684ed07021a175e9f039190d3d6
- uses: angular/dev-infra/github-actions/previews/upload-artifacts-to-firebase@5293c189424a61f7255d8171e3d653f983404851
with:
github-token: '${{secrets.GITHUB_TOKEN}}'
workflow-artifact-name: 'adev-preview'
@@ -13,9 +13,9 @@ jobs:
assistant_to_the_branch_manager:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: angular/dev-infra/github-actions/branch-manager@80db036355181684ed07021a175e9f039190d3d6
- uses: angular/dev-infra/github-actions/branch-manager@5293c189424a61f7255d8171e3d653f983404851
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+5 -5
View File
@@ -28,7 +28,7 @@ jobs:
- uses: alessbell/pull-request-comment-branch@aad01d65d6982b8eacabed5e9a684cd8ceb98da6 # v1.1
id: comment-branch
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Specify repository as the PR branch might be from a fork.
repository: ${{steps.comment-branch.outputs.head_owner}}/${{steps.comment-branch.outputs.head_repo}}
@@ -36,9 +36,9 @@ jobs:
# that the action was triggered by a team member.
ref: ${{steps.comment-branch.outputs.head_ref}}
- run: pnpm install --frozen-lockfile
- uses: ./.github/actions/yarn-install
- uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
- uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
with:
bazelrc: ./.bazelrc.user
@@ -47,9 +47,9 @@ jobs:
env:
# Untrusted input used in an executable code, must be wrapped as an env var to prevent injections
COMMENT_BODY: ${{ github.event.comment.body }}
run: pnpm benchmarks prepare-for-github-action "$COMMENT_BODY"
run: yarn benchmarks prepare-for-github-action "$COMMENT_BODY"
- run: pnpm benchmarks run-compare ${{steps.info.outputs.compareSha}} ${{steps.info.outputs.benchmarkTarget}}
- run: yarn benchmarks run-compare ${{steps.info.outputs.compareSha}} ${{steps.info.outputs.benchmarkTarget}}
id: benchmark
name: Running benchmark
+54 -60
View File
@@ -21,120 +21,113 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- name: Check code lint
run: pnpm tslint
run: yarn -s tslint
- name: Check for circular dependencies
run: pnpm ts-circular-deps:check
run: yarn -s ts-circular-deps:check
- name: Validate pull approve configuration
run: pnpm ng-dev pullapprove verify
run: yarn -s ng-dev pullapprove verify
- name: Validate angular robot configuration
run: pnpm ng-dev ngbot verify
run: yarn -s ng-dev ngbot verify
- name: Confirm code builds with typescript as expected
run: pnpm check-tooling-setup
run: yarn -s check-tooling-setup
devtools:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- name: Run unit tests
run: pnpm devtools:test
run: yarn devtools:test
- name: Test build
run: pnpm devtools:build:chrome
- name: Cypress run
uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2
with:
command: pnpm devtools:test:e2e
start: pnpm bazel run //devtools/src:devserver
wait-on: 'http://localhost:4200'
wait-on-timeout: 300
run: yarn devtools:build:chrome
test:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile --network-timeout 100000
- name: Run CI tests for framework
run: pnpm test:ci
run: yarn test:ci
integration-tests:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile --network-timeout 100000
- name: Run integration CI tests for framework
run: pnpm integration-tests:ci
run: yarn integration-tests:ci
adev:
runs-on:
labels: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- name: Run tests
run: pnpm bazel test //adev/...
run: yarn bazel test //adev/...
- name: Build adev in fast mode to ensure it continues to work
run: pnpm bazel build //adev:build --config=release
run: yarn bazel build //adev:build --config=release
publish-snapshots:
runs-on:
labels: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- run: echo "https://${{secrets.SNAPSHOT_BUILDS_GITHUB_TOKEN}}:@github.com" > ${HOME}/.git_credentials
- run: pnpm build
- run: yarn build
- run: ./scripts/ci/publish-build-artifacts.sh
zone-js:
@@ -142,7 +135,7 @@ jobs:
labels: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
node-module-directories: |
@@ -150,18 +143,18 @@ jobs:
./packages/zone.js/node_modules
./packages/zone.js/test/typings/node_modules
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
with:
google_credential: ${{ secrets.RBE_TRUSTED_BUILDS_USER }}
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- run: |
pnpm bazel build \
yarn bazel build \
//packages/zone.js/bundles:zone.umd.js \
//packages/zone.js:npm_package \
//packages/zone.js/test/closure:closure
//packages/zone.js/test/closure:closure_rjs
- run: |
rm -Rf packages/zone.js/build
@@ -176,14 +169,15 @@ jobs:
cp dist/bin/packages/zone.js/test/closure/zone.closure.js ./packages/zone.js/build/test/zone.closure.mjs
# Install
- run: pnpm -C packages/zone.js install --frozen-lockfile
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
# Run zone.js tools tests
- run: pnpm -C packages/zone.js promisefinallytest
- run: pnpm -C packages/zone.js jest:test
- run: pnpm -C packages/zone.js jest:nodetest
- run: pnpm -C packages/zone.js vitest:test
- run: pnpm -C packages/zone.js electrontest
- run: pnpm -C packages/zone.js/test/typings test
- run: yarn --cwd packages/zone.js promisefinallytest
- run: yarn --cwd packages/zone.js jest:test
- run: yarn --cwd packages/zone.js jest:nodetest
- run: yarn --cwd packages/zone.js vitest:test
- run: yarn --cwd packages/zone.js electrontest
- run: yarn --cwd packages/zone.js/test/typings install --frozen-lockfile --non-interactive
- run: yarn --cwd packages/zone.js/test/typings test
# saucelabs:
# runs-on: ubuntu-latest-4core
@@ -195,7 +189,7 @@ jobs:
# with:
# cache-node-modules: true
# - name: Install node modules
# run: pnpm install --frozen-lockfile
# run: yarn install --frozen-lockfile
# - uses: ./.github/actions/saucelabs-legacy
adev-deploy:
@@ -204,15 +198,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- name: Build adev to ensure it continues to work
run: pnpm bazel build //adev:build --full_build_adev --config=release
run: yarn bazel build //adev:build --full_build_adev --config=release
- name: Deploy to firebase
uses: ./.github/actions/deploy-docs-site
with:
+4 -4
View File
@@ -12,14 +12,14 @@ jobs:
labels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: angular/dev-infra/github-actions/pull-request-labeling@80db036355181684ed07021a175e9f039190d3d6
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/pull-request-labeling@5293c189424a61f7255d8171e3d653f983404851
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
post_approval_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: angular/dev-infra/github-actions/post-approval-changes@80db036355181684ed07021a175e9f039190d3d6
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/post-approval-changes@5293c189424a61f7255d8171e3d653f983404851
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+2 -2
View File
@@ -13,8 +13,8 @@ jobs:
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: angular/dev-infra/github-actions/google-internal-tests@80db036355181684ed07021a175e9f039190d3d6
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: angular/dev-infra/github-actions/google-internal-tests@5293c189424a61f7255d8171e3d653f983404851
with:
run-tests-guide-url: http://go/angular-g3sync-start
github-token: ${{ secrets.GITHUB_TOKEN }}
+7 -7
View File
@@ -13,22 +13,22 @@ jobs:
JOBS: 2
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Saucelabs Variables
uses: angular/dev-infra/github-actions/saucelabs@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/saucelabs@5293c189424a61f7255d8171e3d653f983404851
- name: Set up Sauce Tunnel Daemon
run: pnpm bazel run //tools/saucelabs-daemon/background-service -- $JOBS &
run: yarn bazel run //tools/saucelabs-daemon/background-service -- $JOBS &
env:
SAUCE_TUNNEL_IDENTIFIER: angular-framework-${{ github.run_number }}
- name: Run all saucelabs bazel tests
run: |
TESTS=$(./node_modules/.bin/bazelisk query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "fixme-saucelabs", ...)')
pnpm bazel test --config=saucelabs --jobs=$JOBS ${TESTS}
yarn bazel test --config=saucelabs --jobs=$JOBS ${TESTS}
+1 -1
View File
@@ -9,6 +9,6 @@ jobs:
status:
runs-on: ubuntu-latest
steps:
- uses: angular/dev-infra/github-actions/unified-status-check@80db036355181684ed07021a175e9f039190d3d6
- uses: angular/dev-infra/github-actions/unified-status-check@5293c189424a61f7255d8171e3d653f983404851
with:
angular-robot-key: ${{ secrets.ANGULAR_ROBOT_PRIVATE_KEY }}
+7 -7
View File
@@ -21,11 +21,11 @@ jobs:
workflows: ${{ steps.workflows.outputs.workflows }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn -s install --frozen-lockfile
- id: workflows
run: echo "workflows=$(pnpm --silent ng-dev perf workflows --list)" >> "$GITHUB_OUTPUT"
run: echo "workflows=$(yarn -s ng-dev perf workflows --list)" >> "$GITHUB_OUTPUT"
workflow:
timeout-minutes: 30
@@ -36,11 +36,11 @@ jobs:
workflow: ${{ fromJSON(needs.list.outputs.workflows) }}
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn -s install --frozen-lockfile
# We utilize the google-github-actions/auth action to allow us to get an active credential using workflow
# identity federation. This allows us to request short lived credentials on demand, rather than storing
# credentials in secrets long term. More information can be found at:
@@ -50,4 +50,4 @@ jobs:
project_id: 'internal-200822'
workload_identity_provider: 'projects/823469418460/locations/global/workloadIdentityPools/measurables-tracking/providers/angular'
service_account: 'measures-uploader@internal-200822.iam.gserviceaccount.com'
- run: pnpm ng-dev perf workflows --name ${{ matrix.workflow }} --commit-sha ${{github.sha}}
- run: yarn ng-dev perf workflows --name ${{ matrix.workflow }} --commit-sha ${{github.sha}}
+48 -54
View File
@@ -19,27 +19,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- name: Check code lint
run: pnpm tslint
run: yarn -s tslint
- name: Check for circular dependencies
run: pnpm ts-circular-deps:check
run: yarn -s ts-circular-deps:check
- name: Validate pull approve configuration
run: pnpm ng-dev pullapprove verify
run: yarn -s ng-dev pullapprove verify
- name: Validate angular robot configuration
run: pnpm ng-dev ngbot verify
run: yarn -s ng-dev ngbot verify
- name: Confirm code builds with typescript as expected
run: pnpm check-tooling-setup
run: yarn -s check-tooling-setup
- name: Check commit message
run: pnpm ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
run: yarn ng-dev commit-message validate-range ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
- name: Check code format
run: pnpm ng-dev format changed --check ${{ github.event.pull_request.base.sha }}
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@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/linting/licenses@5293c189424a61f7255d8171e3d653f983404851
with:
allow-dependencies-licenses: 'pkg:npm/google-protobuf@'
@@ -47,45 +47,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- name: Run unit tests
run: pnpm devtools:test
run: yarn devtools:test
- name: Test build
run: pnpm devtools:build:chrome
- name: Cypress run
uses: cypress-io/github-action@b8ba51a856ba5f4c15cf39007636d4ab04f23e3c # v6.10.2
with:
command: pnpm devtools:test:e2e
start: pnpm bazel run //devtools/src:devserver
wait-on: 'http://localhost:4200'
wait-on-timeout: 300
run: yarn devtools:build:chrome
test:
runs-on: ubuntu-latest-8core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile --network-timeout 100000
- name: Run CI tests for framework
run: pnpm test:ci
run: yarn test:ci
env:
# Ensures Aspect lock files are up-to-date.
# TODO(devversion): Remove when removing pnpm.
# TODO(devversion): Remove when removing yarn.
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1'
- name: Upload GRPC logs (for debugging of RBE issues)
if: always()
@@ -98,41 +91,41 @@ jobs:
runs-on: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel Remote Caching
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile --network-timeout 100000
- name: Run integration CI tests for framework
run: pnpm integration-tests:ci
run: yarn integration-tests:ci
adev:
runs-on:
labels: ubuntu-latest-8core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- name: Run tests
run: pnpm bazel test //adev/...
run: yarn bazel test //adev/...
- name: Build adev in fast mode to ensure it continues to work
run: pnpm bazel build //adev:build --config=release
run: yarn bazel build //adev:build --config=release
zone-js:
runs-on:
labels: ubuntu-latest-4core
steps:
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@5293c189424a61f7255d8171e3d653f983404851
with:
cache-node-modules: true
node-module-directories: |
@@ -140,16 +133,16 @@ jobs:
./packages/zone.js/node_modules
./packages/zone.js/test/typings/node_modules
- name: Setup Bazel
uses: angular/dev-infra/github-actions/bazel/setup@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/setup@5293c189424a61f7255d8171e3d653f983404851
- name: Setup Bazel RBE
uses: angular/dev-infra/github-actions/bazel/configure-remote@80db036355181684ed07021a175e9f039190d3d6
uses: angular/dev-infra/github-actions/bazel/configure-remote@5293c189424a61f7255d8171e3d653f983404851
- name: Install node modules
run: pnpm install --frozen-lockfile
run: yarn install --frozen-lockfile
- run: |
pnpm bazel build \
yarn bazel build \
//packages/zone.js/bundles:zone.umd.js \
//packages/zone.js:npm_package \
//packages/zone.js/test/closure:closure
//packages/zone.js/test/closure:closure_rjs
- run: |
rm -Rf packages/zone.js/build
@@ -164,14 +157,15 @@ jobs:
cp dist/bin/packages/zone.js/test/closure/zone.closure.js ./packages/zone.js/build/test/zone.closure.mjs
# Install
- run: pnpm -C packages/zone.js install --frozen-lockfile
- run: yarn --cwd packages/zone.js install --frozen-lockfile --non-interactive
# Run zone.js tools tests
- run: pnpm -C packages/zone.js promisefinallytest
- run: pnpm -C packages/zone.js jest:test
- run: pnpm -C packages/zone.js jest:nodetest
- run: pnpm -C packages/zone.js vitest:test
- run: pnpm -C packages/zone.js electrontest
- run: pnpm -C packages/zone.js/test/typings test
- run: yarn --cwd packages/zone.js promisefinallytest
- run: yarn --cwd packages/zone.js jest:test
- run: yarn --cwd packages/zone.js jest:nodetest
- run: yarn --cwd packages/zone.js vitest:test
- run: yarn --cwd packages/zone.js electrontest
- run: yarn --cwd packages/zone.js/test/typings install --frozen-lockfile --non-interactive
- run: yarn --cwd packages/zone.js/test/typings test
# saucelabs:
# runs-on: ubuntu-latest-4core
@@ -183,5 +177,5 @@ jobs:
# with:
# cache-node-modules: true
# - name: Install node modules
# run: pnpm install --frozen-lockfile
# run: yarn install --frozen-lockfile
# - uses: ./.github/actions/saucelabs-legacy
+2 -2
View File
@@ -25,7 +25,7 @@ jobs:
steps:
- name: 'Checkout code'
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
@@ -47,6 +47,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: 'Upload to code-scanning'
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.11
uses: github/codeql-action/upload-sarif@d6bbdef45e766d081b84a2def353b0055f728d3e # v3.29.3
with:
sarif_file: results.sarif
@@ -24,7 +24,7 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
# Setting `persist-credentials: false` prevents the github-action account from being the
# account that is attempted to be used for authentication, instead the remote is set to
+1 -1
View File
@@ -1,6 +1,6 @@
set +e
pnpm --silent ng-dev commit-message pre-commit-validate --file $1 2>/dev/null
yarn -s ng-dev commit-message pre-commit-validate --file $1 2>/dev/null
if [ $? -ne 0 ]; then
echo "WARNING: failed to run commit message validation (ng-dev commit-mesage pre-commit-validate)"
fi
+1 -1
View File
@@ -1,6 +1,6 @@
set +e
pnpm --silent ng-dev format staged 2>/dev/null
yarn -s ng-dev format staged 2>/dev/null
if [ $? -ne 0 ]; then
echo "WARNING: failed to run file formatting (ng-dev format staged)"
fi
+1 -1
View File
@@ -1,6 +1,6 @@
set +e
pnpm --silent ng-dev commit-message restore-commit-message-draft $1 $2 2>/dev/null
yarn -s ng-dev commit-message restore-commit-message-draft $1 $2 2>/dev/null
if [ $? -ne 0 ]; then
echo "WARNING: failed to attempt to restore commit message draft (ng-dev commit-message restore-commit-message-draft)"
fi
+1 -1
View File
@@ -1 +1 @@
22.18.0
22.17.1
+27 -28
View File
@@ -1,23 +1,25 @@
// TODO: Define these packages in a single common location.
const localAngularPackages = [
'@angular/animations',
'@angular/common',
'@angular/compiler',
'@angular/compiler-cli',
'@angular/core',
'@angular/elements',
'@angular/forms',
'@angular/language-service',
'@angular/localize',
'@angular/platform-browser',
'@angular/platform-browser-dynamic',
'@angular/platform-server',
'@angular/router',
'@angular/service-worker',
'@angular/upgrade',
];
function readPackage(pkg, context) {
// TODO(devversion): This exists temporarily during migration as we can't have `workspace:*` deps
// in the `package.json` also processed by Yarn
if (pkg.name === 'angular-srcs') {
pkg.dependencies = {
...pkg.dependencies,
// These dependencies are added to the workspace root so that peer dependencies
// 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:*',
};
}
// TODO(devversion): This allows us to make compiler/TS a production dependency of compiler-cli
// because `rules_js` doesn't otherwise include the dependency in the `npm_package_store`.
// See: https://github.com/aspect-build/rules_js/issues/2226
@@ -25,29 +27,26 @@ function readPackage(pkg, context) {
pkg.dependencies = {
...pkg.dependencies,
'@angular/compiler': 'workspace:*',
'typescript': '5.9.0-beta',
'typescript': '5.8.3',
};
}
Object.entries(pkg.peerDependencies).forEach(([key, version]) => {
// Any package that has a peerDependency on rxjs or zone.js, should instead treat the peerDependency as a
// Any package that has a peerDependency on rxjs, should instead treat the peerDependency as a
// regular dependency.
if (['rxjs', 'zone.js'].includes(key)) {
if (key === 'rxjs') {
pkg.dependencies = {
...pkg.dependencies,
[key]: version,
'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. The
// package is also removed from peerDependencies as it was moved over and will just cause errors.
if (localAngularPackages.includes(key)) {
// 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: *',
};
delete pkg.peerDependencies[key];
}
});
+6 -5
View File
@@ -56,8 +56,8 @@
version: 3
availability:
users_unavailable: ['devversion']
# availability:
# users_unavailable: ['atscott']
# Meta field that goes unused by PullApprove to allow for defining aliases to be
# used throughout the config.
@@ -177,7 +177,6 @@ groups:
- thePunderWoman
- ~pkozlowski-opensource
- mmalerba
- JeanMeche
# =========================================================
# Framework: Security-sensitive files which require extra review
@@ -274,7 +273,7 @@ groups:
- bencodezen
- crisbeto
- kirjs
- JeanMeche
- ~JeanMeche
- jelbourn
- thePunderWoman
- devversion
@@ -333,11 +332,13 @@ groups:
'packages/examples/{*,.*}',
'scripts/**/{*,.*}',
'third_party/**/{*,.*}',
'tools/bazel-repo-patches/**/{*,.*}',
'tools/contributing-stats/**/{*,.*}',
'tools/esm-interop/**/{*,.*}',
'tools/gulp-tasks/**/{*,.*}',
'tools/legacy-saucelabs/**/{*,.*}',
'tools/manual_api_docs/**/{*,.*}',
'tools/pnpm-patches/**/{*,.*}',
'tools/npm-patches/**/{*,.*}',
'tools/rxjs/**/{*,.*}',
'tools/saucelabs-daemon/**/{*,.*}',
'tools/saucelabs/**/{*,.*}',
+4 -3
View File
@@ -1,7 +1,8 @@
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("//:yarn.bzl", "YARN_PATH")
load("//tools:defaults.bzl", "copy_to_bin", "js_binary")
load("//tools:defaults.bzl", "nodejs_binary")
package(default_visibility = ["//visibility:public"])
@@ -60,7 +61,7 @@ config_setting(
values = {"stamp": "true"},
)
js_binary(
nodejs_binary(
name = "yarn_vendored",
data = [".yarn/releases/yarn-1.22.22.cjs"],
entry_point = ".yarn/releases/yarn-1.22.22.cjs",
-196
View File
@@ -1,199 +1,3 @@
<a name="20.2.1"></a>
# 20.2.1 (2025-08-21)
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [a28672fb70](https://github.com/angular/angular/commit/a28672fb7017cc62e42829c5910c3b39373d7913) | fix | Keep paraenthesis in Nullish + Boolean expression. ([#63292](https://github.com/angular/angular/pull/63292)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="21.0.0-next.0"></a>
# 21.0.0-next.0 (2025-08-20)
## Breaking Changes
### compiler-cli
- The Angular compiler now produces an error when the
the `emitDeclarationOnly` TS compiler option is enabled as this mode is
not supported.
### router
- `lastSuccessfulNavigation` is now a signal and needs to be invoked
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [be7110342b](https://github.com/angular/angular/commit/be7110342b61d837822524d4f60f56a7f859f594) | fix | disallow compiling with the `emitDeclarationOnly` TS compiler option enabled ([#61609](https://github.com/angular/angular/pull/61609)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [4bed062bc9](https://github.com/angular/angular/commit/4bed062bc9f2a0a66c9af3cb8aeb42ee023c6393) | feat | Provide http services in root ([#56212](https://github.com/angular/angular/pull/56212)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [4e0fc81491](https://github.com/angular/angular/commit/4e0fc81491bfe6e4eac5c59ef0bde908a3d58413) | feat | convert `lastSuccessfulNavigation` to signal ([#63057](https://github.com/angular/angular/pull/63057)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.2.0"></a>
# 20.2.0 (2025-08-20)
## Deprecations
### animations
- @angular/animations
### core
- @angular/animations
### router
- The Router.getCurrentNavigation method is deprecated. Use the Router.currentNavigation signal instead.
- The Router.getCurrentNavigation method is deprecated. Use the Router.currentNavigation signal instead.
### animations
| Commit | Type | Description |
| -- | -- | -- |
| [9766116cea](https://github.com/angular/angular/commit/9766116cea69607d80144251a599f1cc1b12e02c) | refactor | deprecate the animations package ([#62795](https://github.com/angular/angular/pull/62795)) |
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [7767aa640c](https://github.com/angular/angular/commit/7767aa640c542f5058df9322f2bbe974fa8d3c81) | fix | allow more characters in square-bracketed attribute names ([#62742](https://github.com/angular/angular/pull/62742)) |
| [7b51728813](https://github.com/angular/angular/commit/7b517288139aec166e5e5b60e84b1e22e3d6b70f) | fix | fixes animation event host bindings not firing ([#63217](https://github.com/angular/angular/pull/63217)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [5abfe4a899](https://github.com/angular/angular/commit/5abfe4a8999e42ad44e6f1d4414f241094bb8fdb) | feat | add diagnostic for uninvoked functions in text interpolation ([#59191](https://github.com/angular/angular/pull/59191)) |
| [c4917074f1](https://github.com/angular/angular/commit/c4917074f1e278ea24948a8810b3d4f306765174) | fix | display proper function in NG8117 message ([#62842](https://github.com/angular/angular/pull/62842)) |
| [812463c563](https://github.com/angular/angular/commit/812463c5636effe5bd5ba5c7c7fc65c3cc08d047) | fix | Ignore diagnostics on ngTemplateContextGuard lines in TCB ([#63054](https://github.com/angular/angular/pull/63054)) |
| [45b030b5ce](https://github.com/angular/angular/commit/45b030b5ce1e116a88fe1c2fe133f654fb1f66c5) | fix | prevent dom event assertion in TCB generation on older angular versions ([#63053](https://github.com/angular/angular/pull/63053)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [6b1f4b9e8b](https://github.com/angular/angular/commit/6b1f4b9e8bb981377e271e6af0d9768ff7f765e9) | feat | add enter and leave animation instructions ([#62682](https://github.com/angular/angular/pull/62682)) |
| [cec91c0035](https://github.com/angular/angular/commit/cec91c00356ee3974c39c9471b243a2a16149f5b) | feat | add option to infer the tag names of components in tests ([#62283](https://github.com/angular/angular/pull/62283)) |
| [141bb75ff2](https://github.com/angular/angular/commit/141bb75ff241425a93ce5b60b56a4247e67d7648) | feat | Promote zoneless to stable ([#62699](https://github.com/angular/angular/pull/62699)) |
| [4138aca91f](https://github.com/angular/angular/commit/4138aca91fe828f0cfbd779d0c456cdea7703bdc) | feat | render ARIA property bindings as attributes ([#62630](https://github.com/angular/angular/pull/62630)) |
| [a409534d6c](https://github.com/angular/angular/commit/a409534d6c3d7cb4472afffd6b17df8c25e34106) | feat | support `as` aliases on `else if` blocks ([#63047](https://github.com/angular/angular/pull/63047)) |
| [745ea44394](https://github.com/angular/angular/commit/745ea4439465494ab5b7002dd1fa320cd32220fb) | feat | support TypeScript 5.9 ([#62541](https://github.com/angular/angular/pull/62541)) |
| [593cc8a368](https://github.com/angular/angular/commit/593cc8a3684dfb163bfffa265c5efb3bc7efacd1) | fix | checks if body exists before continuing ([#62768](https://github.com/angular/angular/pull/62768)) |
| [bdc31675b7](https://github.com/angular/angular/commit/bdc31675b7e5f37d2b312c766fe4963305620bdf) | fix | ensure animate events do not have duplicate elements ([#63216](https://github.com/angular/angular/pull/63216)) |
| [de3a0c5cf3](https://github.com/angular/angular/commit/de3a0c5cf3f87782fa63d30edf6ac05eb6be9fac) | fix | Fix `animate.enter` class removal when composing classes ([#62981](https://github.com/angular/angular/pull/62981)) |
| [6597ac0af7](https://github.com/angular/angular/commit/6597ac0af78ac2224ec2f9a37283b53aee11abe1) | fix | fix support for space separated strings in leave animations ([#62979](https://github.com/angular/angular/pull/62979)) |
| [ebd622b344](https://github.com/angular/angular/commit/ebd622b3449789b72efc8295244ca924a299e7c1) | fix | fixes empty animations when recalculating styles ([#63007](https://github.com/angular/angular/pull/63007)) |
| [455b147488](https://github.com/angular/angular/commit/455b147488dc0a064c0ca13a96a4df3c3ed01152) | fix | fixes timing issues with enter animations ([#62925](https://github.com/angular/angular/pull/62925)) |
| [f9d73cc687](https://github.com/angular/angular/commit/f9d73cc6877d516da4ab4704c21bb19164123fa1) | fix | handle cases where classes added have no animations ([#63242](https://github.com/angular/angular/pull/63242)) |
| [6a1184600c](https://github.com/angular/angular/commit/6a1184600ce0fc7a3f338d6766612e9510ef5518) | fix | prevents duplicate nodes when `@if` toggles with leave animations ([#63048](https://github.com/angular/angular/pull/63048)) |
| [063b5e166f](https://github.com/angular/angular/commit/063b5e166f66bce1abd06c258242212009e76cca) | fix | switch check to documentElement with chaining ([#62773](https://github.com/angular/angular/pull/62773)) |
| [320de4e96d](https://github.com/angular/angular/commit/320de4e96d250cad1ce2c9f8c0fa2022da53b734) | refactor | deprecate animations field on component interface ([#62895](https://github.com/angular/angular/pull/62895)) |
### forms
| Commit | Type | Description |
| -- | -- | -- |
| [c353497a01](https://github.com/angular/angular/commit/c353497a01776cd702af6c5136fdae5fc6ce94d5) | feat | add support for pushing an array of controls to formarray ([#57102](https://github.com/angular/angular/pull/57102)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [0984b30388](https://github.com/angular/angular/commit/0984b30388ef51dfad66f1228f665b89b73ef3fb) | feat | Add redirected property to HttpResponse and HttpErrorResponse ([#62675](https://github.com/angular/angular/pull/62675)) |
| [be811fee79](https://github.com/angular/angular/commit/be811fee7925fb482567fa7cd9d485ac28acdade) | feat | add referrer & integrity support for fetch requests in httpResource ([#62461](https://github.com/angular/angular/pull/62461)) |
| [1cf9d9064c](https://github.com/angular/angular/commit/1cf9d9064c15c00071ece3b78c8019035a6db6ce) | feat | Add support for fetch referrer & integrity options in HttpClient ([#62417](https://github.com/angular/angular/pull/62417)) |
| [1408baff45](https://github.com/angular/angular/commit/1408baff453e636da05838fa17c6e4abd86c4b72) | fix | Add missing timeout and transferCache options to `HttpClient` ([#62586](https://github.com/angular/angular/pull/62586)) |
### language-service
| Commit | Type | Description |
| -- | -- | -- |
| [c81e345e72](https://github.com/angular/angular/commit/c81e345e726b5b281621159c789e6d80a9f328e2) | feat | support auto-import for attribute completions ([#62797](https://github.com/angular/angular/pull/62797)) |
| [d64dd27a02](https://github.com/angular/angular/commit/d64dd27a02630b631bc9890d7292d4683493cb65) | feat | support to report the deprecated API in the template ([#62054](https://github.com/angular/angular/pull/62054)) |
| [591c7e2ec8](https://github.com/angular/angular/commit/591c7e2ec82c6669ffa6e0011b8a0a4fc12e9c3a) | fix | Support to resolve the re-export component. ([#62585](https://github.com/angular/angular/pull/62585)) |
### platform-browser
| Commit | Type | Description |
| -- | -- | -- |
| [52b8e07d6e](https://github.com/angular/angular/commit/52b8e07d6e568a527fae18a8a867dacdf8053e20) | feat | Warns on conflicting hydration and blocking navigation ([#62963](https://github.com/angular/angular/pull/62963)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [d00b3fed58](https://github.com/angular/angular/commit/d00b3fed58496369d9f3a1ac0d74416a586be78b) | feat | add a `currentNavigation` signal to the `Router` service. ([#62971](https://github.com/angular/angular/pull/62971)) |
| [687c374826](https://github.com/angular/angular/commit/687c374826c5e9ea91839c20f0df815ce085c583) | feat | add a currentNavigation signal to the Router service. ([#63011](https://github.com/angular/angular/pull/63011)) |
| [9c45c322d1](https://github.com/angular/angular/commit/9c45c322d1ac3b05c916b7c956263066fb9be47f) | fix | ensure preloaded components are properly activated ([#62502](https://github.com/angular/angular/pull/62502)) |
### service-worker
| Commit | Type | Description |
| -- | -- | -- |
| [8255e0cf15](https://github.com/angular/angular/commit/8255e0cf15353e9eee339ae01851e32c0e5e174d) | feat | add messageerror event handling and logging ([#62834](https://github.com/angular/angular/pull/62834)) |
| [5220b51e75](https://github.com/angular/angular/commit/5220b51e75e672ff41c90f4798289961973df8e0) | feat | Adds for type in provideServiceWorker ([#62831](https://github.com/angular/angular/pull/62831)) |
| [4ac6171b09](https://github.com/angular/angular/commit/4ac6171b09e449c619e0588c366861f8f3bb59be) | feat | Adds support for updateViaCache in provideServiceWorker ([#62721](https://github.com/angular/angular/pull/62721)) |
| [b65c3d5e19](https://github.com/angular/angular/commit/b65c3d5e195267dd90b2826d4615ced1328b1709) | feat | Improves storage full detection in data caching ([#62737](https://github.com/angular/angular/pull/62737)) |
| [3b214d2040](https://github.com/angular/angular/commit/3b214d20403160ab73e65dca0352545efd577c31) | feat | Logs unhandled promise rejections in service worker ([#63059](https://github.com/angular/angular/pull/63059)) |
| [6d011687ec](https://github.com/angular/angular/commit/6d011687ec1fa2b8f0211379bb98adc8e02f4e9a) | feat | notify clients about version failures ([#62718](https://github.com/angular/angular/pull/62718)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.8"></a>
# 20.1.8 (2025-08-20)
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [691f5ed033](https://github.com/angular/angular/commit/691f5ed0332d813801f599448577a2c1d450a5ad) | fix | error when ng-content fallback has translated children ([#63156](https://github.com/angular/angular/pull/63156)) |
| [b1dec9bc50](https://github.com/angular/angular/commit/b1dec9bc50f5694cfa1e3629fd48543126debd10) | fix | incorrect source span for expression AST inside template attribute ([#63175](https://github.com/angular/angular/pull/63175)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [cda402f1d8](https://github.com/angular/angular/commit/cda402f1d8bddeedc9aca1979a9bf01be32f81b2) | fix | account for expression with type arguments during HMR extraction ([#63261](https://github.com/angular/angular/pull/63261)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.7"></a>
# 20.1.7 (2025-08-13)
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [d9e37908a5](https://github.com/angular/angular/commit/d9e37908a5f42a4226fd6e2d3493abf35ee5a99a) | fix | incorrect spans for AST inside input value with leading space ([#63082](https://github.com/angular/angular/pull/63082)) |
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [4aa120ac00](https://github.com/angular/angular/commit/4aa120ac000a569a29e45e9c6db9e4f32c61d183) | fix | error when type checking host bindings of generic directive ([#63061](https://github.com/angular/angular/pull/63061)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [322042c5b3](https://github.com/angular/angular/commit/322042c5b30e181019bfdaa6a57fc5abaea7adc1) | fix | destroying the effect on `afterRenderEffect` ([#63001](https://github.com/angular/angular/pull/63001)) |
### router
| Commit | Type | Description |
| -- | -- | -- |
| [5fd79424e3](https://github.com/angular/angular/commit/5fd79424e34ea4bbbfca68bf80ca5541aece829f) | fix | attempt to resolve component resources in JIT mode ([#63062](https://github.com/angular/angular/pull/63062)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.6"></a>
# 20.1.6 (2025-08-06)
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.5"></a>
# 20.1.5 (2025-08-06)
### compiler-cli
| Commit | Type | Description |
| -- | -- | -- |
| [3b2e8efcac](https://github.com/angular/angular/commit/3b2e8efcacc5b413b03e4281fc8af297e5c81a9f) | fix | correctly type check host listeners to own outputs ([#62965](https://github.com/angular/angular/pull/62965)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [c9f3976eba](https://github.com/angular/angular/commit/c9f3976eba66d113f4a1919ee91b8833d679733a) | fix | properly recognize failed `fetch` responses when loading external resources in JIT ([#62992](https://github.com/angular/angular/pull/62992)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [ae443f8eb0](https://github.com/angular/angular/commit/ae443f8eb00c047bb88527f2311e86df3bc6be35) | fix | Reset headers, progress, and statusCode when using `set()` in `HttpResource` ([#62873](https://github.com/angular/angular/pull/62873)) |
### migrations
| Commit | Type | Description |
| -- | -- | -- |
| [7a5851e4b0](https://github.com/angular/angular/commit/7a5851e4b0a17da35db7fb276a3dca4909f9137b) | fix | incorrect filtering in inject migration ([#62913](https://github.com/angular/angular/pull/62913)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.4"></a>
# 20.1.4 (2025-07-31)
### compiler
| Commit | Type | Description |
| -- | -- | -- |
| [db3c5826ee](https://github.com/angular/angular/commit/db3c5826ee0b52e5b7886087b82990340a34c1ab) | fix | exclude more safe reads expression from 2way-binding ([#62852](https://github.com/angular/angular/pull/62852)) |
### core
| Commit | Type | Description |
| -- | -- | -- |
| [c633b63e56](https://github.com/angular/angular/commit/c633b63e561d7142dd9a1f8631813cc47a169058) | fix | update symbols for new signals api ([#62284](https://github.com/angular/angular/pull/62284)) |
### http
| Commit | Type | Description |
| -- | -- | -- |
| [ab6033979a](https://github.com/angular/angular/commit/ab6033979a3b409738d55d0c01effb378473c05a) | fix | add missing http options allowed in fetch API ([#62881](https://github.com/angular/angular/pull/62881)) |
| [15670d8417](https://github.com/angular/angular/commit/15670d8417449c5b5f2990209552a1fc61420acb) | fix | propagate plain errors when parsing fails ([#62765](https://github.com/angular/angular/pull/62765)) |
<!-- CHANGELOG SPLIT MARKER -->
<a name="20.1.3"></a>
# 20.1.3 (2025-07-23)
### core
-163
View File
@@ -1,163 +0,0 @@
"""Rules/toolchains for angular with Bazel."""
module(
name = "angular",
)
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "rules_nodejs", version = "6.5.0")
bazel_dep(name = "aspect_rules_ts", version = "3.7.0")
bazel_dep(name = "aspect_rules_js", version = "2.5.0")
bazel_dep(name = "aspect_rules_esbuild", version = "0.22.1")
bazel_dep(name = "aspect_rules_jasmine", version = "2.0.0")
bazel_dep(name = "aspect_rules_rollup", version = "2.0.1")
bazel_dep(name = "bazel_skylib", version = "1.8.1")
bazel_dep(name = "aspect_bazel_lib", version = "2.21.1")
bazel_dep(name = "tar.bzl", version = "0.5.5")
bazel_dep(name = "yq.bzl", version = "0.2.0")
bazel_dep(name = "rules_angular")
git_override(
module_name = "rules_angular",
commit = "17eac47ea99057f7473a7d93292e76327c894ed9",
remote = "https://github.com/devversion/rules_angular.git",
)
bazel_dep(name = "devinfra")
git_override(
module_name = "devinfra",
commit = "00a4cf14cdc374867673a52ecb556f356da8bec0",
remote = "https://github.com/angular/dev-infra.git",
)
bazel_dep(name = "rules_sass")
git_override(
module_name = "rules_sass",
commit = "76078d5e9776a0080dcee496e90b88d8a6179c19",
remote = "https://github.com/devversion/rules_sass.git",
)
bazel_dep(name = "rules_browsers")
git_override(
module_name = "rules_browsers",
commit = "8ee9ae3216ef26516c8ef20537c89857343cdc3a",
remote = "https://github.com/devversion/rules_browsers.git",
)
yq = use_extension("@yq.bzl//yq:extensions.bzl", "yq")
use_repo(yq, "yq_toolchains")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node")
node.toolchain(node_version = "20.19.0")
use_repo(node, "nodejs_toolchains")
use_repo(node, "nodejs_darwin_amd64")
use_repo(node, "nodejs_darwin_arm64")
use_repo(node, "nodejs_linux_amd64")
use_repo(node, "nodejs_linux_arm64")
use_repo(node, "nodejs_linux_ppc64le")
use_repo(node, "nodejs_linux_s390x")
use_repo(node, "nodejs_windows_amd64")
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
use_repo(pnpm, "pnpm")
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
npm.npm_translate_lock(
name = "npm",
data = [
"//:.pnpmfile.cjs",
"//:package.json",
"//:pnpm-workspace.yaml",
"//:tools/pnpm-patches/dagre-d3-es+7.0.11.patch",
"//adev:package.json",
"//adev/shared-docs:package.json",
"//adev/shared-docs/pipeline/api-gen:package.json",
"//integration:package.json",
"//modules:package.json",
"//packages/animations:package.json",
"//packages/benchpress:package.json",
"//packages/common:package.json",
"//packages/compiler:package.json",
"//packages/compiler-cli:package.json",
"//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/language-service: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/service-worker:package.json",
"//packages/upgrade:package.json",
"//tools/bazel/rules_angular_store:package.json",
],
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext")
rules_ts_ext.deps(
name = "angular_npm_typescript",
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.9.2 | jq -r '.dist.integrity'
ts_integrity = "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
ts_version_from = "//:package.json",
)
use_repo(rules_ts_ext, **{"npm_typescript": "angular_npm_typescript"})
rules_angular = use_extension("@rules_angular//setup:extensions.bzl", "rules_angular")
rules_angular.setup(
name = "components_rules_angular_configurable_deps",
angular_compiler_cli = "//:node_modules/@angular/compiler-cli",
typescript = "//:node_modules/typescript",
)
use_repo(rules_angular, **{"rules_angular_configurable_deps": "components_rules_angular_configurable_deps"})
register_toolchains(
"@devinfra//bazel/git-toolchain:git_linux_toolchain",
"@devinfra//bazel/git-toolchain:git_macos_x86_toolchain",
"@devinfra//bazel/git-toolchain:git_macos_arm64_toolchain",
"@devinfra//bazel/git-toolchain:git_windows_toolchain",
)
CLDR_VERSION = "41"
cldr_json_data = use_repo_rule("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_json_data_repository")
cldr_json_data(
name = "cldr_json_data",
urls = {
"https://github.com/unicode-org/cldr-json/releases/download/%s.0.0/cldr-%s.0.0-json-full.zip" % (CLDR_VERSION, CLDR_VERSION): "649b76647269e32b1b0a5f7b6eed52e9e63a1581f1afdcf4f6771e49c9713614",
},
)
cldr_xml_data = use_repo_rule("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_xml_data_repository")
cldr_xml_data(
name = "cldr_xml_data",
urls = {
"https://github.com/unicode-org/cldr/releases/download/release-%s/cldr-common-%s.0.zip" % (CLDR_VERSION, CLDR_VERSION): "823c6170c41e2de2c229574e8a436332d25f1c9723409867fe721e00bc92d853",
},
)
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Fetch sauce connect (tool to open Saucelabs tunnel for Saucelabs browser tests)
http_archive(
name = "sauce_connect_linux_amd64",
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
sha256 = "26b9c3630f441b47854b6032f7eca6f1d88d3f62e50ee44c27015d71a5155c36",
strip_prefix = "sc-4.8.2-linux",
url = "https://saucelabs.com/downloads/sc-4.8.2-linux.tar.gz",
)
http_archive(
name = "sauce_connect_mac",
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
sha256 = "28277ce81ef9ab84f5b87b526258920a8ead44789a5034346e872629bbf38089",
strip_prefix = "sc-4.8.2-osx",
url = "https://saucelabs.com/downloads/sc-4.8.2-osx.zip",
)
-4333
View File
File diff suppressed because it is too large Load Diff
+362
View File
@@ -0,0 +1,362 @@
workspace(
name = "angular",
)
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//:yarn.bzl", "YARN_LABEL")
http_archive(
name = "build_bazel_rules_nodejs",
patches = [
"//tools/esm-interop:patches/bazel/nodejs_binary_esm_support.patch",
],
sha256 = "5dd1e5dea1322174c57d3ca7b899da381d516220793d0adef3ba03b9d23baa8e",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.3/rules_nodejs-5.8.3.tar.gz"],
)
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
build_bazel_rules_nodejs_dependencies()
# The PKG rules are needed to build tar packages for integration tests. The builtin
# rule in `@bazel_tools` is not Windows compatible and outdated.
# NOTE: We cannot move past version 0.6.0 as pkg_tar no longer works on directories, which rules_nodejs
# relies on for node_modules setup.
http_archive(
name = "rules_pkg",
sha256 = "62eeb544ff1ef41d786e329e1536c1d541bb9bcad27ae984d57f18f314018e66",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.6.0/rules_pkg-0.6.0.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.6.0/rules_pkg-0.6.0.tar.gz",
],
)
http_archive(
name = "aspect_rules_js",
sha256 = "304c51726b727d53277dd28fcda1b8e43b7e46818530b8d6265e7be98d5e2b25",
strip_prefix = "rules_js-2.3.8",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.3.8/rules_js-v2.3.8.tar.gz",
)
load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
rules_js_dependencies()
# Setup the Node.js toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
NODE_VERSION = "20.19.0"
NODE_20_REPO = {
"20.19.0-darwin_arm64": ("node-v20.19.0-darwin-arm64.tar.gz", "node-v20.19.0-darwin-arm64", "c016cd1975a264a29dc1b07c6fbe60d5df0a0c2beb4113c0450e3d998d1a0d9c"),
"20.19.0-darwin_amd64": ("node-v20.19.0-darwin-x64.tar.gz", "node-v20.19.0-darwin-x64", "a8554af97d6491fdbdabe63d3a1cfb9571228d25a3ad9aed2df856facb131b20"),
"20.19.0-linux_arm64": ("node-v20.19.0-linux-arm64.tar.xz", "node-v20.19.0-linux-arm64", "dbe339e55eb393955a213e6b872066880bb9feceaa494f4d44c7aac205ec2ab9"),
"20.19.0-linux_ppc64le": ("node-v20.19.0-linux-ppc64le.tar.xz", "node-v20.19.0-linux-ppc64le", "84937108f005679e60b486ed8e801cebfe923f02b76d8e710463d32f82181f65"),
"20.19.0-linux_s390x": ("node-v20.19.0-linux-s390x.tar.xz", "node-v20.19.0-linux-s390x", "11f8ee99d792a83bba7b29911e0229dd6cd5e88987d7416346067db1cc76d89a"),
"20.19.0-linux_amd64": ("node-v20.19.0-linux-x64.tar.xz", "node-v20.19.0-linux-x64", "b4e336584d62abefad31baecff7af167268be9bb7dd11f1297112e6eed3ca0d5"),
"20.19.0-windows_amd64": ("node-v20.19.0-win-x64.zip", "node-v20.19.0-win-x64", "be72284c7bc62de07d5a9fd0ae196879842c085f11f7f2b60bf8864c0c9d6a4f"),
}
nodejs_register_toolchains(
name = "nodejs",
node_repositories = NODE_20_REPO,
node_version = NODE_VERSION,
)
load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains")
rules_js_register_toolchains(
node_repositories = NODE_20_REPO,
node_version = NODE_VERSION,
)
# Download npm dependencies.
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
load("//integration:npm_package_archives.bzl", "npm_package_archives")
yarn_install(
name = "npm",
# Note that we add the postinstall scripts here so that the dependencies are re-installed
# when the postinstall patches are modified.
data = [
YARN_LABEL,
"//:.yarnrc",
"//:tools/npm-patches/@angular+ng-dev+0.0.0-a6dcd24107d12114198251ee5d20cda814a1986a.patch",
"//:tools/npm-patches/dagre-d3-es+7.0.11.patch",
"//tools:postinstall-patches.js",
"//tools/esm-interop:patches/npm/@bazel+concatjs+5.8.1.patch",
"//tools/esm-interop:patches/npm/@bazel+esbuild+5.7.1.patch",
"//tools/esm-interop:patches/npm/rxjs+6.6.7.patch",
],
# Currently disabled due to:
# 1. Missing Windows support currently.
# 2. Incompatibilites with the `ts_library` rule.
exports_directories_only = False,
manual_build_file_contents = npm_package_archives(),
package_json = "//:package.json",
yarn = YARN_LABEL,
yarn_lock = "//:yarn.lock",
)
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
npm_translate_lock(
name = "npm2",
data = [
"//:.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",
"//packages/animations:package.json",
"//packages/benchpress:package.json",
"//packages/common:package.json",
"//packages/compiler:package.json",
"//packages/compiler-cli:package.json",
"//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",
"//tools/bazel/rules_angular_store:package.json",
],
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
update_pnpm_lock = True,
verify_node_modules_ignored = "//:.bazelignore",
yarn_lock = "//:yarn.lock",
)
load("@npm2//:repositories.bzl", "npm_repositories")
npm_repositories()
http_archive(
name = "aspect_rules_ts",
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")
rules_ts_dependencies(
# Obtained by: curl --silent https://registry.npmjs.org/typescript/5.8.2 | jq -r '.dist.integrity'
ts_integrity = "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
ts_version_from = "//:package.json",
)
http_archive(
name = "aspect_rules_rollup",
sha256 = "0b8ac7d97cd660eb9a275600227e9c4268f5904cba962939d1a6ce9a0a059d2e",
strip_prefix = "rules_rollup-2.0.1",
url = "https://github.com/aspect-build/rules_rollup/releases/download/v2.0.1/rules_rollup-v2.0.1.tar.gz",
)
http_archive(
name = "aspect_rules_jasmine",
sha256 = "0d2f9c977842685895020cac721d8cc4f1b37aae15af46128cf619741dc61529",
strip_prefix = "rules_jasmine-2.0.0",
url = "https://github.com/aspect-build/rules_jasmine/releases/download/v2.0.0/rules_jasmine-v2.0.0.tar.gz",
)
load("@aspect_rules_jasmine//jasmine:dependencies.bzl", "rules_jasmine_dependencies")
rules_jasmine_dependencies()
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
aspect_bazel_lib_dependencies()
# TODO: Remove when karma webtest is no longer used
http_archive(
name = "io_bazel_rules_webtesting",
sha256 = "e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a",
urls = ["https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz"],
)
# Setup the rules_webtesting toolchain
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
web_test_repositories()
load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories")
esbuild_repositories(
npm_repository = "npm",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()
load("//packages/common/locales/generate-locales-tool:cldr-data.bzl", "cldr_json_data_repository", "cldr_xml_data_repository")
cldr_major_version = "41"
cldr_json_data_repository(
name = "cldr_json_data",
urls = {
"https://github.com/unicode-org/cldr-json/releases/download/%s.0.0/cldr-%s.0.0-json-full.zip" % (cldr_major_version, cldr_major_version): "649b76647269e32b1b0a5f7b6eed52e9e63a1581f1afdcf4f6771e49c9713614",
},
)
cldr_xml_data_repository(
name = "cldr_xml_data",
urls = {
"https://github.com/unicode-org/cldr/releases/download/release-%s/cldr-common-%s.0.zip" % (cldr_major_version, cldr_major_version): "823c6170c41e2de2c229574e8a436332d25f1c9723409867fe721e00bc92d853",
},
)
# sass rules
http_archive(
name = "io_bazel_rules_sass",
sha256 = "bff856619317a388292970a7d4bfea8c9e627a1886fe7132075d378d4067c09e",
strip_prefix = "rules_sass-cbe5261f925751a465a1a54bf2147e5f696ec567",
urls = [
"https://github.com/bazelbuild/rules_sass/archive/cbe5261f925751a465a1a54bf2147e5f696ec567.zip",
],
)
# Setup the rules_sass toolchain
load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories")
sass_repositories(
yarn_script = YARN_LABEL,
)
# Fetch sauce connect (tool to open Saucelabs tunnel for Saucelabs browser tests)
http_archive(
name = "sauce_connect_linux_amd64",
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
sha256 = "26b9c3630f441b47854b6032f7eca6f1d88d3f62e50ee44c27015d71a5155c36",
strip_prefix = "sc-4.8.2-linux",
url = "https://saucelabs.com/downloads/sc-4.8.2-linux.tar.gz",
)
http_archive(
name = "sauce_connect_mac",
build_file_content = """exports_files(["bin/sc"], visibility = ["//visibility:public"])""",
sha256 = "28277ce81ef9ab84f5b87b526258920a8ead44789a5034346e872629bbf38089",
strip_prefix = "sc-4.8.2-osx",
url = "https://saucelabs.com/downloads/sc-4.8.2-osx.zip",
)
yarn_install(
name = "npm_ts_versions",
data = [
YARN_LABEL,
"//:.yarnrc",
],
exports_directories_only = False,
package_json = "//packages/core/schematics/migrations/signal-migration/test/ts-versions:package.json",
yarn = YARN_LABEL,
yarn_lock = "//packages/core/schematics/migrations/signal-migration/test/ts-versions:yarn.lock",
)
git_repository(
name = "devinfra",
commit = "5293c189424a61f7255d8171e3d653f983404851",
remote = "https://github.com/angular/dev-infra.git",
)
load("@devinfra//bazel:setup_dependencies_1.bzl", "setup_dependencies_1")
setup_dependencies_1()
load("@devinfra//bazel:setup_dependencies_2.bzl", "setup_dependencies_2")
setup_dependencies_2()
load("@devinfra//bazel/browsers:browser_repositories.bzl", "browser_repositories")
browser_repositories()
git_repository(
name = "rules_angular",
commit = "88ddcf8cccbfef57f8cc3dda4881f18ec739428e",
remote = "https://github.com/devversion/rules_angular.git",
)
load("@rules_angular//setup:step_1.bzl", "rules_angular_step1")
rules_angular_step1()
load("@rules_angular//setup:step_2.bzl", "rules_angular_step2")
rules_angular_step2()
load("@rules_angular//setup:step_3.bzl", "rules_angular_step3")
rules_angular_step3(
angular_compiler_cli = "@angular//tools/bazel/rules_angular_store:node_modules/@angular/compiler-cli",
typescript = "@angular//:node_modules/typescript",
)
git_repository(
name = "rules_browsers",
commit = "56ef8007ea07cd1916429bca8bb523433b0e9cdc",
remote = "https://github.com/devversion/rules_browsers.git",
)
load("@rules_browsers//setup:step_1.bzl", "rules_browsers_setup_1")
rules_browsers_setup_1()
load("@rules_browsers//setup:step_2.bzl", "rules_browsers_setup_2")
rules_browsers_setup_2()
http_archive(
name = "aspect_rules_esbuild",
sha256 = "530adfeae30bbbd097e8af845a44a04b641b680c5703b3bf885cbd384ffec779",
strip_prefix = "rules_esbuild-0.22.1",
url = "https://github.com/aspect-build/rules_esbuild/releases/download/v0.22.1/rules_esbuild-v0.22.1.tar.gz",
)
load("@aspect_rules_esbuild//esbuild:dependencies.bzl", "rules_esbuild_dependencies")
rules_esbuild_dependencies()
load("@aspect_rules_esbuild//esbuild:repositories.bzl", "LATEST_ESBUILD_VERSION", "esbuild_register_toolchains")
esbuild_register_toolchains(
name = "esbuild",
esbuild_version = LATEST_ESBUILD_VERSION,
)
# Register git toolchains
register_toolchains(
"@devinfra//bazel/git-toolchain:git_linux_toolchain",
"@devinfra//bazel/git-toolchain:git_macos_x86_toolchain",
"@devinfra//bazel/git-toolchain:git_macos_arm64_toolchain",
"@devinfra//bazel/git-toolchain:git_windows_toolchain",
)
git_repository(
name = "rules_sass",
commit = "cc1e845339fc45d3c8390445014d5824b85a0948",
remote = "https://github.com/devversion/rules_sass.git",
)
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",
)
+5 -5
View File
@@ -1,5 +1,5 @@
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@npm//:defs.bzl", "npm_link_all_packages")
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")
@@ -87,8 +87,8 @@ TEST_DEPS = [
for dep in APPLICATION_DEPS
if dep != "//adev:node_modules/@types/node"
] + [
"@rules_browsers//browsers/chromium",
"@rules_browsers//browsers/firefox",
"@rules_browsers//src/browsers/chromium",
"@rules_browsers//src/browsers/firefox",
"//adev/tools:windows-chromium-path",
]
@@ -155,7 +155,7 @@ ng_test(
node_modules = "//adev:node_modules",
project_name = "angular-dev",
toolchains = [
"@rules_browsers//browsers/chromium:toolchain_alias",
"@rules_browsers//browsers/firefox:toolchain_alias",
"@rules_browsers//src/browsers/chromium:toolchain_alias",
"@rules_browsers//src/browsers/firefox:toolchain_alias",
],
)
+5 -5
View File
@@ -6,7 +6,7 @@ The content is written primarily in Markdown format located in `src/content`. Fo
## Local Development
For local development, [pnpm](https://pnpm.io/) is the preferred package manager. You can set up a local environment with the following commands
For local development, [yarn](https://yarnpkg.com/) is the preferred package manager. You can set up a local environment with the following commands
:
```bash
@@ -17,11 +17,11 @@ git clone https://github.com/angular/angular.git
cd angular
# Install dependencies
pnpm
yarn
# Build and run local dev server
# NOTE: Initial build will take some time
pnpm adev
yarn docs
```
If you are having issues with the docs building, see the [FAQs](#faqs) section.
@@ -46,8 +46,8 @@ This is most likely due to a bazel dependency / caching issue. To resolve this,
```
# Try this first
pnpm bazel clean
yarn bazel clean
# If that doesn't work, try it with the expunge flag
pnpm bazel clean --expunge
yarn bazel clean --expunge
```
+26 -23
View File
@@ -1,21 +1,22 @@
{
"dependencies": {
"@angular-devkit/build-angular": "21.0.0-next.0",
"@angular-devkit/build-angular": "20.1.1",
"@angular/animations": "workspace:*",
"@angular/build": "21.0.0-next.0",
"@angular/cdk": "21.0.0-next.0",
"@angular/cli": "21.0.0-next.0",
"@angular/build": "20.1.1",
"@angular/cdk": "20.1.2",
"@angular/cli": "20.1.1",
"@angular/common": "workspace:*",
"@angular/compiler-cli": "workspace:*",
"@angular/compiler": "workspace:*",
"@angular/core": "workspace:*",
"@angular/docs": "workspace:*",
"@angular/forms": "workspace:*",
"@angular/material": "21.0.0-next.0",
"@angular/material": "20.1.2",
"@angular/platform-browser": "workspace:*",
"@angular/platform-server": "workspace:*",
"@angular/router": "workspace:*",
"@angular/ssr": "21.0.0-next.0",
"@angular/ssr": "20.1.1",
"@bazel/runfiles": "6.3.1",
"@codemirror/autocomplete": "6.18.6",
"@codemirror/commands": "6.8.1",
"@codemirror/lang-angular": "0.1.4",
@@ -23,7 +24,7 @@
"@codemirror/lang-html": "6.4.9",
"@codemirror/lang-javascript": "6.2.4",
"@codemirror/lang-sass": "6.0.2",
"@codemirror/language": "6.11.3",
"@codemirror/language": "6.11.2",
"@codemirror/lint": "6.8.5",
"@codemirror/search": "6.5.11",
"@codemirror/state": "6.5.2",
@@ -32,16 +33,16 @@
"@lezer/highlight": "1.2.1",
"@lezer/javascript": "1.5.1",
"@stackblitz/sdk": "1.11.0",
"@types/dom-navigation": "1.0.6",
"@types/jasmine": "5.1.9",
"@types/dom-navigation": "1.0.5",
"@types/jasmine": "5.1.8",
"@types/jsdom": "21.1.7",
"@types/node": "24.3.0",
"@types/node": "24.1.0",
"@typescript/vfs": "1.6.1",
"@webcontainer/api": "1.6.1",
"@xterm/addon-fit": "0.10.0",
"@xterm/xterm": "5.5.0",
"algoliasearch": "5.35.0",
"angular-split": "20.0.0",
"algoliasearch": "5.34.1",
"angular-split": "19.0.0",
"diff": "8.0.2",
"emoji-regex": "10.4.0",
"fflate": "0.8.2",
@@ -52,24 +53,26 @@
"karma-coverage": "2.2.1",
"karma-jasmine-html-reporter": "2.1.0",
"karma-jasmine": "5.1.0",
"marked": "16.2.0",
"mermaid": "11.10.1",
"marked": "16.1.1",
"mermaid": "11.9.0",
"ngx-progressbar": "14.0.0",
"open-in-idx": "0.1.1",
"playwright-core": "1.55.0",
"preact-render-to-string": "6.6.1",
"preact": "10.27.1",
"playwright-core": "1.54.1",
"preact-render-to-string": "6.5.13",
"preact": "10.26.9",
"prettier": "3.6.2",
"rxjs": "7.8.2",
"shiki": "3.11.0",
"shiki": "3.8.1",
"tinyglobby": "0.2.14",
"tslib": "2.8.1",
"typescript": "5.9.2",
"typescript": "5.8.3",
"xhr2": "0.2.1",
"zone.js": "0.15.1",
"@algolia/client-common": "5.35.0",
"@algolia/requester-browser-xhr": "5.35.0",
"@algolia/requester-node-http": "5.35.0",
"@algolia/client-common": "5.34.1",
"@algolia/requester-browser-xhr": "5.34.1",
"@algolia/requester-node-http": "5.34.1",
"@lezer/css": "1.3.0",
"@lezer/html": "1.3.10",
"@lezer/lr": "1.4.2",
@@ -79,4 +82,4 @@
"style-mod": "4.1.2",
"w3c-keyname": "2.2.8"
}
}
}
+10 -9
View File
@@ -28,18 +28,19 @@ ng_project(
"index.ts",
],
deps = [
"//adev/shared-docs/components",
"//adev/shared-docs/directives",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/pipes",
"//adev/shared-docs/providers",
"//adev/shared-docs/services",
"//adev/shared-docs/testing",
"//adev/shared-docs/utils",
"//adev/shared-docs/components:components_rjs",
"//adev/shared-docs/directives:directives_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/pipes:pipes_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/services:services_rjs",
"//adev/shared-docs/testing:testing_rjs",
"//adev/shared-docs/utils:utils_rjs",
],
)
ng_package(
name = "pkg",
srcs = [
"package.json",
"//adev/shared-docs/icons",
@@ -62,6 +63,6 @@ ng_package(
"//adev/shared-docs:__pkg__",
],
deps = [
":docs",
":docs_rjs",
],
)
+13 -13
View File
@@ -11,18 +11,18 @@ ts_project(
"//adev/shared-docs:__pkg__",
],
deps = [
"//adev/shared-docs/components/algolia-icon",
"//adev/shared-docs/components/breadcrumb",
"//adev/shared-docs/components/cookie-popup",
"//adev/shared-docs/components/copy-source-code-button",
"//adev/shared-docs/components/icon",
"//adev/shared-docs/components/navigation-list",
"//adev/shared-docs/components/search-dialog",
"//adev/shared-docs/components/select",
"//adev/shared-docs/components/slide-toggle",
"//adev/shared-docs/components/table-of-contents",
"//adev/shared-docs/components/text-field",
"//adev/shared-docs/components/top-level-banner",
"//adev/shared-docs/components/viewers",
"//adev/shared-docs/components/algolia-icon:algolia-icon_rjs",
"//adev/shared-docs/components/breadcrumb:breadcrumb_rjs",
"//adev/shared-docs/components/cookie-popup:cookie-popup_rjs",
"//adev/shared-docs/components/copy-source-code-button:copy-source-code-button_rjs",
"//adev/shared-docs/components/icon:icon_rjs",
"//adev/shared-docs/components/navigation-list:navigation-list_rjs",
"//adev/shared-docs/components/search-dialog:search-dialog_rjs",
"//adev/shared-docs/components/select:select_rjs",
"//adev/shared-docs/components/slide-toggle:slide-toggle_rjs",
"//adev/shared-docs/components/table-of-contents:table-of-contents_rjs",
"//adev/shared-docs/components/text-field:text-field_rjs",
"//adev/shared-docs/components/top-level-banner:top-level-banner_rjs",
"//adev/shared-docs/components/viewers:viewers_rjs",
],
)
@@ -19,8 +19,8 @@ ng_project(
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/services",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
],
)
@@ -36,16 +36,16 @@ ts_project(
["*.spec.ts"],
),
deps = [
":breadcrumb",
":breadcrumb_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/services",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -17,8 +17,8 @@ ng_project(
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/providers",
"//adev/shared-docs/utils",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/utils:utils_rjs",
],
)
@@ -34,14 +34,14 @@ ts_project(
["*.spec.ts"],
),
deps = [
":cookie-popup",
":cookie-popup_rjs",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/providers",
"//adev/shared-docs/testing",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/testing:testing_rjs",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -16,7 +16,7 @@ ng_project(
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/components/icon",
"//adev/shared-docs/components/icon:icon_rjs",
],
)
@@ -27,7 +27,7 @@ ts_project(
["*.spec.ts"],
),
deps = [
":copy-source-code-button",
":copy-source-code-button_rjs",
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
@@ -36,5 +36,5 @@ ts_project(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -19,10 +19,10 @@ ng_project(
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/material",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/icon",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/pipes",
"//adev/shared-docs/services",
"//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",
],
)
@@ -41,16 +41,16 @@ ts_project(
["*.spec.ts"],
),
deps = [
":navigation-list",
":navigation-list_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/services",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -11,7 +11,7 @@ import {NavigationItem} from '../../interfaces/index';
import {NavigationState} from '../../services/index';
import {RouterLink, RouterLinkActive} from '@angular/router';
import {IconComponent} from '../icon/icon.component';
import {IsActiveNavigationItem} from '../../pipes';
import {IsActiveNavigationItem} from '../../pipes/is-active-navigation-item.pipe';
import {NgTemplateOutlet} from '@angular/common';
import {MatTooltipModule} from '@angular/material/tooltip';
@@ -21,14 +21,13 @@ ng_project(
"//adev:node_modules/@angular/forms",
"//adev:node_modules/@angular/router",
"//adev:node_modules/rxjs",
"//adev/shared-docs/components/algolia-icon",
"//adev/shared-docs/components/search-history",
"//adev/shared-docs/components/text-field",
"//adev/shared-docs/directives",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/pipes",
"//adev/shared-docs/providers",
"//adev/shared-docs/services",
"//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",
"//adev/shared-docs/directives:directives_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/pipes:pipes_rjs",
"//adev/shared-docs/services:services_rjs",
],
)
@@ -44,19 +43,19 @@ ts_project(
["*.spec.ts"],
),
deps = [
":search-dialog",
":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",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/providers",
"//adev/shared-docs/services",
"//adev/shared-docs/testing",
"//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",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -20,18 +20,19 @@ import {
viewChildren,
} from '@angular/core';
import {WINDOW} from '../../providers';
import {ClickOutside, SearchItem} from '../../directives';
import {Search, SearchHistory} from '../../services';
import {WINDOW} from '../../providers/index';
import {ClickOutside} from '../../directives/index';
import {Search, SearchHistory} from '../../services/index';
import {TextField} from '../text-field/text-field.component';
import {FormControl, ReactiveFormsModule} from '@angular/forms';
import {ActiveDescendantKeyManager} from '@angular/cdk/a11y';
import {SearchItem} from '../../directives/search-item/search-item.directive';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {Router, RouterLink} from '@angular/router';
import {fromEvent} from 'rxjs';
import {AlgoliaIcon} from '../algolia-icon/algolia-icon.component';
import {RelativeLink} from '../../pipes';
import {RelativeLink} from '../../pipes/relative-link.pipe';
import {SearchHistoryComponent} from '../search-history/search-history.component';
@Component({
@@ -24,9 +24,9 @@ ng_project(
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/directives",
"//adev/shared-docs/pipes",
"//adev/shared-docs/services",
"//adev/shared-docs/directives:directives_rjs",
"//adev/shared-docs/pipes:pipes_rjs",
"//adev/shared-docs/services:services_rjs",
],
)
@@ -35,17 +35,15 @@ ts_project(
testonly = True,
srcs = ["search-history.component.spec.ts"],
deps = [
":search-history",
":search-history_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/providers",
"//adev/shared-docs/services",
"//adev/shared-docs/testing",
"//adev/shared-docs/services:services_rjs",
"//adev/shared-docs/testing:testing_rjs",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -21,7 +21,7 @@ import {ActiveDescendantKeyManager} from '@angular/cdk/a11y';
import {SearchHistory} from '../../services';
import {RelativeLink} from '../../pipes';
import {SearchItem} from '../../directives';
import {SearchItem} from '../../directives/search-item/search-item.directive';
@Component({
selector: 'docs-search-history',
@@ -33,12 +33,12 @@ ts_project(
["*.spec.ts"],
),
deps = [
":select",
":select_rjs",
"//adev:node_modules/@angular/core",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -33,12 +33,12 @@ ts_project(
["*.spec.ts"],
),
deps = [
":slide-toggle",
":slide-toggle_rjs",
"//adev:node_modules/@angular/core",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -19,9 +19,9 @@ ng_project(
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/components/icon",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/services",
"//adev/shared-docs/components/icon:icon_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/services:services_rjs",
],
)
@@ -40,16 +40,16 @@ ts_project(
["*.spec.ts"],
),
deps = [
":table-of-contents",
":table-of-contents_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/providers",
"//adev/shared-docs/services",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/services:services_rjs",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -17,7 +17,7 @@ import {
} from '@angular/core';
import {Location, ViewportScroller} from '@angular/common';
import {TableOfContentsLevel} from '../../interfaces/index';
import {TableOfContentsLoader} from '../../services';
import {TableOfContentsLoader} from '../../services/table-of-contents-loader.service';
import {IconComponent} from '../icon/icon.component';
@Component({
@@ -19,7 +19,7 @@ ng_project(
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/forms",
"//adev/shared-docs/components/icon",
"//adev/shared-docs/components/icon:icon_rjs",
],
)
@@ -35,12 +35,12 @@ ts_project(
["*.spec.ts"],
),
deps = [
":text-field",
":text-field_rjs",
"//adev:node_modules/@angular/core",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -17,9 +17,9 @@ ng_project(
deps = [
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/components/icon",
"//adev/shared-docs/directives",
"//adev/shared-docs/providers",
"//adev/shared-docs/components/icon:icon_rjs",
"//adev/shared-docs/directives:directives_rjs",
"//adev/shared-docs/providers:providers_rjs",
],
)
@@ -35,13 +35,13 @@ ts_project(
["*.spec.ts"],
),
deps = [
":top-level-banner",
":top-level-banner_rjs",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/providers",
"//adev/shared-docs/providers:providers_rjs",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
+14 -18
View File
@@ -21,17 +21,13 @@ ng_project(
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/material",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev:node_modules/rxjs",
"//adev/shared-docs/components/breadcrumb",
"//adev/shared-docs/components/copy-source-code-button",
"//adev/shared-docs/components/icon",
"//adev/shared-docs/components/table-of-contents",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/providers",
"//adev/shared-docs/services",
"//adev/shared-docs/utils",
"//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",
],
)
@@ -55,23 +51,23 @@ ts_project(
["**/*.spec.ts"],
),
deps = [
":viewers",
":viewers_rjs",
"//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",
"//adev/shared-docs/components/copy-source-code-button",
"//adev/shared-docs/components/icon",
"//adev/shared-docs/components/table-of-contents",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/providers",
"//adev/shared-docs/services",
"//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",
"//adev/shared-docs/components/table-of-contents:table-of-contents_rjs",
"//adev/shared-docs/interfaces:interfaces_rjs",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/services:services_rjs",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -28,22 +28,21 @@ import {
effect,
} from '@angular/core';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {TOC_SKIP_CONTENT_MARKER, NavigationState} from '../../../services';
import {TOC_SKIP_CONTENT_MARKER, NavigationState} from '../../../services/index';
import {TableOfContents} from '../../table-of-contents/table-of-contents.component';
import {IconComponent} from '../../icon/icon.component';
import {handleHrefClickEventWithRouter} from '../../../utils';
import {Snippet} from '../../../interfaces';
import {handleHrefClickEventWithRouter} from '../../../utils/index';
import {Snippet} from '../../../interfaces/index';
import {Router} from '@angular/router';
import {fromEvent} from 'rxjs';
import {Breadcrumb} from '../../breadcrumb/breadcrumb.component';
import {CopySourceCodeButton} from '../../copy-source-code-button/copy-source-code-button.component';
import {ExampleViewer} from '../example-viewer/example-viewer.component';
import {DomSanitizer} from '@angular/platform-browser';
const TOC_HOST_ELEMENT_NAME = 'docs-table-of-contents';
export const ASSETS_EXAMPLES_PATH = 'assets/content/examples';
export const DOCS_VIEWER_SELECTOR = 'docs-viewer, main[docsViewer]';
export const DOCS_VIEWER_SELECTOR = 'docs-viewer';
export const DOCS_CODE_SELECTOR = '.docs-code';
export const DOCS_CODE_MUTLIFILE_SELECTOR = '.docs-code-multifile';
// TODO: Update the branch/sha
@@ -75,7 +74,6 @@ export class DocViewer {
private readonly environmentInjector = inject(EnvironmentInjector);
private readonly injector = inject(Injector);
private readonly appRef = inject(ApplicationRef);
private readonly sanitizer = inject(DomSanitizer);
protected animateContent = false;
private readonly pendingTasks = inject(PendingTasks);
@@ -202,10 +200,8 @@ export class DocViewer {
id: this.countOfExamples,
});
exampleRef.setInput('githubUrl', `${GITHUB_CONTENT_URL}/${snippets[0].name}`);
// TODO: Re-add support for opening examples on StackBlitz
exampleRef.setInput('stackblitzUrl', null); // `${ASSETS_EXAMPLES_PATH}/${snippets[0].name}.html`;
exampleRef.instance.githubUrl = `${GITHUB_CONTENT_URL}/${snippets[0].name}`;
exampleRef.instance.stackblitzUrl = `${ASSETS_EXAMPLES_PATH}/${snippets[0].name}.html`;
placeholder.parentElement!.replaceChild(exampleRef.location.nativeElement, placeholder);
@@ -217,7 +213,7 @@ export class DocViewer {
return tabs.map((tab) => ({
name: tab.getAttribute('path') ?? tab.getAttribute('header') ?? '',
sanitizedContent: this.sanitizer.bypassSecurityTrustHtml(tab.innerHTML),
content: tab.innerHTML,
visibleLinesRange: tab.getAttribute('visibleLines') ?? undefined,
}));
}
@@ -237,9 +233,7 @@ export class DocViewer {
return {
title,
name: path,
sanitizedContent: content?.outerHTML
? this.sanitizer.bypassSecurityTrustHtml(content.outerHTML)
: '',
content: content?.outerHTML,
visibleLinesRange: visibleLines,
};
}
@@ -5,7 +5,11 @@
}
@if (view() === CodeExampleViewMode.MULTI_FILE) {
<mat-tab-group #codeTabs animationDuration="0ms" mat-stretch-tabs="false">
<mat-tab-group
#codeTabs
animationDuration="0ms"
mat-stretch-tabs="false"
>
@for (tab of tabs(); track tab) {
<mat-tab [label]="tab.name"></mat-tab>
}
@@ -83,9 +87,7 @@
[class.docs-example-viewer-multi-file]="view() === CodeExampleViewMode.MULTI_FILE"
>
<button docs-copy-source-code></button>
@if (snippetCode()?.sanitizedContent; as content) {
<div [innerHTML]="content"></div>
}
<docs-viewer [docContent]="snippetCode()?.content" />
</div>
@if (exampleComponent) {
@@ -96,9 +98,9 @@
<ng-template #openCodeInExternalProvider>
@if (exampleComponent) {
@if (githubUrl()) {
@if (githubUrl) {
<a
[href]="githubUrl()"
[href]="githubUrl"
target="_blank"
title="Open example on GitHub"
class="docs-example-github-link"
@@ -123,9 +125,9 @@
</i>
</a>
}
@if (stackblitzUrl()) {
@if (stackblitzUrl) {
<a
[href]="stackblitzUrl()"
[href]="stackblitzUrl"
target="_blank"
class="docs-example-stackblitz-link"
title="Edit this example in StackBlitz"
@@ -1,12 +1,10 @@
:host {
.docs-example-viewer-preview {
.docs-dark-mode & {
color: var(--primary-contrast);
background: var(--gray-900);
background: var(--gray-100);
}
@media screen and (prefers-color-scheme: dark) {
color: var(--primary-contrast);
background: var(--gray-900);
background: var(--gray-100);
}
.docs-light-mode & {
background: var(--page-background);
@@ -53,9 +53,9 @@ describe('ExampleViewer', () => {
'metadata',
getMetadata({
files: [
{name: 'file.ts', sanitizedContent: ''},
{name: 'file.html', sanitizedContent: ''},
{name: 'file.css', sanitizedContent: ''},
{name: 'file.ts', content: ''},
{name: 'file.html', content: ''},
{name: 'file.css', content: ''},
],
}),
);
@@ -73,9 +73,9 @@ describe('ExampleViewer', () => {
'metadata',
getMetadata({
files: [
{name: 'file.ts', sanitizedContent: 'typescript file'},
{name: 'file.html', sanitizedContent: 'html file'},
{name: 'file.css', sanitizedContent: 'css file'},
{name: 'file.ts', content: 'typescript file'},
{name: 'file.html', content: 'html file'},
{name: 'file.css', content: 'css file'},
],
}),
);
@@ -93,9 +93,9 @@ describe('ExampleViewer', () => {
'metadata',
getMetadata({
files: [
{name: 'example.ts', sanitizedContent: 'typescript file'},
{name: 'example.html', sanitizedContent: 'html file'},
{name: 'another-example.ts', sanitizedContent: 'css file'},
{name: 'example.ts', content: 'typescript file'},
{name: 'example.html', content: 'html file'},
{name: 'another-example.ts', content: 'css file'},
],
}),
);
@@ -124,7 +124,7 @@ describe('ExampleViewer', () => {
files: [
{
name: 'example.ts',
sanitizedContent: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
content: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
visibleLinesRange: '[1]',
},
],
@@ -148,7 +148,7 @@ describe('ExampleViewer', () => {
files: [
{
name: 'example.ts',
sanitizedContent: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
content: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
visibleLinesRange: '[1]',
},
],
@@ -198,7 +198,7 @@ describe('ExampleViewer', () => {
By.css('a[aria-label="Open example on GitHub"]'),
);
expect(githubButton).toBeTruthy();
expect(githubButton.nativeElement.href).toBe(component.githubUrl());
expect(githubButton.nativeElement.href).toBe(component.githubUrl);
});
it('should display StackBlitz button when stackblitzUrl is provided and there is preview', async () => {
@@ -210,8 +210,7 @@ describe('ExampleViewer', () => {
preview: true,
}),
);
componentRef.setInput('stackblitzUrl', 'https://stackblitz.com/');
component.stackblitzUrl = 'https://stackblitz.com/';
await component.renderExample();
fixture.detectChanges();
@@ -219,7 +218,7 @@ describe('ExampleViewer', () => {
By.css('a[aria-label="Edit this example in StackBlitz"]'),
);
expect(stackblitzButton).toBeTruthy();
expect(stackblitzButton.nativeElement.href).toBe(component.stackblitzUrl());
expect(stackblitzButton.nativeElement.href).toBe(component.stackblitzUrl);
});
it('should set expanded flag in metadata after toggleExampleVisibility', async () => {
@@ -243,9 +242,9 @@ describe('ExampleViewer', () => {
files: [
{
name: 'example.ts',
sanitizedContent: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
content: `<pre><code>${expectedCodeSnippetContent}</code></pre>`,
},
{name: 'example.css', sanitizedContent: ''},
{name: 'example.css', content: ''},
],
}),
);
@@ -279,8 +278,8 @@ const getMetadata = (value: Partial<ExampleMetadata> = {}): ExampleMetadata => {
return {
id: 1,
files: [
{name: 'example.ts', sanitizedContent: ''},
{name: 'example.css', sanitizedContent: ''},
{name: 'example.ts', content: ''},
{name: 'example.css', content: ''},
],
preview: false,
...value,
@@ -14,9 +14,11 @@ import {
computed,
DestroyRef,
ElementRef,
forwardRef,
inject,
Injector,
input,
Input,
signal,
Type,
viewChild,
@@ -28,6 +30,7 @@ import {CopySourceCodeButton} from '../../copy-source-code-button/copy-source-co
import {ExampleMetadata, Snippet} from '../../../interfaces/index';
import {EXAMPLE_VIEWER_CONTENT_LOADER} from '../../../providers/index';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {DocViewer} from '../docs-viewer/docs-viewer.component';
export enum CodeExampleViewMode {
SNIPPET = 'snippet',
@@ -41,15 +44,16 @@ export const HIDDEN_CLASS_NAME = 'hidden';
@Component({
selector: 'docs-example-viewer',
imports: [CommonModule, CopySourceCodeButton, MatTabsModule],
imports: [CommonModule, forwardRef(() => DocViewer), CopySourceCodeButton, MatTabsModule],
templateUrl: './example-viewer.component.html',
styleUrls: ['./example-viewer.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ExampleViewer {
readonly exampleMetadata = input<ExampleMetadata | null>(null, {alias: 'metadata'});
readonly githubUrl = input<string | null>(null);
readonly stackblitzUrl = input<string | null>(null);
exampleMetadata = input<ExampleMetadata | null>(null, {alias: 'metadata'});
@Input() githubUrl: string | null = null;
@Input() stackblitzUrl: string | null = null;
readonly matTabGroup = viewChild<MatTabGroup>('codeTabs');
private readonly changeDetector = inject(ChangeDetectorRef);
@@ -78,7 +82,7 @@ export class ExampleViewer {
this.exampleMetadata()?.files.map((file) => ({
name:
file.title ?? (this.shouldDisplayFullName() ? file.name : this.getFileExtension(file.name)),
code: file.sanitizedContent,
code: file.content,
})),
);
view = computed(() =>
+6 -6
View File
@@ -1,13 +1,11 @@
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", _copy_to_directory = "copy_to_directory")
load("@aspect_rules_esbuild//esbuild:defs.bzl", _esbuild = "esbuild")
load("@aspect_rules_js//js:defs.bzl", _js_binary = "js_binary", _js_library = "js_library", _js_run_binary = "js_run_binary")
load("@devinfra//bazel/private:path_relative_to_label.bzl", _path_relative_to_label = "path_relative_to_label")
load(
"//tools:defaults.bzl",
"//tools:defaults2.bzl",
_jasmine_test = "jasmine_test",
_js_binary = "js_binary",
_js_library = "js_library",
_js_run_binary = "js_run_binary",
_ng_package = "ng_package",
_ng_project = "ng_project",
_sass_binary = "sass_binary",
@@ -32,25 +30,27 @@ js_run_binary = _js_run_binary
path_relative_to_label = _path_relative_to_label
zoneless_jasmine_test = _zoneless_jasmine_test
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
+3 -3
View File
@@ -11,8 +11,8 @@ ts_project(
"//adev/shared-docs:__subpackages__",
],
deps = [
"//adev/shared-docs/directives/click-outside",
"//adev/shared-docs/directives/external-link",
"//adev/shared-docs/directives/search-item",
"//adev/shared-docs/directives/click-outside:click-outside_rjs",
"//adev/shared-docs/directives/external-link:external-link_rjs",
"//adev/shared-docs/directives/search-item:search-item_rjs",
],
)
@@ -23,7 +23,7 @@ ts_project(
["*.spec.ts"],
),
deps = [
":click-outside",
":click-outside_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
@@ -32,5 +32,5 @@ ts_project(
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
@@ -14,8 +14,8 @@ ng_project(
"//adev:node_modules/@angular/common",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/providers",
"//adev/shared-docs/utils",
"//adev/shared-docs/providers:providers_rjs",
"//adev/shared-docs/utils:utils_rjs",
],
)
@@ -26,15 +26,15 @@ ts_project(
["*.spec.ts"],
),
deps = [
":external-link",
":external-link_rjs",
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev/shared-docs/providers",
"//adev/shared-docs/providers:providers_rjs",
],
)
zoneless_web_test_suite(
name = "test",
deps = [":test_lib"],
deps = [":test_lib_rjs"],
)
-1
View File
@@ -8,4 +8,3 @@
export * from './click-outside/click-outside.directive';
export * from './external-link/external-link.directive';
export * from './search-item/search-item.directive';
@@ -13,6 +13,6 @@ ng_project(
deps = [
"//adev:node_modules/@angular/cdk",
"//adev:node_modules/@angular/core",
"//adev/shared-docs/interfaces",
"//adev/shared-docs/interfaces:interfaces_rjs",
],
)
+1 -2
View File
@@ -9,7 +9,7 @@ ts_project(
],
visibility = ["//adev/shared-docs:__subpackages__"],
deps = [
":lib",
":lib_rjs",
],
)
@@ -26,7 +26,6 @@ ts_project(
),
deps = [
"//adev:node_modules/@angular/core",
"//adev:node_modules/@angular/platform-browser",
"//adev:node_modules/@angular/router",
"//adev:node_modules/@types/node",
"//adev:node_modules/@webcontainer/api",
+1 -2
View File
@@ -7,7 +7,6 @@
*/
import {Type} from '@angular/core';
import {SafeHtml} from '@angular/platform-browser';
/**
* Map of the examples, values are functions which returns the promise of the component type, which will be displayed as preview in the ExampleViewer component
@@ -22,7 +21,7 @@ export interface Snippet {
/** Name of the file. */
name: string;
/** Content of code snippet */
sanitizedContent: SafeHtml;
content: string;
/** Text in following format `start-end`. Start and end are numbers, based on them provided range of lines will be displayed in collapsed mode */
visibleLinesRange?: string;
}
+9 -9
View File
@@ -2,14 +2,14 @@
"name": "@angular/docs",
"version": "0.0.0-PLACEHOLDER",
"peerDependencies": {
"@angular/cdk": "^21.0.0-next",
"@angular/common": "^21.0.0-next",
"@angular/core": "^21.0.0-next",
"@angular/forms": "^21.0.0-next",
"@angular/material": "^21.0.0-next",
"@angular/platform-browser": "^21.0.0-next",
"@angular/router": "^21.0.0-next",
"@angular/ssr": "^21.0.0-next",
"@angular/cdk": "^20.1.0-next",
"@angular/common": "^20.1.0-next",
"@angular/core": "^20.1.0-next",
"@angular/forms": "^20.1.0-next",
"@angular/material": "^20.1.0-next",
"@angular/platform-browser": "^20.1.0-next",
"@angular/router": "^20.1.0-next",
"@angular/ssr": "^20.1.0-next",
"algoliasearch": "^5.0.0",
"rxjs": "^7.8.1"
},
@@ -20,7 +20,7 @@
"fflate": "^0.8.2",
"html-entities": "~2.6.0",
"jsdom": "~26.1.0",
"marked": "~16.2.0",
"marked": "~16.1.0",
"mermaid": "^11.0.0",
"shiki": "^3.0.0",
"tinyglobby": "^0.2.12"
+2 -2
View File
@@ -47,13 +47,13 @@ js_binary(
"//adev:node_modules/jsdom",
"//adev:node_modules/mermaid",
"//adev:node_modules/playwright-core",
"@rules_browsers//browsers/chromium",
"@rules_browsers//src/browsers/chromium",
],
entry_point = "//adev/shared-docs/pipeline/guides:guides.mjs",
env = {
"CHROME_HEADLESS_BIN": "$(CHROME-HEADLESS-SHELL)",
},
toolchains = ["@rules_browsers//browsers/chromium:toolchain_alias"],
toolchains = ["@rules_browsers//src/browsers/chromium:toolchain_alias"],
visibility = ["//visibility:public"],
)
+4 -17
View File
@@ -16,12 +16,6 @@ def _generate_guides(ctx):
# Pass the the output directory path (which is the bazel-bin directory).
args.add(ctx.bin_dir.path)
# Add the api_manifest file if provided
if ctx.attr.api_manifest:
args.add(ctx.file.api_manifest.path)
else:
args.add("")
# Determine the set of html output files. For each input markdown file, produce an html
# file with the same name (replacing the markdown extension with `.html`).
html_outputs = []
@@ -35,14 +29,11 @@ def _generate_guides(ctx):
# For each input file "xxx.md", we want to write an output file "xxx.html"
html_outputs += [ctx.actions.declare_file("%s.html" % relative_basepath)]
# Define an action that runs the executable.
inputs = ctx.files.srcs + ctx.files.data
if ctx.attr.api_manifest:
inputs.append(ctx.file.api_manifest)
# 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):
ctx.actions.run(
inputs = depset(inputs),
inputs = depset(ctx.files.srcs + ctx.files.data),
executable = ctx.executable._generate_guides,
outputs = html_outputs,
arguments = [args],
@@ -52,7 +43,7 @@ def _generate_guides(ctx):
)
else:
ctx.actions.run(
inputs = depset(inputs),
inputs = depset(ctx.files.srcs + ctx.files.data),
executable = ctx.executable._generate_guides_no_mermaid,
outputs = html_outputs,
arguments = [args],
@@ -81,10 +72,6 @@ generate_guides = rule(
doc = """Source referenced from within the markdown.""",
allow_files = True,
),
"api_manifest": attr.label(
doc = """A file containing API entries to be used in the markdown.""",
allow_single_file = True,
),
"mermaid_blocks": attr.bool(
doc = """Whether to transform mermaid blocks.""",
default = False,
@@ -1,4 +1,4 @@
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm2//:defs.bzl", "npm_link_all_packages")
package(default_visibility = ["//visibility:public"])
@@ -14,6 +14,7 @@ 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",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/node",
"//adev:node_modules/typescript",
],
@@ -23,7 +24,7 @@ ts_project(
js_binary(
name = "extract_api_to_json",
data = [
":extract_api_to_json_lib",
":extract_api_to_json_lib_rjs",
],
entry_point = ":index.mjs",
visibility = ["//visibility:public"],
@@ -31,6 +31,9 @@ def _extract_api_to_json(ctx):
args.add(json_output.path)
# Pass the import path map
# TODO: consider module_mappings_aspect to deal with path mappings instead of manually
# specifying them
# https://github.com/bazelbuild/rules_nodejs/blob/5.x/internal/linker/link_node_modules.bzl#L236
path_map = {}
for target, path in ctx.attr.import_map.items():
files = target.files.to_list()
@@ -42,7 +45,8 @@ def _extract_api_to_json(ctx):
# Pass the set of (optional) extra entries
args.add_joined(ctx.files.extra_entries, join_with = ",")
# Define an action that runs the executable.
# Define an action that runs the nodejs_binary executable. This is
# the main thing that this rule does.
ctx.actions.run(
inputs = depset(ctx.files.srcs + ctx.files.extra_entries),
executable = ctx.executable._extract_api_to_json,
@@ -111,7 +111,7 @@ function main() {
...getEntriesFromMembers(entry).map((member) => [member, moduleName]),
]),
],
} satisfies EntryCollection);
} as EntryCollection);
writeFileSync(outputFilenameExecRootRelativePath, output, {encoding: 'utf8'});
}
@@ -53,11 +53,11 @@ ts_project(
deps = [
"//adev:node_modules/@angular/compiler-cli",
"//adev:node_modules/@types/node",
"//adev/shared-docs/pipeline/api-gen/extraction:extract_api_to_json_lib",
"//adev/shared-docs/pipeline/api-gen/extraction:extract_api_to_json_lib_rjs",
],
)
zoneless_jasmine_test(
name = "unit_tests",
data = [":unit_test_lib"],
data = [":unit_test_lib_rjs"],
)
@@ -13,7 +13,7 @@ esbuild(
platform = "node",
target = "es2022",
deps = [
":generate_api_manifest_lib",
":generate_api_manifest_lib_rjs",
"//adev:node_modules/@angular/compiler-cli",
],
)
@@ -23,6 +23,7 @@ ts_project(
srcs = glob(["**/*.mts"]),
deps = [
"//adev:node_modules/@angular/compiler-cli",
"//adev:node_modules/@bazel/runfiles",
"//adev:node_modules/@types/node",
],
)
@@ -15,7 +15,8 @@ def _generate_api_manifest(ctx):
manifest = ctx.actions.declare_file("manifest.json")
args.add(manifest.path)
# Define an action that runs the executable.
# Define an action that runs the nodejs_binary executable. This is
# the main thing that this rule does.
ctx.actions.run(
inputs = depset(ctx.files.srcs),
executable = ctx.executable._generate_api_manifest,
@@ -28,14 +28,14 @@ ts_project(
],
deps = [
"//adev:node_modules/@angular/compiler-cli",
"//adev/shared-docs/pipeline/api-gen/manifest:generate_api_manifest_lib",
"//adev/shared-docs/pipeline/api-gen/manifest:generate_api_manifest_lib_rjs",
],
)
zoneless_jasmine_test(
name = "unit_tests",
data = [
":unit_test_lib",
"//packages/compiler-cli",
":unit_test_lib_rjs",
"//packages/compiler-cli:compiler-cli_rjs",
],
)
@@ -14,21 +14,18 @@ describe('api manifest generation', () => {
it('should generate a manifest from multiple collections', () => {
const manifest: Manifest = generateManifest([
{
repo: 'angular/router',
moduleName: '@angular/router',
entries: [entry({name: 'Router', entryType: EntryType.UndecoratedClass})],
normalizedModuleName: 'angular_router',
moduleLabel: 'router',
},
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_core',
moduleLabel: 'core',
},
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [entry({name: 'foo', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_core',
@@ -82,14 +79,12 @@ describe('api manifest generation', () => {
it('should generate a manifest when collections share a symbol with the same name', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_core',
moduleLabel: 'core',
},
{
repo: 'angular/router',
moduleName: '@angular/router',
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_router',
@@ -134,14 +129,12 @@ describe('api manifest generation', () => {
it('should union collections for the same module into one manifest', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [entry({name: 'PI', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_core',
moduleLabel: 'core',
},
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [entry({name: 'TAO', entryType: EntryType.Constant})],
normalizedModuleName: 'angular_core',
@@ -179,7 +172,6 @@ describe('api manifest generation', () => {
it('should mark a manifest entry as deprecated', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [
entry({name: 'PI', entryType: EntryType.Constant, jsdocTags: jsdocTags('deprecated')}),
@@ -220,7 +212,6 @@ describe('api manifest generation', () => {
it('should not mark a function as deprecated if only one overload is deprecated', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [
functionEntry({
@@ -280,7 +271,6 @@ describe('api manifest generation', () => {
it('should mark a function as deprecated if all overloads are deprecated', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [
functionEntry({
@@ -340,7 +330,6 @@ describe('api manifest generation', () => {
it("should mark a fn as deprecated if there's one w/ the same name in another collection", () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [
entry({name: 'save', entryType: EntryType.Function, jsdocTags: jsdocTags('deprecated')}),
@@ -349,7 +338,6 @@ describe('api manifest generation', () => {
moduleLabel: 'core',
},
{
repo: 'angular/more',
moduleName: '@angular/more',
entries: [entry({name: 'save', entryType: EntryType.Function})],
normalizedModuleName: 'angular_more',
@@ -394,7 +382,6 @@ describe('api manifest generation', () => {
it('should mark a manifest entry as developerPreview', () => {
const manifest = generateManifest([
{
repo: 'angular/core',
moduleName: '@angular/core',
entries: [
entry({
@@ -10,7 +10,7 @@ esbuild(
platform = "node",
target = "es2022",
deps = [
":render_api_to_html_lib",
":render_api_to_html_lib_rjs",
],
)
@@ -20,22 +20,23 @@ ts_project(
[
"**/*.mts",
"**/*.tsx",
"shiki.d.ts",
],
exclude = [
"entities.mts",
],
),
enable_runtime_rnjs_interop = True,
deps = [
":entities",
":entities_rjs",
"//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",
"//adev/shared-docs/pipeline/shared:linking",
"//adev/shared-docs/pipeline/shared:shiki",
"//adev/shared-docs/pipeline/shared/marked",
"//adev/shared-docs/pipeline/shared/regions",
],
)
@@ -11,12 +11,12 @@ import path from 'path';
import {CliCommand} from './cli-entities.mjs';
import {DocEntry} from './entities.mjs';
import {isCliEntry, isHiddenEntry} from './entities/categorization.mjs';
import {configureMarkedGlobally} from './marked/configuration.mjs';
import {getRenderable} from './processing.mjs';
import {renderEntry} from './rendering.mjs';
import {initHighlighter} from './shiki/shiki.mjs';
import {setCurrentSymbol, setSymbols} from './symbol-context.mjs';
import {CliCommandRenderable, DocEntryRenderable} from './entities/renderables.mjs';
import {initHighlighter} from '../../shared/shiki.mjs';
import {setHighlighterInstance} from './shiki/shiki.mjs';
/** The JSON data file format for extracted API reference info. */
interface EntryCollection {
@@ -25,7 +25,7 @@ interface EntryCollection {
moduleLabel?: string;
normalizedModuleName: string;
entries: DocEntry[] | CliCommand[];
symbols: Record<string, string>;
symbols: Map<string, string>;
}
/** Parse all JSON data source files into an array of collections. */
@@ -34,15 +34,10 @@ function parseEntryData(srcs: string[]): EntryCollection[] {
const fileContent = readFileSync(jsonDataFilePath, {encoding: 'utf8'});
const fileContentJson = JSON.parse(fileContent) as unknown;
if ((fileContentJson as EntryCollection).entries) {
const symbols = Object.fromEntries(
// TODO: refactor that, it's dirty and we can probably do better than this.
// We're removing the leading `@angular/` from module names.
(((fileContentJson as any).symbols ?? []) as [string, string][]).map(
([symbol, moduleName]) => [symbol, moduleName.slice(9)],
),
);
return {...(fileContentJson as EntryCollection), symbols};
return {
...(fileContentJson as EntryCollection),
symbols: new Map((fileContentJson as any).symbols ?? []),
};
}
// CLI subcommands should generate a separate file for each subcommand.
@@ -55,7 +50,7 @@ function parseEntryData(srcs: string[]): EntryCollection[] {
moduleName: 'unknown',
normalizedModuleName: 'unknown',
entries: [fileContentJson as DocEntry],
symbols: {},
symbols: new Map(),
},
...command.subcommands!.map((subCommand) => {
return {
@@ -63,7 +58,7 @@ function parseEntryData(srcs: string[]): EntryCollection[] {
moduleName: 'unknown',
normalizedModuleName: 'unknown',
entries: [{...subCommand, parentCommand: command} as any],
symbols: {},
symbols: new Map(),
};
}),
];
@@ -74,7 +69,7 @@ function parseEntryData(srcs: string[]): EntryCollection[] {
moduleName: 'unknown',
normalizedModuleName: 'unknown',
entries: [fileContentJson as DocEntry], // TODO: fix the typing cli entries aren't DocEntry
symbols: {},
symbols: new Map(),
};
});
}
@@ -95,8 +90,10 @@ function getNormalizedFilename(normalizedModuleName: string, entry: DocEntry | C
}
async function main() {
configureMarkedGlobally();
// Shiki highlighter needs to be setup in an async context
setHighlighterInstance(await initHighlighter());
await initHighlighter();
const [paramFilePath] = process.argv.slice(2);
const rawParamLines = readFileSync(paramFilePath, {encoding: 'utf8'}).split('\n');
@@ -0,0 +1,17 @@
/**
* @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 {marked} from 'marked';
import {renderer} from './renderer.mjs';
/** Globally configures marked for rendering JsDoc content to HTML. */
export function configureMarkedGlobally() {
marked.use({
renderer,
});
}
@@ -0,0 +1,92 @@
/*!
* @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 {Renderer, Tokens} from 'marked';
import {codeToHtml} from '../shiki/shiki.mjs';
import {SECTION_HEADING, SECTION_SUB_HEADING} from '../styling/css-classes.mjs';
/**
* Custom renderer for marked that will be used to transform markdown files to HTML
* files that can be used in the Angular docs.
*/
export const renderer: Partial<Renderer> = {
code({lang, text}): string {
const highlightResult = codeToHtml(text, lang)
// remove spaces/line-breaks between elements to not mess-up `pre` style
.replace(/>\s+</g, '><');
return `
<div class="docs-code" role="group">
${highlightResult}
</div>
`;
},
image({href, title, text}): string {
return `
<img src="${href}" alt="${text}" title="${title}" class="docs-image">
`;
},
link(this: Renderer, {href, tokens}): string {
return `<a href="${href}">${this.parser.parseInline(tokens)}</a>`;
},
list(this: Renderer, {items, ordered, start}) {
if (ordered) {
return `
<ol class="docs-ordered-list">
${items.map((item) => this.listitem(item)).join('')}
</ol>
`;
}
return `
<ul class="docs-list">
${items.map((item) => this.listitem(item)).join('')}
</ul>
`;
},
table(this: Renderer, {header, rows}: Tokens.Table) {
return `
<div class="docs-table docs-scroll-track-transparent">
<table>
<thead>
${this.tablerow({text: header.map((cell) => this.tablecell(cell)).join('')})}
</thead>
<tbody>
${rows
.map((row) => this.tablerow({text: row.map((cell) => this.tablecell(cell)).join('')}))
.join('')}
</tbody>
</table>
</div>
`;
},
heading(this: Renderer, {text, depth, tokens}: Tokens.Heading) {
const id = text
.toLowerCase()
.replaceAll(' ', '-')
.replace(/[^a-z0-9-]/g, '');
// Since we have a code transformer `addApiLinksToHtml` which adds anchors
// to code blocks of known symbols, we add an additional `data-skip-anchor`
// attribute that prevents the transformation. This is needed since nested
// anchor tags are illegal and break the HTML.
const textRenderer = new Renderer();
textRenderer.codespan = ({text}) => `<code data-skip-anchor>${text}</code>`;
const parsedText = this.parser.parseInline(tokens, textRenderer);
// The template matches templates/section-heading.tsx
return `
<h${depth} id="${id}" class="${SECTION_HEADING} ${SECTION_SUB_HEADING}">
<a href="#${id}" aria-label="Link to ${text} section" tabIndex="-1">
${parsedText}
</a>
</h${depth}>
`;
},
};
@@ -0,0 +1,196 @@
/*!
* @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 * as blockC from './region-matchers/block-c.mjs';
import * as html from './region-matchers/html.mjs';
import * as inlineC from './region-matchers/inline-c.mjs';
import * as inlineCOnly from './region-matchers/inline-c-only.mjs';
import * as inlineHash from './region-matchers/inline-hash.mjs';
import {FileType, removeEslintComments} from './remove-eslint-comments.mjs';
const WHOLE_FILE_REGION_NAME = '';
const DEFAULT_PLASTER = '. . .';
const REGION_MATCHERS = {
ts: inlineC,
js: inlineC,
mjs: inlineCOnly,
es6: inlineC,
html: html,
svg: html,
css: blockC,
conf: inlineHash,
yaml: inlineHash,
yml: inlineHash,
sh: inlineHash,
jade: inlineCOnly,
pug: inlineCOnly,
json: inlineCOnly,
'json.annotated': inlineCOnly,
};
interface Region {
lines: string[];
open?: boolean;
ranges: {from: number; to?: number}[];
}
/**
* NOTE: We assume that the tag defining the beginning and end of the region will be in different lines in each case.
* For example, in HTML, we don't expect to have the following code on one line: <!-- docregion name -->content<!--enddocregion name-->
*/
export const regionParser = (contents: string, filePath: string) => {
const fileType: FileType | undefined = filePath?.split('.').pop() as FileType;
if (!fileType) {
throw new Error(`Incorrect file type for region parser: ${filePath}!`);
}
const regionMatcher = REGION_MATCHERS[fileType];
const openRegions: string[] = [];
const regionMap: Record<string, Region> = {};
let countOfRegionLines = 0;
if (regionMatcher) {
let plaster = regionMatcher.createPlasterComment(DEFAULT_PLASTER);
const lines = removeEslintComments(contents, fileType)
.split(/\r?\n/)
.filter((line, index) => {
const startRegion = line.match(regionMatcher.regionStartMatcher);
const endRegion = line.match(regionMatcher.regionEndMatcher);
const updatePlaster = line.match(regionMatcher.plasterMatcher);
// start region processing
if (startRegion) {
// open up the specified region
handleStartRegion(
startRegion,
regionMap,
index,
countOfRegionLines,
plaster,
openRegions,
);
} else if (endRegion) {
// end region processing
handleEndRegion(openRegions, endRegion, regionMap, index, countOfRegionLines);
} else if (updatePlaster) {
// doc plaster processing
const plasterString = updatePlaster[1].trim();
plaster = plasterString ? regionMatcher.createPlasterComment(plasterString) : '';
} else {
// simple line of content processing
openRegions.forEach((regionName) => regionMap[regionName].lines.push(line));
// do not filter out this line from the content
return true;
}
// this line contained an annotation so let's filter it out
countOfRegionLines++;
return false;
});
if (!regionMap[WHOLE_FILE_REGION_NAME]) {
regionMap[WHOLE_FILE_REGION_NAME] = {lines, ranges: [{from: 1, to: lines.length + 1}]};
}
return {
contents: lines.join('\n'),
regionMap,
totalLinesCount: lines.length,
};
} else {
return {contents, regionMap, totalLinesCount: 0};
}
};
function handleStartRegion(
startRegion: RegExpMatchArray,
regionMap: Record<string, Region>,
index: number,
countOfRegionLines: number,
plaster: string,
openRegions: string[],
) {
const regionNames = getRegionNames(startRegion[1]);
if (regionNames.length === 0) {
regionNames.push(WHOLE_FILE_REGION_NAME);
}
for (const regionName of regionNames) {
const region = regionMap[regionName];
if (region) {
if (region.open) {
throw new Error(`Tried to open a region, named "${regionName}", that is already open`);
}
// Region is opened, set from range value.
region.open = true;
region.ranges.push({from: getFromRangeValue(index, countOfRegionLines)});
if (plaster) {
// Use the same indent as the docregion marker
const indent = startRegion[0].split(/[^ ]/, 1);
region.lines.push(indent + plaster);
}
} else {
regionMap[regionName] = {
lines: [],
open: true,
ranges: [
{
from: getFromRangeValue(index, countOfRegionLines),
},
],
};
}
openRegions.push(regionName);
}
}
function handleEndRegion(
openRegions: string[],
endRegion: RegExpMatchArray,
regionMap: Record<string, Region>,
index: number,
countOfRegionLines: number,
) {
if (openRegions.length === 0) {
throw new Error('Tried to close a region when none are open');
}
// close down the specified region (or most recent if no name is given)
const regionNames = getRegionNames(endRegion[1]);
if (regionNames.length === 0) {
regionNames.push(openRegions[openRegions.length - 1]);
}
for (const regionName of regionNames) {
const region = regionMap[regionName];
if (!region || !region.open) {
throw new Error(`Tried to close a region, named "${regionName}", that is not open`);
}
// Region is closed, we can define the last line number of the region
region.open = false;
region.ranges[region.ranges.length - 1].to = index - countOfRegionLines;
removeLast(openRegions, regionName);
}
}
function getFromRangeValue(index: number, countOfRegionLines: number): number {
return index - countOfRegionLines + 1;
}
function getRegionNames(input: string): string[] {
return input.trim() === '' ? [] : input.split(',').map((name) => name.trim());
}
function removeLast(array: string[], item: string): void {
const index = array.lastIndexOf(item);
array.splice(index, 1);
}
@@ -18,7 +18,8 @@ def _render_api_to_html(ctx):
args.add(html_output_directory.path)
outputs = [html_output_directory]
# Define an action that runs the executable.
# Define an action that runs the nodejs_binary executable. This is
# the main thing that this rule does.
ctx.actions.run(
inputs = depset(ctx.files.srcs),
executable = ctx.executable._render_api_to_html,
+12
View File
@@ -0,0 +1,12 @@
// This definition file is a temporary workaround until the toolchain is able to read d.mts definition files
// TODO: delete this file when the toolchains supports .d.mts files
declare module 'shiki' {
function createHighlighter(params: {
themes: any[];
langs: string[];
cssVariablePrefix?: string;
defaultColor?: boolean;
}): unknown;
type HighlighterGeneric<BundledLangKeys, BundledThemeKeys> = any;
}
@@ -6,24 +6,41 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {HighlighterGeneric} from 'shiki';
let highlighter: any;
/**
* Singleton instance of the Shiki highlighter used during API page generation.
*
* TODO: Consider removing this singleton pattern if we find a better alternative.
*/
let highlighter: HighlighterGeneric<any, any>;
export function setHighlighterInstance(instance: HighlighterGeneric<any, any>) {
highlighter = instance;
export async function initHighlighter() {
const {createHighlighter} = await import('shiki');
highlighter = await createHighlighter({
themes: ['github-light', 'github-dark'],
langs: [
'javascript',
'typescript',
'angular-html',
'angular-ts',
'shell',
'html',
'http',
'json',
'jsonc',
'nginx',
'markdown',
'apache',
],
});
}
export function getHighlighterInstance(): HighlighterGeneric<any, any> {
if (!highlighter) {
throw new Error(
'Shiki highlighter has not been initialized. Make sure to call `setHighlighterInstance`.',
);
}
return highlighter;
export function codeToHtml(code: string, language: string | undefined): string {
const html = highlighter.codeToHtml(code, {
lang: language ?? 'text',
themes: {
light: 'github-light',
dark: 'github-dark',
},
cssVariablePrefix: '--shiki-',
defaultColor: false,
});
return html;
}
/**
@@ -6,17 +6,30 @@
* found in the LICENSE file at https://angular.dev/license
*/
import {getSymbolUrl as sharedGetSymbolUrl} from '../../shared/linking.mjs';
/**
* API pages are generated each package at a time.
* This allows us to use a global context to store the symbols and their corresponding module names.
* This allows to use a global context to store the symbols and their corresponding module names.
*/
let symbols: Record<string, string> = {};
let symbols = new Map<string, string>();
// This is used to store the currently processed symbol (usually a class or an interface)
let currentSymbol: string | undefined;
export function setSymbols(newSymbols: Map<string, string>): void {
symbols = newSymbols;
}
/**
* Returns the module name of a symbol.
* eg: 'ApplicationRef' => 'core', 'FormControl' => 'forms'
* Also supports class.member, 'NgZone.runOutsideAngular => 'core'
*/
export function getModuleName(symbol: string): string | undefined {
const moduleName = symbols.get(symbol);
return moduleName?.replace('@angular/', '');
}
export function setCurrentSymbol(symbol: string): void {
currentSymbol = symbol;
}
@@ -25,14 +38,6 @@ export function getCurrentSymbol(): string | undefined {
return currentSymbol;
}
export function setSymbols(newSymbols: Record<string, string>): void {
symbols = newSymbols;
}
export function getSymbolUrl(symbol: string): string | undefined {
return sharedGetSymbolUrl(symbol, symbols);
}
export function unknownSymbolMessage(link: string, symbol: string): string {
return `WARNING: {@link ${link}} is invalid, ${symbol} or ${currentSymbol}.${symbol} is unknown in this context`;
}
@@ -20,10 +20,9 @@ import {SectionDescription} from './section-description';
import {SectionUsageNotes} from './section-usage-notes';
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';
import {codeToHtml} from '../../../shared/shiki.mjs';
import {getHighlighterInstance} from '../shiki/shiki.mjs';
/** Component to render a class API reference document. */
export function ClassReference(entry: ClassEntryRenderable | PipeEntryRenderable) {
@@ -34,13 +33,7 @@ export function ClassReference(entry: ClassEntryRenderable | PipeEntryRenderable
<>
<div className={SECTION_CONTAINER + ' docs-reference-api-section'}>
<SectionHeading name="Pipe usage" />
<RawHtml
value={codeToHtml(
getHighlighterInstance(),
(entry as PipeEntry).usage,
'angular-html',
)}
/>
<RawHtml value={codeToHtml((entry as PipeEntry).usage, 'angular-html')} />
</div>
</>
) : (
@@ -24,28 +24,31 @@ export function CliCard(props: {card: CliCardRenderable}) {
{item.aliases?.map((alias) => (
<div class="docs-reference-option-aliases">
<span>Alias</span>
<code>{alias}</code>
<code>{alias} </code>
</div>
))}
</div>
<div dangerouslySetInnerHTML={{__html: item.description}}></div>
</div>
<div class="docs-reference-type-and-default">
{/* Display the type expected for the option and the enum values if there are some. */}
<span>Value Type</span>
<code>{item.type}</code>
{/* Display the enum values if there are some, else the type expected for the option */}
{item.enum ? (
<>
<span>Allowed Values</span>
{item.enum.map((val, i, items) => (
<>
<code>{val}</code>
{i < items.length - 1 && ', '}
</>
))}
<span>
{item.enum.map((val, i, items) => (
<>
<code>{val}</code>
{i < items.length - 1 && ', '}
</>
))}
</span>
</>
) : (
<></>
<>
<span>Value Type</span>
<code>{item.type}</code>
</>
)}
{/* Default Value */}
{item.default !== undefined ? <span>Default</span> : <></>}
@@ -7,7 +7,8 @@
*/
import {h} from 'preact';
import {getSymbolUrl} from '../symbol-context.mjs';
import {getModuleName} from '../symbol-context.mjs';
import {getLinkToModule} from '../transforms/url-transforms.mjs';
const symbolRegex = /([a-zA-Z_$][a-zA-Z_$0-9\.]*)/;
@@ -22,8 +23,11 @@ export function CodeSymbol(props: {code: string}) {
// Every even index is a non-match when the regex has 1 capturing group
if (index % 2 === 0) return rawSymbol;
const url = getSymbolUrl(rawSymbol);
if (url) {
let [symbol, subSymbol] = rawSymbol.split('.'); // Also takes care of methods, enum value etc.
const moduleName = getModuleName(symbol);
if (moduleName) {
const url = getLinkToModule(moduleName, symbol, subSymbol);
return <a href={url}>{rawSymbol}</a>;
}
@@ -8,13 +8,11 @@
import {h} from 'preact';
import {RawHtml} from './raw-html';
import {codeToHtml} from '../../../shared/shiki.mjs';
import {get} from 'http';
import {getHighlighterInstance} from '../shiki/shiki.mjs';
import {codeToHtml} from '../shiki/shiki.mjs';
/** Component to render a header of the CLI page. */
export function HighlightTypeScript(props: {code: string}) {
const result = codeToHtml(getHighlighterInstance(), props.code, 'typescript');
const result = codeToHtml(props.code, 'typescript');
const withScrollTrack = result.replace(/^(<pre class="shiki)/, '$1 docs-mini-scroll-track');
return <RawHtml value={withScrollTrack} className="docs-code" />;
@@ -18,17 +18,17 @@ ts_project(
],
),
deps = [
"//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",
"//adev/shared-docs/pipeline/shared:shiki",
"//adev/shared-docs/pipeline/api-gen/rendering:render_api_to_html_lib_rjs",
],
)
zoneless_jasmine_test(
name = "unit_tests",
data = [
":unit_test_lib",
":unit_test_lib_rjs",
"//adev:node_modules/jsdom",
] + glob([
"**/*.json",

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