Commit graph

802 commits

Author SHA1 Message Date
Kristiyan Kostadinov
974958913c feat(core): support TypeScript 5.4 (#54414)
Adds support for TypeScript 5.4 to the project.

PR Close #54414
2024-02-26 18:29:09 -08:00
Payam Valadkhan
5feed80523 refactor(bazel): make option generateExtraImportsInLocalMode configurable (#53543)
This is to allow testing this option using bazel

PR Close #53543
2024-01-30 15:05:42 +00:00
Joey Perrott
ec03e462f3 refactor: migrate bazel, benchpress, elements and misc to prettier formatting (#53995)
Migrate formatting to prettier for bazel, benchpress, elements and misc from clang-format

PR Close #53995
2024-01-22 09:07:15 +01:00
Andrew Kushnir
d28cf00df6 refactor(compiler-cli): add an internal config to enforce explicit deps in @defer for local compilation mode (#53591)
This commit adds an internal config option to enforce explicit deps in `@defer` for local compilation mode.

PR Close #53591
2024-01-10 15:28:58 -08:00
Kristiyan Kostadinov
94096c6ede feat(core): support TypeScript 5.3 (#52572)
Updates the repo to support TypeScript 5.3 and resolve any issues. Fixes include:
* Updating usages of TS compiler APIs to match their new signatures.
* In TS 5.3 negative numbers are represented as `PrefixUnaryExpression` instead of `NumericExpression`. These changes update all usages to account for it since passing a negative number into the old APIs results in a runtime error.

PR Close #52572
2023-11-09 22:56:41 +00: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
Payam Valadkhan
59ba2a6e9f feat(bazel): make forbidOrphanComponents option configurable (#52061)
Now users can configure the option `forbidOrphanComponents` in the tsconfig's angularCompilerOptions part.

PR Close #52061
2023-10-10 15:30:26 -07:00
Sylvain DEDIEU
da056a1fe2 fix(common): add missing types field for @angular/common/locales of exports in package.json (#52080)
Add a types entry in the packages/common/package.json exports "./locales/*" section

Fixes #52011

PR Close #52080
2023-10-10 14:33:44 -07:00
Matthieu Riegler
c2f270cf14 refactor(compiler): Delete the @angular/compiler/testing module. (#49872)
The package was removed in components, it can now be deleted here also.

PR Close #49872
2023-10-09 15:58:25 -07:00
Alex Rickabaugh
8f5cbcc845 refactor: move signals code into primitives package (#51986)
This commit reorganizes the Angular code a bit, and moves signals into a
newly defined `@angular/core/primitives` location. This will be used inside
g3 to allow non-Angular targets to depend on the signals core without
incurring a dependency on the whole framework.

PR Close #51986
2023-10-06 15:12:00 -07:00
Kristiyan Kostadinov
43e6fb0606 feat(core): enable block syntax (#51994)
Enables the new `@` block syntax by default by removing the `enabledBlockTypes` flags. There are still some internal flags that allow special use cases to opt out of the block syntax, like during XML parsing and when compiling older libraries (see #51979).

PR Close #51994
2023-10-03 15:26:05 -07:00
Kristiyan Kostadinov
d6bfebe2c8 refactor(compiler): generate arrow functions for setClassMetadata calls (#51637)
Reworks the `setClassMetadata` calls to generate arrow functions instead of full anonymous function declarations. While this won't have an effect on production bundle sizes, it's easier to read and it should lead to small parsing time gains in dev mode.

PR Close #51637
2023-09-25 09:27:26 -07:00
Paul Gschwendtner
cb545807bc fix(bazel): allow setting _enabledBlockTypes angular compiler option (#51862)
We control most flags via Starlark and therefore limit configuration
options via `tsconfig` to a minimum. We do not intend to support the
enabled block types option via Starlark, so this commit allows for
the option to be picked up.

(This is useful for benchmarking the new control flow blocks).

PR Close #51862
2023-09-22 09:51:25 -07:00
Kristiyan Kostadinov
e23aaa7d75 feat(core): drop support for older TypeScript versions (#51792)
Drops support for versions of TypeScript older than 5.2

BREAKING CHANGE:
Versions of TypeScript older than 5.2 are no longer supported.

PR Close #51792
2023-09-19 12:04:09 +02: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
Paul Gschwendtner
a6b7dbc1db fix(bazel): dedupe es2022 javascript files properly (#51500)
We were collecting all ES2022 files from entry-points (including
transitive files). Those are later on combined and filtered so that
we know which files to copy over to the package. There was no
deduping here. This did not have an effect, but could be a source
of slowness in `ng_package` and also breaks validation checks which
could show same errors multiple times for the same file.

PR Close #51500
2023-08-29 17:55:34 +00:00
Paul Gschwendtner
9aa71cc8e0 feat(bazel): prohibit cross entry-point relative imports (#51500)
Introduces a check into `ng_package` that will ensure that there are no
cross entry-point or cross-package relative imports that would end up
contributing to duplicate code. Not only would duplicate code result in
size increases, but also it could cause subtle hard-to-debug bugs,
especially when cross imports rely on e.g. singletons. Like for example
the deps tracker that is used in angular/core but also in
angular/core/testing.

PR Close #51500
2023-08-29 17:55:34 +00:00
Kristiyan Kostadinov
9cc52b9b85 feat(core): support TypeScript 5.2 (#51334)
Updates the project to support TypeScript 5.2.

PR Close #51334
2023-08-18 07:55:16 -07:00
Paul Gschwendtner
552ea77854 refactor(compiler-cli): drop tsickle code paths (#50602)
`tsickle` is not used in any code paths in 3P and we can remove
this complexity. The `tsickle` npm package has not been released
in a while and we are risking breakages with e.g. future TypeScript
versions.

Note that the `ng_module` rule was updated to not emit through
tsickle at all. The tsickle in 1P is done directly by `tsc_wrapped`
and our code path in `compiler-cli` is not needed at all.

PR Close #50602
2023-08-17 10:23:49 -07:00
Payam Valadkhan
8506cf426c refactor(bazel): Circuit out ts semantic check in local mode compilation (#50486)
In local mode compilation the TS semantic check issues tons of diagnostics due to the fact that the file dependencies (.d.ts files) are not available in the program. So it needs to be disabled.

This commit should not cause any issue for the exsiting projects as it just removes a diagnostic in the local compilation mode.

PR Close #50486
2023-06-07 12:50:54 -07:00
Kristiyan Kostadinov
cf15c290f0 build: update to TypeScript 5.1 final (#50548)
Bumps us up to the final version of TypeScript 5.1 which dropped overnight.

PR Close #50548
2023-06-02 14:06:46 -07:00
Angular Robot
16866596d5 build: update dependency @rollup/plugin-commonjs to v25 (#50264)
See associated pull request for more information.

PR Close #50264
2023-05-12 10:15:11 -07:00
Kristiyan Kostadinov
69dadd2502 feat(core): support TypeScript 5.1 (#50156)
Updates the project to support building with TypeScript 5.1.

PR Close #50156
2023-05-09 14:44:30 -07:00
Andrew Kushnir
b98ecbc0ce build: update minimum supported Node version from 16.13.0 -> 16.14.0 (#49771)
This commit updates the minimum supported Node version across packages from 16.13.0 -> 16.14.0 to ensure compatibility with dependencies.

PR Close #49771
2023-04-11 07:56:31 -07:00
Alex Rickabaugh
8b7707d920 build(core): introduce @angular/core/rxjs-interop entrypoint (#49154)
This commit adds the infrastructure for `@angular/core/rxjs-interop`, a new
core entrypoint which provides bidirectional interoperability between
Angular's built-in reactivity system of synchronous signals, and the RxJS
`Observable` abstraction.

The new entrypoint is set up as an empty shell in this commit, with its
implementation to follow in a followup.

PR Close #49154
2023-03-30 09:44:38 -07:00
Alan Agius
6e26af52fa feat(bazel): (APF) Angular Package Format updates (#49559)
Several updates to Angular Package Format.

BREAKING CHANGE:

Several changes to the Angular Package Format (APF)
- Removal of FESM2015
- Replacing ES2020 with ES2022
- Replacing FESM2020 with FESM2022

PR Close #49559
2023-03-23 08:18:45 -07:00
Andrew Scott
07cbaa3e28 Revert "feat(bazel): (APF) Angular Package Format updates (#49332)" (#49555)
This reverts commit 842d569a94.

PR Close #49555
2023-03-22 16:01:20 -07:00
Alan Agius
842d569a94 feat(bazel): (APF) Angular Package Format updates (#49332)
Several updates to Angular Package Format.

BREAKING CHANGE:

Several changes to the Angular Package Format (APF)
- Removal of FESM2015
- Replacing ES2020 with ES2022
- Replacing FESM2020 with FESM2022

PR Close #49332
2023-03-22 14:00:19 -07:00
Angular Robot
51d7cfbac6 build: update all non-major dependencies (#49267)
See associated pull request for more information.

PR Close #49267
2023-03-02 14:09:14 -08:00
Alan Agius
f594725951 refactor(core): remove Node.js v14 support (#49255)
BREAKING CHANGE: Node.js v14 support has been removed

Node.js v14 is planned to be End-of-Life on 2023-04-30. Angular will stop supporting Node.js v14 in Angular v16. Angular v16 will continue to officially support Node.js versions v16 and v18.

PR Close #49255
2023-02-28 11:00:25 -08:00
Kristiyan Kostadinov
99d874fe3b feat(core): add support for TypeScript 5.0 (#49126)
Updates the project to support TypeScript 5.0 and to resolve any errors that came up as a result of the update.

PR Close #49126
2023-02-28 08:24:47 -08:00
Kristiyan Kostadinov
79cdfeb392 feat(compiler): drop support for TypeScript 4.8 (#49155)
Drops support for TypeScript 4.8 from the compiler and removes all of the compatibility code we had for it.

BREAKING CHANGE:
* TypeScript 4.8 is no longer supported.

PR Close #49155
2023-02-23 10:39:43 -08:00
Andrew Kushnir
83a6e203e3 refactor(compiler): drop obsolete NgFactory and NgSummary config options (#48268)
The options to generate NgFactory and NgSummary files were added to Ivy for backwards compatibility with ViewEngine. Since ViewEngine was deprecated and removed, the NgFactory and NgSummary files are no longer used as well.

This commit drops obsolete options to generate NgFactory and NgSummary files. Also, the logic that generates those files is also removed.

PR Close #48268
2023-02-21 13:03:59 -08:00
Joey Perrott
3a6aebf349 fix(bazel): stop publishing @angular/bazel package to npm (#49093)
We are no longer publishing the @angular/bazel package in prepeartion for its removal from the angular/angular repo.
The piece that we still rely on for our own infrastructure will be moved to angular/dev-infra.

PR Close #49093
2023-02-16 11:04:00 -08:00
Paul Gschwendtner
b6e3840ed4 refactor(bazel): remove unnecessary banner stamping code (#48798)
The `ng_package` rule supports replacing `0.0.0-PLACEHOLDER`
in license files that are inserted as part of rollup. This
requires additional logic to detect stamping, reading the status
files and then replacing the placeholder.

All of this already handled as part of normal package substitutions
and we can replace this unnecessary complexity.

See: da50feb23f/internal/pkg_npm/pkg_npm.bzl (L195)

PR Close #48798
2023-01-20 18:39:22 +00:00
Payam Valadkhan
08b72b77e3 refactor(bazel): Extract the helper patchNgHostWithFileNameToModuleName to its own file for 1P use (#48739)
Some 1P tools require to use the helper patchNgHostWithFileNameToModuleName, and the present location of this helper leads to circular depedency. So it is required to move this helper into a separate module to facilitate importing.

PR Close #48739
2023-01-19 17:34:57 +00:00
Angular Robot
5b1c7c10a0 build: update dependency @rollup/plugin-commonjs to v24 (#48530)
See associated pull request for more information.

PR Close #48530
2023-01-13 10:35:19 -08:00
Paul Gschwendtner
1898190c28 build: update ng-dev and account for stamping changes (#48731)
* updates ng-dev and build-tooling since the previous SHAs are
no longer existent after the CircleCI incident snapshot build removal.
* accounts for the new stamping variables.

PR Close #48731
2023-01-13 14:10:39 +00:00
Doug Parker
edd7982d51 refactor(bazel): disables the Tsickle decorator transform (#47934)
This is no longer needed in google3 and actively impedes prodmode tests. See http://b/254054103#comment7 for deeper analysis.

This just turns off the transform for now, if it lands successfully I'll follow up with deleting the flag and dead code altogether.

PR Close #47934
2023-01-10 07:58:39 -08:00
Alan Agius
82d0998968 fix(bazel): remove duplicate license banners from FESM bundles (#48560)
Prior to this change the FESM bundles for the FW packages have the license banner duplicated hundreds of times in each published file.

With this change we remove all the banners from the individual input files. A new banner will be appended at the top of the FESM using rollup's banner option.

While there is a rollup plugin on NPM to strip these banners (https://github.com/mjeanroy/rollup-plugin-strip-banner) we could not use this as it does not support `.mjs`.

PR Close #48560
2023-01-02 12:16:55 +00:00
Paul Gschwendtner
9add063c17 refactor: update packages/bazel npm artifact to not rely on defaults.bzl (#48521)
Fixes that we temporarily broke the Bazel npm package artifact as
part of the ESM work. This commit adjusts it and also makes the
artifact subsitutions more maintainable.

PR Close #48521
2022-12-19 19:50:45 +00:00
Paul Gschwendtner
90c2088679 build: make devmode a noop and ensure it never runs (#48521)
This is basically a pre-step for combining devmode and prodmode into a
single compilation. We are already achieving this now, and can claim
with confidence that we reduced possible actions by half. This is
especially important now that prodmode is used more often, but rules
potentially still using the devmode ESM sources. We can avoid double
compilations (which existed before the whole ESM migration too!).

We will measure this more when we have more concrete documentation
of the changes & a better planning document.

Changes:

  * ts_library will no longer generate devmode `d.ts`. Definitions are
    generated as part of prodmode. That way only prodmode can be exposed
    via providers.
  * applied the same to `ng_module`.
  * updates migrations to bundle because *everything* using `ts_library`
    is now ESM. This is actually also useful in the future if
    schematics rely on e.g. the compiler.
  * updates schematics for localize to also bundle. similar reason as
    above.

PR Close #48521
2022-12-19 19:50:45 +00:00
Paul Gschwendtner
3f612ed9b9 build: update packages/bazel/test to work with ESM (#48521)
The bazel tests cannot use CommonJS features like `require` and should
be updated to work with ESM. Additionally some specs are updated to
no longer assert CJS/UMD output from `ng_module`. The rule only emits
ESM now.

PR Close #48521
2022-12-19 19:50:42 +00:00
Paul Gschwendtner
d3d22a9009 build: refactor ng_package to work with ESM (#48521)
Removes `shelljs` which is a known ESM-problematic dependency.
We don't need it anyway.

PR Close #48521
2022-12-19 19:50:41 +00:00
Paul Gschwendtner
9e91bbd329 build: refactor ngc-wrapped to support ESM (#48521)
Since this repo will now be strict ESM, and Angular Compiler packages
on NPM are also ESM-only, we can rework `ngc-wrapped` to remove
the CJS/ESM interop and we make it strict ESM too.

PR Close #48521
2022-12-19 19:50:40 +00:00
Paul Gschwendtner
ba5fe263b5 build: switch ng_module and ts_library devmode to ES2020 ESM (#48521)
Currently the devmode output for `ng_module` and `ts_library` is
using ES5 CommonJS UMD. To bring it in sync with prodmode and
to start with our long-term migration to full ESM- the devmode
is updated to to ES2020 ES modules too.

This will require more tricks to make devmod work with the bazel
setup and also tests may need to be refactored given them relying
on ES5 CJS features, like for `spyOn` jasmine patching etc.

PR Close #48521
2022-12-19 19:50:40 +00:00
Kristiyan Kostadinov
dd42974b07 feat(core): support TypeScript 4.9 (#48005)
Updates to TypeScript 4.9 and resolves some of the errors and deprecation warnings that showed up as a result.

PR Close #48005
2022-12-06 10:45:33 -08:00
Derek Cormier
f37dd0fc96 build(bazel): create AIO example playgrounds for manual testing
After the bazel migration, AIO examples are no longer fully formed in
the source tree.
2022-11-22 13:51:16 -07:00
Derek Cormier
b4c40c5d55 build(bazel): merge aio/tools/defaults.bzl and tools/defaults.bzl
Detect the correct workspace for the source maps dep.
2022-11-22 13:51:16 -07:00
Derek Cormier
bc1e93d639 build(bazel): refactor aio example e2es to fix windows performance
Use the same config flag to enable local vs npm deps as aio.
2022-11-22 13:51:16 -07:00