Commit graph

145 commits

Author SHA1 Message Date
Angular Robot
e3fbeab3bd build: update dependency @rollup/plugin-commonjs to v23 (#47711)
See associated pull request for more information.

PR Close #47711
2022-10-11 23:09:06 +00:00
Alan Agius
1b9fd46d14 feat(core): add support for Node.js version 18 (#47730)
This change aligns with the supported Node.js versions of the Angular CLI.
See: https://github.com/angular/angular-cli/pull/24026

BREAKING CHANGE: Angular no longer supports Node.js versions `14.[15-19].x` and `16.[10-12].x`. Current supported versions of Node.js are `14.20.x`, `16.13.x` and `18.10.x`.

PR Close #47730
2022-10-11 17:21:19 +00:00
Kristiyan Kostadinov
ed11a13c3c feat(core): drop support for TypeScript 4.6 and 4.7 (#47690)
Updates the version range in the compiler to require at least TypeScript 4.8. Note that I'm keeping the backwards-compatibility layer for 4.7 around for now until internal projects have been migrated to 4.8.

BREAKING CHANGE:
TypeScript versions older than 4.8 are no longer supported.

PR Close #47690
2022-10-10 16:18:56 +00:00
Kristiyan Kostadinov
31429eaccc feat(core): support TypeScript 4.8 (#47038)
Adds support for TypeScript 4.8 and resolves some issues that came up as a result of the update.

Most of the issues came from some changes in TypeScript where the `decorators` and `modifiers` properties were removed from most node types, and were combined into a single `modifiers` array. Since we need to continue supporting TS 4.6 and 4.7 until v15, I ended up creating a new `ngtsc/ts_compatibility` directory to make it easier to reuse the new backwards-compatible code.

PR Close #47038
2022-08-16 16:02:47 +00:00
Paul Gschwendtner
ea89677c12 feat(compiler-cli): support more recent version of tsickle (#47018)
Updates the tsickle version in the repository and accounts for its changes in
the `compiler-cli` package. Tsickle made a breaking change in the minor version
segment bump that would break the use with `@angular/compiler-cli`

Additionally the tsickle version for `@angular/bazel` is updated since
we updated `@bazel/typescript` to also account for the breaking changes.

See: 78a0528107

PR Close #47018
2022-08-03 17:36:18 -07:00
renovate[bot]
2758a30a34 build: update dependency @rollup/plugin-commonjs to v22 (#46556)
PR Close #46556
2022-06-29 10:08:29 -07:00
Kristiyan Kostadinov
ceb9abd9fd fix(bazel): update API extractor version (#46259)
`@angular/bazel` currently uses an older version of `@microsoft/api-extractor` which is causing downstream issues in Components. These changes bump up to a version that has a fix.

Context: https://github.com/angular/components/pull/25027

PR Close #46259
2022-06-06 10:16:04 -07:00
Renovate Bot
d869ede818 build: update all non-major dependencies (#45967)
PR Close #45967
2022-05-20 14:18:09 -07:00
Paul Gschwendtner
a6b6590339 fix(bazel): speed up d.ts bundling by configuring worker (#45900)
Speeds up the `d.ts` bundling by configuring it as a Bazel
persistent worker. Also improve logging for the ng packager
rule to make it easier to spot which actions/bundles take
up significant time.

Type bundling will occur for every entry-point so for machines
with rather limited cores/threads, this will be useful to save
NodeJS boot and resolution time.

PR Close #45900
2022-05-05 15:35:14 -07:00
Paul Gschwendtner
95555658cf build: disable bazel nodejs linker to improve stability on windows (#45872)
The NodeJS Bazel linker does not work well on Windows because there
is no sandboxing and linker processes from different tests will attempt
to modify the same `node_modules`, causing concurrency race conditions
and resulting in flakiness.

PR Close #45872
2022-05-04 16:20:57 -07:00
Kristiyan Kostadinov
29039fcdbc feat(core): support TypeScript 4.7 (#45749)
Adds support for TypeScript 4.7. Changes include:
* Bumping the TS version as well as some Bazel dependencies to include https://github.com/bazelbuild/rules_nodejs/pull/3420.
* Adding a backwards-compatibility layer for calls to `updateTypeParameterDeclaration`.
* Making `LView` generic in order to make it easier to type the context based on the usage. Currently the context can be 4 different types which coupled with stricter type checking would required a lot of extra casting all over `core`.
* Fixing a bunch of miscellaneous type errors.
* Removing assertions of `ReferenceEntry.isDefinition` in a few of the language service tests. The field isn't returned by TS anymore and we weren't using it for anything.
* Resolving in error in the language service that was caused by TS attempting to parse HTML files when we try to open them. Previous TS was silently setting them as `ScriptKind.Unknown` and ignoring the errors, but now it throws. I've worked around it by setting them as `ScriptKind.JSX`.

PR Close #45749
2022-04-29 12:19:45 -04:00
Paul Gschwendtner
68597bb0ca feat(bazel): speed up dev-turnaround by bundling types only when packaging (#45405)
Speeds up the dev-turnaround by only bundling types when packaging. Currently
bundling occurs for all the `ng_module` targets in devmode.

This has various positive benefits:

* Avoidance of this rather slower operation in development
* Makes APF-built packages also handle types for `ts_library` targets consistently.
* Allows us to ensure APF entry-points have `d.ts` _always_ bundled (working with ESM
module resolution in TypeScript -- currently experimental)
* Allows us to remove the secondary `package.json` files from APF (maybe APF v14? - seems
low-impact). This would clean-up the APF even more and fix resolution issues (like in Vite)

PR Close #45405
2022-04-21 11:09:39 -07:00
Renovate Bot
770ea926bf build: update dependency @microsoft/api-extractor to v7.22.2 (#45641)
PR Close #45641
2022-04-15 09:27:39 -07:00
Renovate Bot
7d2a619812 build: update all non-major dependencies (#45632)
PR Close #45632
2022-04-14 15:02:45 -07:00
Renovate Bot
7bf1cf4bf5 build: update all non-major dependencies (#45493)
PR Close #45493
2022-04-13 15:33:33 +00:00
Renovate Bot
48b8a1fcf0 build: update all non-major dependencies (#45470)
Updates all non-major dependencies, including Bazel

PR Close #45470
2022-04-11 21:01:09 +00:00
Renovate Bot
e55e98dce5 build: update all non-major dependencies (#45374)
PR Close #45374
2022-03-29 13:22:26 -07:00
Paul Gschwendtner
a24293ae80 build: migrate more usages from @bazel/typescript to @bazel/concatjs (#45431)
As mentioned in previous commits (check them for more details), `@bazel/typescript`
no longer contains `ts_library`-specific code, so we no longer need that dependency.

PR Close #45431
2022-03-25 12:18:34 -07:00
Kristiyan Kostadinov
c9d566ce4b feat(core): drop support for TypeScript 4.4 and 4.5 (#45394)
Drops support for TypeScript older than 4.6 and removes some workarounds in the compiler.

BREAKING CHANGE:
TypeScript versions older than 4.6 are no longer supported.

PR Close #45394
2022-03-24 10:51:47 -07:00
Alan Agius
6eaaefd22e feat(core): drop support for Node.js 12 (#45286)
Node.js v12 will become EOL on 2022-04-30. As a result, Angular CLI v14 will no longer support Node.js v12.

BREAKING CHANGE:

Support for Node.js v12 has been removed as it will become EOL on 2022-04-30. Please use Node.js v14.15 or later.

PR Close #45286
2022-03-08 12:05:03 -08:00
Kristiyan Kostadinov
94bba76a4a feat(core): support TypeScript 4.6 (#45190)
Adds support for TypeScript 4.6.

PR Close #45190
2022-03-07 11:31:39 -08:00
Joey Perrott
3c0446cd2d build: update shelljs dependencies to "^0.8.5" (#44697)
Update shelljs dependencies to ^0.8.5 to fix a vulnerability reported to shelljs.

PR Close #44697
2022-01-13 18:27:32 +00:00
Renovate Bot
dff497f78d build: update all non-major dependencies (#44502)
PR Close #44502
2022-01-10 19:55:23 +00:00
Renovate Bot
6c05c3fd2d build: update all non-major dependencies (#44152)
PR Close #44152
2021-12-14 16:04:34 -05:00
Kristiyan Kostadinov
d56e3f43a1 feat(core): support TypeScript 4.5 (#44164)
Adds support for TypeScript 4.5. Includes the following changes:
* Bumping the package versions.
* Fixing a few calls to `createExportSpecifier` and `createImportSpecifier` that require an extra parameter.
* Adding some missing methods to the TS compiler hosts.
* Fixing an issue in the TS mocks for the ngcc tests where a regex was too agressive and was trying to match a path like `/node_modules/@typescript/lib-es5`.
* Accounting for type-only import specifiers when reporting DI errors (see #43620).

Fixes #43620.

PR Close #44164
2021-11-30 11:59:02 -05:00
Alex Rickabaugh
aadfad739b build: remove view engine build infrastructure (#43884)
This commit removes --config=viewengine and makes Ivy the default for
building Angular.

PR Close #43884
2021-11-23 21:10:06 +00:00
Renovate Bot
891318e805 build: update all non-major dependencies (#43974)
PR Close #43974
2021-11-09 21:00:17 +00:00
Renovate Bot
ba4e18b096 build: update all non-major dependencies (#43838)
PR Close #43838
2021-10-15 10:45:02 -07:00
Renovate Bot
49a0b60dc7 build: update dependency @rollup/plugin-commonjs to v21 (#43675)
PR Close #43675
2021-10-13 16:48:46 +00:00
Renovate Bot
4c00e92023 build: update dependency @microsoft/api-extractor to v7.18.15 (#43771)
PR Close #43771
2021-10-08 20:42:42 +00:00
Renovate Bot
35a1705595 build: update all non-major dependencies (#43760)
PR Close #43760
2021-10-07 20:56:11 +00:00
Paul Gschwendtner
e0a0d05d45 feat(core): update node version support range to support v16 (#43740)
This commit updates the `node` engines range for all Angular
framework packages to:

* No longer support NodeJS v12 `< 12.20`. This is done because APF v13
  uses package export patterns which are only supported as of v12.20.
  https://nodejs.org/api/packages.html#packages_subpath_patterns.

* Allows for the latest v16 NodeJS versions. This matches with the CLI
  which added NodeJS v16 support with https://github.com/angular/angular-cli/pull/21854.

  We already limit this to `>= v16.10.0` in preparation to only
  supporting the LTS minors of Node v16.

BREAKING CHANGE: NodeJS versions older than `v12.20.0` are no longer
supported due to the Angular packages using the NodeJS package exports
feature with subpath patterns.

PR Close #43740
2021-10-06 10:55:44 -07:00
Kristiyan Kostadinov
c14085e434 feat(core): drop support for TypeScript 4.2 and 4.3 (#43642)
Bumps the minimum required TypeScript version to 4.4.2 and removes the integration tests for 4.1, 4.2 and 4.3.

BREAKING CHANGE:
TypeScript versions older than 4.4.2 are no longer supported.

PR Close #43642
2021-10-05 17:26:37 -07:00
Paul Gschwendtner
dbe656d1e0 fix(bazel): ngc-wrapped should not rely on linker for external workspaces (#43690)
Currently when `ngc-wrapped` runs in external/consumer workspaces, like
in the Angular Components project, the `ngc-wrapped` binary relies on
the linker due to the patched module resolution in `rules_nodejs` no
longer being default. The reliance on the linker of `rules_nodejs` is
problematic for workers as the required `node_modules` are not
re-linked for every build. This was previously not an issue before the
APF v13 changes because the `compiler-cli` module was loaded only once
through an import statement.

As of APF v13, the compiler-cli module is loaded dynamically for every
build. This dynamic import can then break as the worker does not
initially load the compiler-cli module when becoming online. Instead,
the module is loaded on the first build where the node modules might not
be linked properly anymore (due to e.g. other targets running at the same time).

We fix thi issue by doing the following things:

1. Enabling the patched module resolution for consumer/external
   workspaces. This would match how we use ngc-wrapped inside FW as
   well.

2. Caching the compiler CLI module. Instead of re-fetching the module
   through dynamic imports for every build (in a worker), we should use
   the cached version. This is semantically the same as with APF v12
   where a single import statement at file top-level was used.
   Technically, NodeJS should cache the module, but it doesn't hurt
   directly caching it as the module resolution will be patched by
   `rules_nodejs` and could perform unnecessary tasks.

PR Close #43690
2021-10-05 17:25:14 -07:00
Paul Gschwendtner
49b82ae561 feat(bazel): implement partial compilation APF v13 for ng_package rule (#43431)
This commit implements partial compilation APF v13 for the
`ng_package` rule. The changes involve the following things:

1. Requesting the partial compilation output for all targets (and
   its transitives) in the `deps` or `srcs` attributes.

2. Downleveling of ES2020 prodmode output to a FESM2015 file.

3. Cleanup of file resolution. Previusly, execroot file paths (which are
   passed to the packager tool) were composed manually. This is prone to
   mistakes and breaks with transitions.

   A lot of this code can be simplified by passing the necessary Bazel
   `File` information as JSON. This also simplifies the packager tool
   significantly (and makes it more readable..)

4. Remoal of UMD bundles. This also allows us remove the `globals` rule
   attribute with `externals` (we do not need any UMD global identifier
   names anymore).

5. The `package.json` will set the `exports` field and use subpath
   exports to make module resolution work for ESM consumers.

6. TSLib is also always set as `external` now. Previously it had to be
   added as `dep` to the `ng_package` rule as UMD files bundled `tslib`.

7. The `include_devmode_srcs` option has been removed. This option was
   an addition to APF that allowed the `@angular/compiler` to ship
   non-flattened ES5 CommonJS sources. We want to keep APF consistent
   and not allow such exceptions. Compiler is now a strict APF package
   as well, and the compiler-cli just needs to go through the primary
   entry-point for things it needs (or it bundles the necessary parts
   into the CLI.)

Overall, these are all changes. A lot of changes to make the packager
rule and tool more readable and Bazel-idiomatic were made as well. This
allows us to easier make packaging changes in the future, and it's more
future-proof if we ever change how inputs (like `ng_module` targets) are
generated (e.g. consider a case where we'd use the `ts_project` rule).

PR Close #43431
2021-10-01 18:28:42 +00:00
Paul Gschwendtner
5b53e6122a refactor(bazel): remove unused modify_tsconfig.js file (#43431)
Removes the unused `modify_tsconfig.js` file located in the
`@angular/bazel` package. This file existed in the past for the
ESM5 compilation aspect relying on the TS compilation to be replayed.

We just forgot removing the file and associated `nodejs_binary`.

PR Close #43431
2021-10-01 18:28:42 +00:00
Renovate Bot
d9b76e4b3d build: update all non-major dependencies (#43411)
PR Close #43411
2021-10-01 12:27:25 -04:00
Kristiyan Kostadinov
ea61ec2562 feat(core): support TypeScript 4.4 (#43281)
Adds support for TypeScript 4.4. High-level overview of the changes made in this PR:

* Bumps the various packages to `typescript@4.4.2` and `tslib@2.3.0`.
* The `useUnknownInCatchVariables` compiler option has been disabled so that we don't have to cast error objects explicitly everywhere.
* TS now passes in a third argument to the `__spreadArray` call inside child class constructors. I had to update a couple of places in the runtime and ngcc to be able to pick up the calls correctly.
* TS now generates code like `(0, foo)(arg1, arg2)` for imported function calls. I had to update a few of our tests to account for it. See https://github.com/microsoft/TypeScript/pull/44624.
* Our `ngtsc` test setup calls the private `matchFiles` function from TS. I had to update our usage, because a new parameter was added.
* There was one place where we were setting the readonly `hasTrailingComma` property. I updated the usage to pass in the value when constructing the object instead.
* Some browser types were updated which meant that I had to resolve some trivial type errors.
* The downlevel decorators tranform was running into an issue where the Closure synthetic comments were being emitted twice. I've worked around it by recreating the class declaration node instead of cloning it.

PR Close #43281
2021-09-23 14:49:19 -07:00
Renovate Bot
66f13dade5 build: update all non-major dependencies (#43274)
PR Close #43274
2021-09-09 09:18:43 -07:00
Renovate Bot
298d8a4481 build: update all non-major dependencies (#43263)
PR Close #43263
2021-08-26 09:18:37 -07:00
Renovate Bot
398be10262 build: update all non-major dependencies (#42922)
PR Close #42922
2021-08-12 15:36:07 -07:00
Renovate Bot
74228215a1 build: update dependency @microsoft/api-extractor to v7.18.4 (#42864)
PR Close #42864
2021-07-15 13:34:24 -07:00
Alan Agius
c5351aae29 build: update @microsoft/api-extractor to 7.18.1 (#42804)
microsoft/rushstack#2797 is fixed.

PR Close #42804
2021-07-09 12:14:56 -07:00
Paul Gschwendtner
2feb4bc9de build: update api-extractor dependency to support typescript 4.3 (#42737)
Updates the api-extractor dependencies of the repository, and within
the `@angular/bazel` package so that TypeScript 4.3 is supported when
a flattened typings file is generated. Without this update, the api
extractor could fail if a referenced tsconfig use a TS 4.3-only option such as
`noImplicitOverride`.

Note: This could also be considered a `feat:` for `@angular/bazel`,
but this package is not part of the public API anyway and we'd want
that change to land in the patch branches too (to keep the goldens
in sync between release branches as much as possible)

PR Close #42737
2021-07-02 10:08:03 -07:00
Paul Gschwendtner
25f763cff8 feat(core): support TypeScript 4.3 (#42022)
Switches the repository to TypeScript 4.3 and the latest
version of tslib. This involves updating the peer dependency
ranges on `typescript` for the compiler CLI and for the Bazel
package. Tests for new TypeScript features have been added to
ensure compatibility with Angular's ngtsc compiler.

PR Close #42022
2021-06-04 11:17:09 -07:00
Joey Perrott
1d08acb104 build(bazel): update supported range of node versions to be less restrictive (#42205)
Update the supported range of node versions for to be less restrictive, no longer causing
yarn or npm to fail engine's checks for future versions of node.

While this change will no longer cause yarn or npm to fail these engine's check, this does
not reflect a change in the officially supported versions of node for Angular.  Angular
continues to maintain support for Active LTS and Maintenance LTS versions of node.

PR Close #42205
2021-05-25 17:48:45 +00:00
Joey Perrott
2dd956421c build: remove publishConfig entry from package.json entries (#42104)
Remove publishConfig property from the package.json entry for each of the entries in
the publish configuration.  Using the wombat proxy is now ensured/managed by the
ng-dev release tooling.

PR Close #42104
2021-05-18 15:41:33 -07:00
Joey Perrott
6f0c7fb91c fix(bazel): update supported range of node versions to only include LTS versions (#41822)
Update the supported range of node versions for Angular to only include supported LTS versions.

PR Close #41822
2021-04-26 15:21:13 -07:00
Renovate Bot
324d2f92da build: update shelljs to version 0.8.4 (#41673)
PR Close #41673
2021-04-19 08:52:58 -07:00
Joey Perrott
d583d926db feat(bazel): update supported range of node versions (#41544)
Update the supported range of node versions for Angular.  Angular now
supports node >=12.14.1 to <16.0.0, dropping support for Node v10.

PR Close #41544
2021-04-14 09:40:17 -07:00