Commit graph

826 commits

Author SHA1 Message Date
Kristiyan Kostadinov
85b5d125be build: fix rxjs 7 build failure (#47548)
Fixes that the `node` typings weren't included in the rxjs 7 typings test.

PR Close #47548
2022-09-26 13:43:19 -07:00
Angular Robot
ebc0135239 build: update all non-major dependencies (#47415)
See associated pull request for more information.

PR Close #47415
2022-09-13 09:19:51 -07:00
Alan Agius
16f96eeabf refactor(compiler-cli): remove enableIvy options (#47346)
This option has no longer any effect as Ivy is the only rendering engine.

BREAKING CHANGE: Angular compiler option `enableIvy` has been removed as Ivy is the only rendering engine.

PR Close #47346
2022-09-06 11:33:48 -07:00
Angular Robot
4cafd08866 build: update all non-major dependencies (#47225)
See associated pull request for more information.

PR Close #47225
2022-09-06 09:53:29 -07:00
Kristiyan Kostadinov
7d3df4724d build: update to TypeScript 4.8 final (#47270)
Bumps up to the final version of TS 4.8 and removes some workarounds.

PR Close #47270
2022-08-26 09:46:07 -07:00
Angular Robot
c467eb78d9 build: update all non-major dependencies (#47162)
See associated pull request for more information.

PR Close #47162
2022-08-22 10:29:21 -07: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
Andrew Scott
75df404467 feat(router): Create APIs for using Router without RouterModule (#47010)
This commit creates and exposes the APIs required to use the Angular Router without importing `RouterModule`.

The newly added APIs are tree-shakable and you can add features using special functions rather than using `ExtraOptions` to control the providers via an internal switch in Router code.

```
const appRoutes: Routes = [];
bootstrapApplication(AppComponent,
  {
    providers: [
      provideRouter(appRoutes,
        withDebugTracing(),     // enables debug tracing feature
        withInMemoryScrolling() // enables scrolling feature
    ]
  }
);
```

This "features" pattern allows for router behavior to evolve in a backwards compatible and tree-shakable way in the future. This approach also makes features more discoverable.

The newly added APIs can be used in any application today (doesn't require an application to be bootstrapped using standalone-based APIs).

Note: APIs added in this commit are released in the "Developer Preview" mode, read more about this mode in Angular docs: https://angular.io/guide/releases#developer-preview

PR Close #47010
2022-08-15 15:58:00 -07:00
Angular Robot
ab9ce8a008 build: update all non-major dependencies (#46707)
See associated pull request for more information.

PR Close #46707
2022-08-08 09:23:56 -07:00
Paul Gschwendtner
b757b1387c build: update dev-infra packages and account for build-tooling split from ng-dev (#46976)
The dev-infra build tooling is now decoupled from `ng-dev`. This will
make it easier to update `ng-dev` without necessarily needing to upgrade
the whole build system, Bazel etc. This is useful when e.g. new release
tool features have been added and should also be ported to active LTS
branches.

PR Close #46976
2022-08-02 09:37:37 -07:00
Andrew Kushnir
07606e3181 feat(platform-browser): add isEmpty method to the TransferState class (#46915)
This commit adds the `isEmpty` method to the `TransferState` class to make it possible to check whether the state is empty or not. This is helpful in situations when the `TransferState` should be serialized and the content is transferred to the client (if the state is empty - certain operations can be omitted).

PR Close #46915
2022-07-22 09:17:47 +00:00
Paul Gschwendtner
7b9269c5e4 build: account for integration test rule change (#46778)
The integration test rule now always executes tests in a directory
outside of the execroot. This ensures a more hermetic test environment
on platforms without a sandbox, or when tests are run with `tags:
local`.

As part of this change, an issue with Yarn 1.x. and `nodejs_binary`
unveiled. Yarn 1.x. is resolved properly using the tool mapping but
when Yarn inside Yarn is invoked (e.g. using `package.json` scripts),
then the second nested Yarn invocation fails due to an unknown path.

This happens because Yarn in the original invocation creates another
directory in the `/tmp` directory and modifies the `PATH` so that
the same `yarn` can be invoked again. This makes sense conceptually
but breaks in our case because the Yarn Bash script put into the `/tmp`
directory tries to resolve our vendored Yarn script relatively (which
is the wrong spot here). It worked previously in the execroot because
`nodejs_binary` invoked Yarn through `<external>/../node.sh
<absolute-path-to-yarn-cjs-script>`, but outside the execroot it invoked
Yarn using a relative path (which then ended up being preserved in the
Yarn temporary directory).

We can fix this by updating the Bazel NodeJS repository which seems to
have coincidentally have a fix for the path resolution. See:

https://github.com/bazelbuild/rules_nodejs/pull/3493#event-6870301735.

PR Close #46778
2022-07-11 20:55:30 +00:00
Paul Gschwendtner
36690c69de test: update cli-hello-world-ivy-i18n integration test to use ng extract-i18n (#46642)
The integration test currently uses the old command alias that has been
removed with Angular v14.

b69ca3a7d2

PR Close #46642
2022-07-01 10:20:51 -07:00
Alex Rickabaugh
aa49f70565 test(core): remove CLI integration test that uses renderComponent (#46568)
This commit removes an integration test for an application, built with the
CLI, that uses the `renderComponent` experimental bootstrapping function. An
equivalent test already exists for the regular bootstrapping code path. As
`renderComponent` is no longer supported, this test is redundant and can be
removed.

PR Close #46568
2022-06-28 21:42:45 -07:00
Alex Rickabaugh
fac2c5893e test(ngcc): switch ngcc integration test to regular bootstrap (#46568)
The ngcc integration test application doesn't actually run, but was coded to
use the experimental `renderComponent` bootstrapping function. This commit
switches it to use the regular, `@angular/platform-browser` based bootstrap
instead.

PR Close #46568
2022-06-28 21:42:45 -07:00
Alan Agius
4e8957eb40 test: replace --prod with --configuration production (#46548)
In Angular CLI version 14, the deprecated `--prod` option has been removed.

This is needed to land https://github.com/angular/angular/pull/46545

PR Close #46548
2022-06-28 09:39:05 -07:00
Paul Gschwendtner
d248d83c17 build: convert release package build scripts to typescript (#46456)
Follow-up to: cce395a928.

PR Close #46456
2022-06-22 14:35:31 -07:00
Andrew Kushnir
a623c4f622 test: drop no longer needed postinstall step from integration test apps (#46182)
This commit removed no longer needed postinstall step (to run ngcc) from integration test apps, to avoid extra processing.

PR Close #46182
2022-05-31 12:06:16 -07:00
Kristiyan Kostadinov
1cc158375b build: update to TypeScript 4.7 final (#46132)
Bumps up the repo to the final version of TypeScript 4.7. Also updates AIO to 4.7.

PR Close #46132
2022-05-25 11:37:12 -07:00
Kristiyan Kostadinov
4f309fed02 build: update to TypeScript 4.7 RC (#45966)
Bumps up the repo to the RC version of TypeScript 4.7.

PR Close #45966
2022-05-13 09:36:46 -07:00
Andrew Kushnir
3165fa3f4e perf(platform-browser): avoid including Testability by default in bootstrapApplication (#45885)
The Testability-related logic was refactored in https://github.com/angular/angular/pull/45657 to become tree-shaking-friendly: it was decoupled from the core providers of the `BrowserModule`. This commit updates the newly-introduced `bootstrapApplication` function to exclude Testability-providers by default (note: the Testability is still included in the NgModule-based bootstrap).

In order to add the Testability to the app bootstrapped via `bootstrapApplication`, the `provideProtractorTestingSupport` function is introduced.

PR Close #45885
2022-05-10 13:34:28 -07:00
Paul Gschwendtner
68a6a075f4 build: clean up references to old master branch (#45856)
Cleans up all references to the `master` branch we renamed to
`main` across Angular.

PR Close #45856
2022-05-04 16:23:33 -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
Andrew Kushnir
3e46a426c4 test(core): add integration test apps for the bootstrapApplication API (#45674)
This commit adds 2 integration apps to verify the `bootstrapApplication` API behavior as well as keep track of the bundle size and retained symbols (tree-shaking).

PR Close #45674
2022-04-21 17:47:54 -07:00
Alex Rickabaugh
80d2cdab8b test: set skipLibCheck on ngcc integration test (#45672)
The ngcc integration test is in an awkward state: it's attempting to test
that the current ngcc can process @angular/core at v12. We need to make a
forwards-incompatible change to the typings of @angular/core, which means
that the compiled typings from the current ngcc won't be compatible with
core as of v12.

To get around this and allow the integration test to have some value, we're
disabling library checking for the time being.

PR Close #45672
2022-04-20 05:45:57 -07:00
Alex Rickabaugh
1527e8f4c0 refactor(core): change component emit to 'dependencies' (#45672)
Previously, the compiler would represent template dependencies of a
component in its component definition through separate fields (`directives`,
`pipes`).

This commit refactors the compiler/runtime interface to use a single field
(`dependencies`). The runtime component definition object still has separate
`directiveDefs` and `pipeDefs`, which are calculated from the `dependencies`
when the definition is evaluated.

This change is also reflected in partially compiled declarations. To ensure
compatibility with partially compiled code already on NPM, the linker
will still honor the old form of declaration (with separate fields).

PR Close #45672
2022-04-20 05:45:56 -07:00
Paul Gschwendtner
0facba5b70 build: update bazel integration test to RNJ v5.4.0 and Sass 1.50.0 (#45470)
Updates Bazel integration to RNJ v5.4.0. This is needed since it relies
on Angular Bazel which now relies on an internal pkg_npm helper breaking
change.

PR Close #45470
2022-04-11 21:01:09 +00:00
Paul Gschwendtner
31434943f1 build: disable payload size uploading within bazel (#45446)
Uploading payload size is unreliable from within Bazel. This is
because tests might not run for every commit, tests might have
been cached from a pull request RBE-build (causing payload uploading
to be skipped most of the time as every change comes from a PR)

We should disable the uploading as this is a fundamental problem
(good thing to note now) that we can solve with better payload
size tracking that we want to establish as part of dev-infra.

PR Close #45446
2022-03-25 16:50:09 -07:00
Paul Gschwendtner
af303d98db refactor: remove unused variables in starlark code to satisfy buildifier (#45431)
We updated buildifier and a few warnings became errors now. This commit
cleans up the failing unused variable instances, making the linter happy.

Additionally for the API extractor BUILD file, the package defaults
need to move to satisfy buildifier.

PR Close #45431
2022-03-25 12:18:34 -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
Renovate Bot
010a39f856 build: update bazel (#45431)
Update `@bazel` packages to the latest 5.x version.

Some of the changes here are modeled after
angular/dev-infra@40c0ac8559.

Co-Authored-By: George Kalpakas <kalpakas.g@gmail.com>

PR Close #45431
2022-03-25 12:18:33 -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
5ff459e700 test: remove defaultProject workspace option (#45410)
The `defaultProject` workspace option has been deprecated. The project to use will be determined from the current working directory.

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

PR Close #45410
2022-03-24 10:49:57 -07: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
JoostK
ca5603b09b fix(localize): avoid imports into compiler-cli package (#45180)
The compiler-cli's declaration files are not necessarily compatible with web
environments that use `@angular/localize`, and would inadvertently include
`typescript` declaration files in any compilation unit that uses
`@angular/localize` (which increases parsing time and memory usage during
builds) using a default import that only type-checks when
`allowSyntheticDefaultImports` is enabled.

Fixes #45179

PR Close #45180
2022-02-24 17:12:10 +00:00
JiaLiPassion
ee381dadc2 test(zone.js): add integration test for zone.js Mocha patch (#45047)
Add integration test for `Mocha` patch from `zone.js` to verify the
issue #42384 is fixed

PR Close #45047
2022-02-16 13:51:51 -08:00
Andrew Kushnir
64acbc4242 refactor(core): drop all .ngfactory and .ngsummary imports (#44957)
This commit updates various places in the repo (mostly tests/examples) to drop all `.ngfactory` and `.ngsummary` imports as they are no longer needed in Ivy.

PR Close #44957
2022-02-07 15:31:49 -08:00
Jessica Janiuk
112a6cdec3 test(animations): Add bundling size regression test for animations package (#44826)
This adds a size regression test for the animations package to the test suite.

PR Close #44826
2022-01-26 12:54:36 -08:00
Kristiyan Kostadinov
359103274b test: clean up more entryComponents usages (#44561)
Cleans up some more tests that were using `entryComponents`.

PR Close #44561
2022-01-06 18:36:22 +00:00
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