Commit graph

235 commits

Author SHA1 Message Date
arturovt
d3f67f6ca8 refactor(core): mark VERSION as @__PURE__ for better tree-shaking
Annotate the `new Version(...)` call with `/* @__PURE__ */` to signal to optimizers that the constructor is side-effect free.

Without this hint, bundlers such as Terser or ESBuild may conservatively retain the `VERSION` instantiation even when unused. With the annotation, the constant can be tree-shaken away in production builds if not referenced, reducing bundle size.
2025-11-10 12:04:04 -08:00
Alan Agius
26fed34e0e
build: format md files
This commit configures prettier to format markdown files.
2025-11-06 10:03:05 -08:00
Andrew Scott
c3576506b3 refactor(core): Update tests for zoneless by default (#63668)
This updates tests and examples only to prepare for zoneless by default.

These changes were identified and made as part of #63382. Anything that
failed gets `provideZoneChangeDetection` unless the fixes were easily
and quickly determined.

It also adds the zoneless provider to the `initTestEnvironment` calls
for tests in this repo to prevent regressions before #63382 is merged.

PR Close #63668
2025-09-09 14:41:56 -07:00
Joey Perrott
2fcafb65c5 build: rename defaults2.bzl to defaults.bzl (#63383)
Use defaults.bzl for the common macros

PR Close #63383
2025-08-25 15:45:01 -07:00
Joey Perrott
fa8d8b8396 build: migrate all npm packages to use new rules_js based npm_package rule (#62954)
Use a common rule for all npm_packages

PR Close #62954
2025-08-05 19:08:45 +00:00
Joey Perrott
cbc258eec8 build: remove ts_project_interop infrastructure (#62908)
Remove the interop macros and final usages

PR Close #62908
2025-07-31 09:12:58 +00:00
Joey Perrott
793ff35602 build: move http_server and generate_api_docs into defaults2.bzl (#62878)
Move http_server and generate_api_docs into defaults2.bzl as they are rules_js compliant

PR Close #62878
2025-07-29 16:53:54 +00:00
Joey Perrott
8bf97d1370 build: remove all usages of the interop_deps attr for ts_project and ng_project (#62732)
Remove all of the usages of interop_deps as attributes in the repo

PR Close #62732
2025-07-21 13:03:09 -04:00
Joey Perrott
23d58777b4 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:42 -04:00
Joey Perrott
b84859073b build: migrate to use web test runner rules (#62292)
Migrate karma tests throughout the repo to use the new web test runner based rule instead

PR Close #62292
2025-06-26 17:19:10 +00:00
Joey Perrott
3a0cfd544d build: migrate to using new jasmine_test (#62086)
Use the new jasmine_test based on rules_js instead of jasmine_node_test from rules_nodejs

PR Close #62086
2025-06-18 08:27:26 +02:00
Paul Gschwendtner
d081ef9b06 build: replace all ng_package with new rule from rules_angular (#61843)
Replaces all `ng_package` rule with the new rule from `rules_angular`.

PR Close #61843
2025-06-04 09:13:41 +00:00
Paul Gschwendtner
9d7768ccd6 build: rework benchmarks and examples in modules/ to new optimization rule (#61566)
We are dropping the custom ESBuild and Terser pipeline from dev-infra
and instead leverage the Angular CLI directly. This commit adjusts
the benchmarks to use this new rule.

PR Close #61566
2025-05-29 14:39:11 -04:00
Joey Perrott
4c72ce408e build: migrate platform-browser and platform-browser-dynamic package to use rules_js (#61623)
Use ts_project and ng_project to build platform-browser and platform-browser-dynamic package

PR Close #61623
2025-05-23 15:14:00 -07:00
Matthieu Riegler
dba912dd07 refactor(platform-browser): replace platform-browser-dynamic with platform-browser (#61498)
The former isn't needed anymore and is now deprecated.

PR Close #61498
2025-05-21 14:01:49 +00:00
Alan Agius
8f65223bd8 fix(core): update min Node.js support to 20.19, 22.12, and 24.0 (#61499)
This is to match the versions of the Angular CLI.

See: https://github.com/angular/angular-cli/pull/30349

PR Close #61499
2025-05-20 14:15:13 +00:00
Paul Gschwendtner
3a106a35bc build: move private testing helpers outside platform-browser/testing (#61472)
These helpers are often imported by various tests throughout the
repository, but the helpers aren't exported/exposed from the public
entry-point; even though they confusingly reside in there.

This commit fixes this, and moves the helpers into
`packages/private/testing`. This is a preparation for the `ts_project`
migration where we don't want to leverage deep imports between packages.

PR Close #61472
2025-05-20 10:00:43 +00:00
Matthieu Riegler
a4e2139620 refactor(platform-browser): Deprecate the platform-browser-dynamic package (#61043)
All entries of the `@angular/platform-browser-dynamic` package are now deprecated.
We now recommend using the `@angular/platform-browser` package instead.
In case a JIT application/testing environment is complaining about missing the compiler also add `import '@angular/compiler'`

DEPRECATED: All entries of the `@angular/platform-browser-dynamic`

PR Close #61043
2025-05-15 09:48:15 -07:00
Paul Gschwendtner
810b0a7e5c refactor: add explicit types for exports relying on inferred call return type (#61312)
As part of the Bazel toolchain migration we noticed that implicit types
generated by the TypeScript compiler sometimes end up referencing types
from other packages (i.e. cross-package imports).

These imports currently work just because the Bazel `ts_library` and
`ng_module` rules automatically inserted a `<amd-module
name="@angular/x" />` into `.d.ts` of packages. This helped TS figure
out how to import a given file. Notably this is custom logic that is not
occuring in vanilla TS or Angular compilations—so we will drop this
magic as part of the toolchain cleanup!

To improve code quality and keep the existing behavior working, we are
doing the following:

- adding a lint rule that reduces the risk of such imports breaking. The
  failure scenario without the rule is that API goldens show unexpected
  diffs, and types might be duplicated in a different package!

- keeping the `<amd-module` headers, but we manually insert them into
  the package entry-points. This should ensure we don't regress
  anywhere; while we also improved general safety around this above.

Long-term, isolated declarations or a lint rule from eslint-typescript
can make this even more robust.

PR Close #61312
2025-05-13 22:45:18 +00:00
Paul Gschwendtner
032b802f54 build: remove irrelevant madge circular deps tests (#61156)
We don't need this tooling anymore because we are already validating
that there are no circular dependencies via the `ng-dev` tooling that
checks `.ts` files directly.

Also these tests never actually failed to my knowledge.

PR Close #61156
2025-05-07 11:28:59 -07:00
Alan Agius
d5c6f2c4de refactor: add Node.js 24 as supported version (#61142)
Node.js 24 has been released https://nodejs.org/en/about/previous-releases

Closes: #61140

PR Close #61142
2025-05-06 13:38:25 -07:00
Matthieu Riegler
8f803aa81a build: Run browsers tests without platform-browser-dynamic (#60937) (#61060)
Use the regular `platform-browser` providers instead.

PR Close #61060
2025-04-30 08:21:02 -07:00
Jessica Janiuk
867f389a98 Revert "build: Run browsers tests without platform-browser-dynamic (#60937)" (#61059)
This reverts commit b896ca8ed5.

PR Close #61059
2025-04-30 12:21:01 +02:00
Matthieu Riegler
b896ca8ed5 build: Run browsers tests without platform-browser-dynamic (#60937)
Use the regular `platform-browser` providers instead.

PR Close #60937
2025-04-29 12:10:53 -07:00
Andrew Kushnir
4923400791 refactor(platform-browser-dynamic): switching to relative imports within the platform-browser-dynamic package (#60559)
This commit updates scripts within `packages/platform-browser-dynamic` to relative imports as a prep work to the upcoming infra updates.

PR Close #60559
2025-03-27 18:31:52 +00:00
Alan Agius
fe9b79b615 feat(core): update Node.js version support (#60545)
Node.js v18 will reach End-of-Life on April 30, 2025, and will no longer be supported in Angular v20.
Node.js Release Schedule: https://github.com/nodejs/release#release-schedule

BREAKING CHANGE:
- Angular no longer supports Node.js v18.
- Node.js versions 22.0 to 22.10 are also no longer supported.

Before upgrading to Angular v20, ensure the Node.js version is at least 20.11.1.
For the full list of supported versions, visit: https://angular.dev/reference/versions

PR Close #60545
2025-03-26 20:42:16 -07:00
Alan Agius
70bdb88b0c fix(platform-browser): ensure platformBrowserTesting includes platformBrowser providers (#60480)
Previously, `platformBrowserTesting` did not include any `platformBrowser` providers, causing an inconsistency with `platformBrowserDynamicTesting`.

This update resolves the issue by restructuring platform inheritance to ensure proper provider inclusion:

- `platformCore → platformBrowser → platformBrowserTesting`
- `platformBrowser → platformBrowserDynamic → platformBrowserDynamicTesting`

Now, `platformBrowserTesting` correctly inherits from `platformBrowser`, aligning with the expected behavior.

PR Close #60480
2025-03-20 12:33:12 -07:00
Alan Agius
5753aa70eb refactor(platform-browser-dynamic): relocate DOMTestComponentRenderer to @angular/platform-browser (#60453)
This commit moves `DOMTestComponentRenderer` to `@angular/platform-browser/testing`, allowing the Angular CLI to eliminate its dependency on `@angular/platform-browser-dynamic`, which would no longer be required for new projects.

PR Close #60453
2025-03-19 19:08:08 +01:00
Paul Gschwendtner
3606aabd6b fix(platform-browser-dynamic): ensure compiler is loaded before @angular/common (#60458)
With the recent changes to the APF bundling rules, we turned on
tree-shaking in rollup to support proper code splitting for FESM bundles.

This resulted in Rollup re-ordering imports in the FESM bundles of
`@angular/platform-browser-dynamic`— highlighting that over the past
years, this package "accidentally" resulted in the side-effects of the
compiler registering itself globally.

This continues to be the case, and our changes generally didn't cause
any issues in CLI applications because the CLI explicitly wires up the
compiler (as expected) before `-dynamic` is even loaded. For custom
setup, like Analog, this order change surfaced a breakage because e.g.
`@angular/common` with its JIT decorators of e.g. directives/services
are triggered before the compiler is actually loaded/made available.

This commit fixes this. The explicit imports in practice are a noop
because our FESM bundling doesn't recognize compiler as side-effects
true; but marking the whole -dynamic package as having side-effects;
prevents rollup from swapping the import order. Long-term, we should
look into improving this by teaching `ng_package` that e.g. the compiler
has side-effects; so that the `import @angular/compiler` statement is
not dropped when constructing FESM bundles.

PR Close #60458
2025-03-19 16:54:48 +01:00
Matthieu Riegler
09df589e31 refactor(core): Migrate all packages with the explicit-standalone-flag schematic. (#58160)
All components, directives and pipes will now use standalone as default.
Non-standalone decorators have now `standalone: false`.

PR Close #58160
2024-10-14 14:58:57 +00:00
Matthieu Riegler
84b6896956 refactor(platform-server): Add an ssr benchmark setup. (#57647)
In order to investigate the performances of SSR, this commit introduces a benchmark suite which will measure several step of the rendering.

PR Close #57647
2024-10-04 10:45:22 -07:00
Joey Perrott
9dbe6fc18b refactor: update license text to point to angular.dev (#57901)
Update license text to point to angular.dev instead of angular.io

PR Close #57901
2024-09-24 15:33:00 +02:00
Joey Perrott
0bd55a684f refactor(docs-infra): complete removal of aio directory (#56496)
Finish removal of aio directory as it is no longer used or relied upon.

PR Close #56496
2024-06-18 12:26:00 -07:00
Andrew Kushnir
89ec195fd2 refactor(core): handle incomplete DOCUMENT instances during cleanup in tests (#56422)
`DOCUMENT` instances retrieved from DI may not contain a necessary function to complete the cleanup. In tests that don't interact with DOM, the `DOCUMENT` might be mocked and some functions might be missing. For such tests, DOM cleanup is not required and we can skip DOM cleanup logic if there are missing functions. For tests that use DOM, TestBed would behave the same as before and rely on more complete `DOCUMENT` instances.

PR Close #56422
2024-06-17 09:05:52 -07:00
Alan Agius
01172b84d9 build: update Node.js to match Angular CLI engines (#56187)
The current supported Node.js engines by the Angular CLI are `^18.19.1 || ^20.11.1 || >=22.0.0`

PR Close #56187
2024-06-03 18:00:46 +00:00
Joey Perrott
b1dffa4abe refactor: migrate platform-* to prettier formatting (#55423)
Migrate formatting to prettier for platform-* from clang-format

PR Close #55423
2024-04-19 13:49:24 -07:00
Matthieu Riegler
457d02cca3 docs: Use new Urls to drop the docs url mapper (#55043)
PR Close #55043
2024-04-09 12:23:09 -07:00
Matthieu Riegler
f523415203 docs: drop glossary links (#55044)
PR Close #55044
2024-03-28 13:02:50 -07:00
Alan Agius
eb20c1a8b1 refactor(platform-browser-dynamic): unused RESOURCE_CACHE_PROVIDER API has been removed (#54875)
BREAKING CHANGE: No longer used `RESOURCE_CACHE_PROVIDER` APIs have been removed.

PR Close #54875
2024-03-18 16:53:27 -07:00
Joey Perrott
4af7e0c96a build: set up adev testing (#53854)
Set up testing for the adev directory

PR Close #53854
2024-01-10 15:22:36 -08:00
Jeremy Elbourn
91f250dab7 build: configure cross-pkg resolution for api extraction (#52499)
This commit adds path mapping and source dependencies necessary to fully
resolve types during api doc extraction.

PR Close #52499
2024-01-05 11:27:34 -08:00
Alan Agius
19a426d54e build: update node.js engines version to be more explicate about v20 support (#52448)
This commit adds Node.js 20 as explicitly supported version to match the Angular CLI engines.

See: https://github.com/angular/angular-cli/pull/26173

PR Close #52448
2023-10-31 14:18:36 -07:00
Kristiyan Kostadinov
c07805612f test(core): clean up unnecessary nesting in old tests (#52239)
A lot of our tests are wrapped in `{}` which serves no purpose, aside from increasing the nesting level and, in some cases, causing confusion. The braces appear to be a leftover from a time when all tests were wrapped in a `function main() {}`. The function declaration was removed in #21053, but the braces remained, presumably because it was easier to search&replace for `function main()`, but not to remove the braces at the same time.

PR Close #52239
2023-10-19 09:26:15 -07:00
Jeremy Elbourn
fcc000e803 build: add targets for api doc generation (#52034)
This adds `generate_api_docs` targets to all of the packages for which we publish api reference docs. One known issue here is that any type information that comes from another package (e.g. router depending on core) currently resolve to `any` because the other sources are not available in the program. This can be tackled in a follow-up commit.

This commit also updates the install patch for `@angular/build-tools` to use the local version of compiler-cli.

PR Close #52034
2023-10-10 16:18:50 -07:00
Matthieu Riegler
40113f653c feat(core): Remove deprecated CompilerOptions.useJit andCompilerOptions.missingTranslation. (#49672)
Both properties have been deprecated in v13 and are unused in v16.

PR Close #49672
2023-10-10 09:35:55 -07:00
Alan Agius
59aa0634f4 build: remove support for Node.js v16 (#51755)
BREAKING CHANGE: Node.js v16 support has been removed and the minimum support version has been bumped to 18.13.0.

Node.js v16 is planned to be End-of-Life on 2023-09-11. Angular will stop supporting Node.js v16 in Angular v17. For Node.js release schedule details, please see: https://github.com/nodejs/release#release-schedule

PR Close #51755
2023-09-13 10:49:06 -07:00
Matthieu Riegler
4663a33a0d refactor(platform-browser-dynamic): remove reexport of MetadataOverrider (#51412)
this commit removes an unnecessary re-export

PR Close #51412
2023-08-18 07:57:34 -07:00
Matthieu Riegler
86acbf4cee refactor(core): remove unused private provider (#51222)
Both `DEFAULT_PACKAGE_URL_PROVIDER` and `ERROR_COLLECTOR_TOKEN` are unused across the project

PR Close #51222
2023-08-07 09:21:45 -07:00
Matthieu Riegler
925dad91a8 refactor(platform-browser-dynamic): Fix JSDoc comment (#50893)
JSDoc comments should start with 2 stars or the annotations would not be picked up by the AIO workflow.

With this fix, the internal methods are no longer visible in the doc.

PR Close #50893
2023-06-30 11:49:29 -07:00
Matthieu Riegler
5986ff54ec refactor(platform-browser): remove #9100 todos. (#49406)
This commit assigns the correct type instead of `any`.

PR Close #49406
2023-06-21 11:43:45 -07:00