Commit graph

786 commits

Author SHA1 Message Date
Paul Gschwendtner
944b6705f8 build: remove unused starlark file that is no longer used (#44430)
Cleans up an unused Starlark file used by the old integration test
setup.

PR Close #44430
2021-12-10 16:31:04 -05:00
Paul Gschwendtner
f51b00916e build: fix integration test size trackings not running after recent refactoring (#44430)
Fixes that the integration test size trackings stopped working due to
the recent refactorings (switch to the rule from `@angular/dev-infra-private`).

The size-tracking does not integrate very-well into Bazel and needs
a better solution in the future, allowing for RBE and Windows support,
but currently with the new rule/setup/structure the tracking does not
validate sizes because:

* The `dist/*.js` argument to the tracking script got expanded and
  messed up the indices. It should be passed as a literal. This now
  surfaced because the new rule runs commands in a shell.

* The name for the size goldens were not computed properly because they
  were based on `ctx.attr.name`, but given the new structure, the test
  targets are always named `test`.

PR Close #44430
2021-12-10 16:31:04 -05:00
Paul Gschwendtner
2664bc2b3e test: switch integration tests from puppeteer/webdriver-manager to Bazel-managed chromium (#44238)
Switches the integration tests form Puppeteer/webdriver-manager to the
Bazel-managed Chromium/Chromedriver. This is now possible with the new
integration test rule for which we can consult the
`dev-infra/bazel/browsers` toolchain and setup environment variables.
This has been configured already in a previous commit.

This commit also includes some additional small cleanups necessary for
the new integration test rule:

* The `test.sh` scripts have been renamed as they would conflict with
  the `test.sh` scripts generated by the integration test rule.
  Previously this was not an issue because tests were declared at a
  higher-level. As mentioned though this has other downsides and it is
  trivial to rename the file.

* Related to the point above, since tests are now declared witin the
  actual test folder (for perf e.g.), `package.json` files setting
  `"type": "module"` will accidentally cause the `nodejs_test`-generated
  files to be considered ESM. This is not correct and likely needs to be
  fixed upstream in `rules_nodejs` where explicit `.cjs` extensions
  should be used. This is only happening **once** in the `injectable-def`
  test so it is acceptable doing that for now.

PR Close #44238
2021-12-08 13:42:42 -05:00
Paul Gschwendtner
5837fbd357 refactor: setup bazel integration test with new integration rule (#44238)
Sets up the Bazel integration test with the new integration rule. This
commit is separate from the other changes because it required some
additional work. i.e.

The test has moved from `integration/bazel` to `integration/<..>/bazel`
where `<..>` is a new Bazel package defining the integration test.

This is necessary because we could not declare the integration test
within the `BUILD.bazel` file actually being part of the nested bazel
workspace. In those cases we can just define it at a higher-level and
use integration test `working_dir` attribute.

PR Close #44238
2021-12-08 13:42:41 -05:00
Paul Gschwendtner
64fd824f67 build: setup test targets for integration tests with new rule (#44238)
Sets up the test targets for integration tests with the new rule.
The targets will match the configuration of the previous integration
test setup (through the dictionary in a `bzl` file).

Note: We already add `setup_chromium` based on whether Chromium tests
run as part of this integration test. In a follow-up commit we can then
remove puppeteer and rely on the Bazel-managed version of Chromium.

PR Close #44238
2021-12-08 13:42:41 -05:00
Paul Gschwendtner
6c0905d7ab build: wire up integration test rule from shared dev-infra package (#44238)
Wires up the integration test rule from the shared dev-infra package,
while also deleting the old integration test rule.

The readme is updated to reflect the changes that are being made
to run with the new integration rule. Overall one major difference is
that we will declare the integration test targets within each test
directory, making those actual bazel packages. This is more idiomatic
within Bazel and also reduces the computation within Skyframe as less
globs need to be evaluated for example.

PR Close #44238
2021-12-08 13:42:41 -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
JoostK
d8e65776cb refactor(ngcc): remove Ivy switch marker transform (#43891)
ngcc used to rewrite `PRE_R3` markers to become `POST_R3` in order to
switch the runtime implementation in `@angular/core` from View Engine to
Ivy. Now that `@angular/core` is published as native Ivy package and the
runtime switch code has been removed, there is no need for ngcc to
perform this transform anymore.

PR Close #43891
2021-11-24 19:26:25 +00:00
Joey Perrott
0ad0054083 build: update repository to node@16 locally (#44211)
As node 16 is now active LTS, updating to node 16 is a better choice for our own development. Notably its
support for M1 chips is an important value add for us.

PR Close #44211
2021-11-24 18:55:33 +00: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
Pete Bacon Darwin
24b635395f fix(ngcc): ensure that ngcc does not write a lock-file into node_modules package directories (#44228)
When executing, ngcc writes a lock-file that is used to coordinate multiple concurrent instances of ngcc.
Previously, this file was written at `node_modules/@angular/compiler-cli/ngcc`, or similar depending upon the bundling of the package.
But this causes problems for setups where `node_modules` package directories are expected to be read-only.
Now, the lock-file is written as `.ngcc_lock_file` into the top of the `node_modules`, which is an acceptable place to store transient files.

This change should help to unblock use of tools like pnpm and lerna, which can use symlinks to readonly package directories.

PR Close #44228
2021-11-22 17:55:13 +00:00
Renovate Bot
891318e805 build: update all non-major dependencies (#43974)
PR Close #43974
2021-11-09 21:00:17 +00:00
Pete Bacon Darwin
28ef5af03f refactor(ngcc): improve logging of progress (#43996)
This commit adds additional information to encourage developers to contact
the author of View Engine libraries and ask them to update to partial Ivy.

Fixes #42308

PR Close #43996
2021-11-09 18:10:18 +00:00
Paul Gschwendtner
0d0895edfa test: re-enable bazel integration test with APF v13 (#44061)
Re-enables the Bazel integration test that we have disabled
as part of the APF v13 changes. Since there are no UMD files
anymore, the Karma tests no longer worked. Similarly, the Angular
linker had to run for building the production bundle.

PR Close #44061
2021-11-05 16:22:17 +00:00
Paul Gschwendtner
ec7dd5d4c2 test: re-enable platform-server integration test (#44055)
Re-enables the platform-server integration test that we had
to disable when we landed the APF v13 changes.

We can re-enable it by setting up the `fullySpecified` option
similar to how the CLI does it.

PR Close #44055
2021-11-04 18:57:22 +00:00
Paul Gschwendtner
8cbc0e9d0e test: update ng-update integration test to test v13 migrations (#44016)
Updates the `ng-update` migration integration test to run against
v13 migrations. We have removed all older migrations so this integration
test needs to be updated.

PR Close #44016
2021-11-04 18:54:55 +00:00
Paul Gschwendtner
78569f088e test: re-enable ng-update migration integration test (#44016)
Re-enables the ng-update migration integration test as all the ESM/CJS
interop changes have landed in the `@angular/core` schematics folder.

PR Close #44016
2021-11-04 18:54:54 +00:00
Paul Gschwendtner
60dec531fc test: wire up ng-add-localize CLI project as integration test to run within Bazel (#44016)
Wires up the `ng-add-localize` minimal CLI project to run as integration
test within Bazel.

PR Close #44016
2021-11-04 18:54:54 +00:00
Paul Gschwendtner
d93ac1e81b test: setup minimal CLI project for ng-add localize integration test (#44016)
Sets up a minimal CLI project for testing that `ng add @angular/localize`
works as expected. Schematic sub-packages are prone to CJS/ESM issues
due the overall framework packages being denoted as strict ESM.

This may not be an issue in the concrete scenario of `@angular/localize`
right now, but it is still good to have an integration test similar to
the tests we have for `@angular/core` schematics.

PR Close #44016
2021-11-04 18:54:54 +00:00
Alan Agius
6247efa81b test: remove ng_elements_schematics integration test (#43975)
This test has been removed as since the elements schematic has been removed in a previous commit.

PR Close #43975
2021-10-29 15:43:55 -07:00
Alan Agius
b322585256 test: remove document-register-element from elements tests (#43975)
All the [browsers](https://angular.io/guide/browser-support) that Angular supports `CustomElementRegistry` APIs

PR Close #43975
2021-10-29 15:43:55 -07:00
Joey Perrott
aef63e7ae5 build: remove "ivy-only" bazel tag (#43862)
Because all actions are assumed to be running on Ivy, things which only work on Ivy should not be marked as
Ivy only.

PR Close #43862
2021-10-19 10:06:55 -07:00
Joey Perrott
a365a1f0ff build: rename "no-ivy-aot" tag to "view-engine-only" (#43862)
Using the tag "view-engine-only" better describes the expected usage of bazel targets with the test. They can
only be run with view engine.

PR Close #43862
2021-10-19 10:06:55 -07:00
Paul Gschwendtner
6783977d21 build: update bazel integration test to rules_nodejs v4.4.1 (#43838)
Updates the Bazel integration test to `rules_nodejs` v4.4.1. Renovate
could not complete this update automatically because it is unable
to update the `package.json` and `lock` file due to there being
relative `file:` references.

PR Close #43838
2021-10-15 10:45:02 -07:00
Alan Agius
6411128284 ci: update default circle ci image to cimg/node:14.17.6 (#43810)
With this change we update Node.js version to 14.17 which is needed because of Eslint 8. Also, we replace the legacy images `circleci/node` with the new images `cimg/node`.

See: https://circleci.com/developer/images/image/cimg/node

PR Close #43810
2021-10-12 17:43:15 +00:00
Alex Rickabaugh
48aa0039ea refactor(compiler-cli): update peerDependencies to require rxjs ^7.4.0 (#43748)
RxJS 7 versions prior to 7.4.0 export ES5 code, whereas Angular
applications using RxJS 6 today use ES2015. This was fixed in RxJS 7.4.0
which exposes ES2015 entrypoints as well. This commit updates Angular's
peer dependencies to require the newer RxJS.

PR Close #43748
2021-10-06 15:57:59 -07:00
Alan Agius
52587e5b43 test: remove progress option from dev-server builder (#43730)
This change addresses the following failures
```
Schema validation failed with the following errors:
  Data path "" must NOT have additional properties(progress)
```

See failures in https://app.circleci.com/pipelines/github/angular/angular/38086/workflows/7fd378bb-2c9c-4b7e-9b1e-82c9fb3ba58d/jobs/1064226

PR Close #43730
2021-10-06 09:23:59 -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
a3cd40160e test: temporarily disable ng_update_migrations integration test (#43431)
Temporarily disables the ng_update_migrations integration test
until https://github.com/angular/angular/pull/43657 lands.

PR Close #43431
2021-10-01 18:28:47 +00:00
Paul Gschwendtner
ce7fabebc2 build: simplify logic for integration test starlark macro (#43431)
Simplifies the `last_segment_name` computation in the integration
test Starlark macro we use. The last segment name could be computed
in a shorter way and this has come up while being at it (through review;
so this commit addresses that).

PR Close #43431
2021-10-01 18:28:46 +00:00
Paul Gschwendtner
463663be07 test: disable bazel integration test temporarily due to APF v13 (#43431)
Temporarily disables the Bazel integration test as it will not
work with the APF v13 output which is strict ESM. We need to
land some logic in `rules_nodejs` first that would allow an
ESM variant of `@angular/compiler-cli` to work.

Once this happened and there is a new release, we can re-enable
the test and make adjustments for v13 APF (i.e. running the linker
plugin when creating the rollup bundles).

PR Close #43431
2021-10-01 18:28:46 +00:00
Paul Gschwendtner
46933d8c87 test: update hello_world_closure integration test to use APF v13 (#43431)
Updates the `hello_world_closure` integration test to use APF v13
in combination with the linker plugin which is needed as running
the `ngc` command standalone does not modify the `node_modules`
and the FW packages remain partially compiled. A step in between
using rollup can create a linker-processed bundle of all FW
packages.

PR Close #43431
2021-10-01 18:28:46 +00:00
Paul Gschwendtner
6e4821f06c test: update ng_elements integration test to run with APF v13 (#43431)
Updates the `ng_elements` integration test to work with the APF
v13 format by also enabling the linker for the FW packages.

PR Close #43431
2021-10-01 18:28:46 +00:00
Paul Gschwendtner
e6710b0bbd test: update dynamic-compiler test to be compatible with APF v13 (#43431)
Updates the dynamic-compiler test to be compatible with the APF v13.
As of v13, the packages no longer come with metadata.json files and
now need to be processed with the babel linker plugin. This commit
sets up the linker plugin, and switches away from the deprecated
systemjs approach to a simpler rollup code-splitting variant.

PR Close #43431
2021-10-01 18:28:46 +00:00
Paul Gschwendtner
d442764470 refactor(compiler-cli): adjust lock file resolution in ngcc to work with ESM (#43431)
Updates the lock file resolution logic in ngcc to work with ESM output.
The compiler-cli is now shipped in bundles, so the actual module resolution
needs to stay to keep the lock file path consistent regardless of where the
lock file code is bundled into. The ngcc integration test needs to be updated
though since the `ngcc` entry-point will always reside in the `bundles/` directory
now.

It has been considered using the top-level `package.json` of the compiler-cli
package, but that caused problems in tests down the line because the ngcc
tests only have the `@angular/compiler-cli/ngcc/...` targets linked into
the node modules. It's not worth changing this and reworking tests if ngcc
is going away in the future anyway (+ it has been like that before!).

PR Close #43431
2021-10-01 18:28:45 +00:00
Paul Gschwendtner
634e6662c6 test: update bazel integration test to use linker for v13 APF (#43431)
As of v13, the package output will be using partial compilation output.
This breaks the Bazel setup similar to how it breaks Angular Components.
The problem is that `@bazel/concatjs` relies heavily on the UMD files
that previously existed in APF, plus it assumed that ngcc pre-processed
the files in the `node_modules`. This is no longer the case as there are
no UMD files, and the code is not fully-compiled by the Angular
compiler.

PR Close #43431
2021-10-01 18:28:45 +00:00
Paul Gschwendtner
4b142c4ead test: remove hello world SystemJS UMD integration test (#43431)
Given that Angular no longer ships UMD bundles as of v13, the
hello world SystemJS integration test cannot work.

PR Close #43431
2021-10-01 18:28:44 +00:00
Paul Gschwendtner
ab390e49ac test: update i18n integration test to use Ivy (#43431)
Updates the i18n integration test to use Ivy in order to
work with the new Angular v13 package format.

PR Close #43431
2021-10-01 18:28:44 +00:00
Paul Gschwendtner
859ca504f8 test: run platform-server integration test with v13 partial compilation packages (#43431)
Updates the platform-server integration test to rely on the v13 partial
compilation packages. This involves setting up the Babel linker plugin.
This is a great addition for coverage of the Babel linker plugin.

PR Close #43431
2021-10-01 18:28:44 +00:00
Paul Gschwendtner
15919fb70c test: fix rxjs v7 integration test accidentally running with rxjs v6 (#43431)
This just came up while working on an integration test that also
relies on RxJS v7. It looks like the RxJS package has not been pinned
for the v7 test, so that the test actually always ran v6 by accident.
This commit fixes that.

PR Close #43431
2021-10-01 18:28:43 +00:00
Paul Gschwendtner
a274de088a build: make bazel integrations compatible with windows (#43431)
The bazel integration tests are currently not compatible with Windows.
Tests never get to run because the created tar packages for NPM packages
are built using an outdated `pkg_tar` rule that creates invalid
tarballs. We fix this by using the non-deprecated windows-compatible
`rules_pkg` implementation.

Additionally, we copy all `package.json` files of integration tests to
the bazel bin directory as otherwise the file would be accidentally
modified as a source on Windows.

PR Close #43431
2021-10-01 18:28:43 +00:00
Paul Gschwendtner
a47794272b test: update basic integration tests to work with new package output (#43431)
Basic integration tests are those which do not require significant
changes as others. The larger ones will have individual commits.

For v13, the NPM package output will always be using partial compilation
output. This makes the ngcc integration test fail because the actual
Angular framework packages are no longer processable. We fix this, and
keep the ngcc test coverage by relying on the v12.x framework packages
in the integration test.

The terser integration test needs to point to the new Flat ESM module
file location. We now output FESM2020 instead of FESM2015. This also
requires us to use the latest version of terser.

The `side-effects` test currently is not maintained by us and relies
on View Engine build output. In the partial compilation output the
partial declarations are not marked with `@PURE` and are not removed
therefore. We would need to update the side-effect test to use the
linker Babel plugin instead. This is currently out-of-scope though
so we disable the test for now.

PR Close #43431
2021-10-01 18:28:43 +00:00
Paul Gschwendtner
e6046c9420 refactor: remove entry_point attribute from ng_package targets (#43431)
With the changes to support APF v13 in the `ng_package` rule, we have
removed the ambiguous `entry_point` attribute. The attribute suggested
that it would be used for determining the primary entry-point input
file. This was not the case as the flat module output file is consulted
for bundling et at. The attribute has been renamed to match its
purposed (renamed to `primary_bundle_name`).

We no longer need to set that attribute because the primary bundle
name is (1) not of relevance for consumers and (2) the rule already
infers the bundle name properly from the Bazel package.

PR Close #43431
2021-10-01 18:28:42 +00:00
Paul Gschwendtner
831ede8bf4 build: update bazel setup to latest dev-infra package and rules_nodejs v4.2.0 (#43431)
Updates the Bazel setup to the latest shared dev-infra package. Also the
rules_nodejs version is updated to v4.2.0. We have landed various
changes that prepare us for the APF v13 implementation. e.g.

* Ability to control the linker mappings for the `ng_package` rule. This
will become important for using a transition that could accidentally
cause linker mappings that would otheriwse conflict.
* Use of latest version of rollup & terser in the Bazel rules the
  dev-infra package exposes. This is necessary for ES2020 support.

PR Close #43431
2021-10-01 18:28:41 +00:00
Renovate Bot
d9b76e4b3d build: update all non-major dependencies (#43411)
PR Close #43411
2021-10-01 12:27:25 -04:00
Alan Agius
c231849f72 test: update localize-extract source paths (#43417)
As a result of dropping differential loading, In version 13 the Angular CLI no longer generates files prefixed with the ECMA version.

PR Close #43417
2021-09-24 10:49:39 -07:00
Alan Agius
dcacf3a09b test: update remove deprecated builder options from Angular workspace (#43417)
`extractCss` option has been removed without replacement.

PR Close #43417
2021-09-24 10:49:39 -07:00
Alan Agius
eb50266b3a test: update browserslist configuration to replace Angular CLI projects (#43417)
With this change we update various browserslist configuration file to match newly generated projects. https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/application/files/.browserslistrc.template

PR Close #43417
2021-09-24 10:49:39 -07: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
Paul Gschwendtner
9b2732c0ed build: update bazel setup to latest versions (#43322)
Updates the overall Bazel setup to their latest versions:

* rules_nodejs is updated to stable 4.0.0
* rules_sass is updated to the latest version containing a fix
  for the `@bazel/worker` bug we had a workaround for.
* dev-infra-private is updated to avoid duplicated dependencies.
  We should use a version that also relies on stable rules_nodejs v4.

Note: We are not set on how dependencies for the `bazel/` folder
of the dev-infra package are managed, but we removed `@types/`
packages from the transitive dependencies, so we now need to
manually include `@types/uuid` for building the benchmark driver
utilties. We need to revisit this in the future.

PR Close #43322
2021-09-02 21:18:36 +00:00