9532 Commits

Author SHA1 Message Date
Doug Parker
f22e2a5ada refactor(@angular/cli): update analytics prompt copy
Swapping `anonymous` for `pseudonymous` to align with privacy communication guidelines.

(cherry picked from commit da271addf04832da5176f6a30894b31e49ca86c4)
2022-08-22 16:04:14 -07:00
Jason Bedard
6bdcf85bc4 build: prevent busting bazel analysis cache between build and test
(cherry picked from commit 4fa09c160cdf31905de133ecfc4d671c7751bd06)
2022-08-22 16:02:19 -07:00
Alan Agius
076c833981 fix(@angular-devkit/build-angular): correctly handle parenthesis in url
PR #23691 introduced a regression that caused paranthesis in url not to be handled correctly.

This change correct this behaviour and adds a test case to valid this.

Closes #23773

(cherry picked from commit 147f8c3ebbad883826da1a94f09054938ed9b534)
2022-08-22 16:01:17 -07:00
Alan Agius
4a15b47202 release: cut the v14.1.3 release 14.1.3 2022-08-17 12:09:29 +02:00
Alan Agius
11f4e0b5ae docs: typo in cache command long description
(cherry picked from commit 37422da4f2588a864ec2de06d0b373fcf2296a9c)
2022-08-12 08:20:45 -04:00
Alan Agius
7b60e038ad ci: re add test-browsers step
This was deleted by mistake

(cherry picked from commit 18396f6ee75980c75ef195a073870f9a8c665be2)
2022-08-11 16:01:47 -04:00
Charles Lyding
c63501d50a refactor(@angular-devkit/core): remove deprecated rxjs empty function usage
The RxJS `empty` function is deprecated and will be removed in future versions.
The `EMPTY` constant is the recommended replacement.

(cherry picked from commit ddf1257d14f8b52c441c0df8c8dc10510a25f94f)
2022-08-11 13:00:50 -04:00
AgentEnder
365035cb37 fix(@angular-devkit/core): update workspace extension warning to use correct phrasing
(cherry picked from commit db17eac2517e32c3d147ca9e191871b92e6e7888)
2022-08-11 11:56:14 -04:00
Jason Bedard
ea91854e6d test: ensure test assets are writable when copied for use in e2e tests
(cherry picked from commit 22a3251099533164d2907ea5b37129cc7a1fcb53)
2022-08-11 11:27:43 -04:00
Jason Bedard
0cc5b4d2a1 test: add missing yargs config
(cherry picked from commit 187ab7df589d0add98ec0eb9fc453dc897a9156b)
2022-08-11 11:25:43 -04:00
Charles Lyding
9af545a2f9 release: cut the v14.1.2 release 14.1.2 2022-08-10 15:46:06 -04:00
Alan Agius
3e19c842cc fix(@angular-devkit/build-angular): avoid collect stats from chunks with no files
This commit updates to bundle stats logic to skip checking chunks with no files.

Closes #23717

(cherry picked from commit 7de9b470cb54d974027a8baf88b611585fc526c7)
2022-08-10 09:55:20 -04:00
Jason Bedard
a37f0a5791 test: improve test error message logs
(cherry picked from commit 9171543f06641293cb97d5a801a626a889243db2)
2022-08-09 13:01:29 -04:00
Alan Agius
b53b4e6c46 build: disable UT testing multiple node versions
With this change we disable running UTs on multiple node.js versions. This is mainly an interim solution until we find the root cause of the memory increase and OOM errors during bazel test.

During this change I also noticed that the toolchain was configured incorrectly. Setting the toolchain to use Node.js 16 causes the App-shell tests to fail when used under Bazel. See: https://app.circleci.com/pipelines/github/angular/angular-cli/25009/workflows/4ea86ec8-d1f7-4c91-8810-76f10f8e878c/jobs/325982

(cherry picked from commit 167887d5f1f1c90d62cc92391d8b3b73c5fa6df1)
2022-08-09 13:01:10 -04:00
Charles Lyding
67b3a086fe fix(@angular-devkit/build-angular): process stylesheet resources from url tokens with esbuild browser builder
Stylesheet url tokens (`url(....)`) will now be processed when using the esbuild-based experimental browser
application builder. The paths will be resolved via the bundler's resolution system and then loaded
via the bundler's `file` loader. The functionality is implemented using an esbuild plugin to allow for all
file types to be supported without the need to manually specify each current and future file extension within
the build configuration.
The `externalDependencies` option also applies to the referenced resources. This allows for resource paths
specified with the option to remain unprocessed within the application output. This is useful if the relative
path for the resource does not exist on disk but will be available when the application is deployed.

(cherry picked from commit f474bf532f89a296eb1b47f941998d73c1c51e8a)
2022-08-09 10:41:51 -04:00
Alan Agius
dd47a5e8c5 fix(@ngtools/webpack): elide type only named imports when using emitDecoratorMetadata
With this change we fix an issue where type only named imports were being emitted. As a result webpack failed to resolve such symbols as they don't exist in JavaScript.

Closes #23667

(cherry picked from commit cf9afeec20c035386a081fdeec98c9f26f82692e)
2022-08-05 11:02:09 -07:00
Alan Agius
f41d0a688d build: remove dependency on font-awesome
This dependency is only used to valid that node packages are resolved correctly.

With this change we mock the structure of font-awesome to avoid having to install it.

(cherry picked from commit 173823d772761cc26fd9f8e997e50ecd70c1e969)
2022-08-04 11:26:57 -07:00
Charles Lyding
e6c45c316e perf(@angular-devkit/build-angular): reduce babel transformation in esbuild builder
When using the experimental esbuild-based browser application builder, babel transformation
is now only performed on a file if the file requires the specific transformations enabled
for the build. This has the benefit of removing the need to parse and process files that
will not be affected by the enabled transformations.
From initial testing, this provides a 30% build time improvement for development builds of a
newly generated application and a 10% improvement for production builds.

(cherry picked from commit 3e3dc6962d49cb8e8575146b22d134732cfff39f)
2022-08-04 11:26:18 -07:00
Charles Lyding
38b71bcc0d perf(@angular-devkit/build-angular): use esbuild in esbuild builder to downlevel native async/await
esbuild now allows specifying whether individual JavaScript features should be supported in addition
to specifying the target JavaScript version for the output. This capability is now used to provide
the native async/await downleveling that is required by Zone.js when using the experimental esbuild-
based browser application builder. Since esbuild does not yet support downleveling async iteration
or async generators, Babel is still used when either of these syntax features are detected.

(cherry picked from commit 8f9cee351e5cc7da5a75b1a9b06306bc224e6b56)
2022-08-04 11:26:17 -07:00
Jason Bedard
344ef772e7 test: use common mockHome method
(cherry picked from commit d614a7e04f7e591aebd1bbce8f481a7cca328f09)
2022-08-04 11:25:52 -07:00
Alan Agius
d0a0c597cd fix(@angular-devkit/build-angular): correctly handle data URIs with escaped quotes in stylesheets
Previously, the RegExp didn't correctly handle cases where data URIs had escaped quotes like the below

```css
url("data:image/svg+xml;charset=utf-8,<svg width=/"16/" height=/"15/"></svg>")
```

Closes #23680

(cherry picked from commit 70bc35456aa5b58ce1a0e2440ebb6533c7f5e48b)
2022-08-04 11:25:27 -07:00
Doug Parker
c2ba3f4414 release: cut the v14.1.1 release 14.1.1 2022-08-03 11:24:57 -07:00
Jason Bedard
60acbb6c18 test: run tests on multiple node versions
(cherry picked from commit db5c1fc13c9a4de62657af4598d36ded0abae0f7)
2022-08-03 10:33:48 -07:00
Jason Bedard
88267e6c00 build: enable bazel remote_merkle_tree_cache
(cherry picked from commit 425082bd2d67a98d6600b23e1d11f4c82c27178e)
2022-08-03 10:33:48 -07:00
Charles Lyding
c951b933c5 ci: reduce CircleCI Windows resource class to medium
The large resource class consumes significantly more credits than the medium resource class.

(cherry picked from commit 095bb7fb0d39c3e2a702cd578305bc0b1839f653)
2022-08-02 09:48:47 -07:00
Alan Agius
c984710943 fix(@angular-devkit/build-angular): correctly respond to preflight requests
With this commit, we add a middleware that handles preflight requests as currently responses for this type of requests returning 404.

This is a temporary workaround until this issue is fixed upstream. See: https://github.com/webpack/webpack-dev-server/issues/4180

Closes #23639

(cherry picked from commit b4a1b0f1040970201929362bd1210917962fbcea)
2022-08-02 09:47:54 -07:00
Alan Agius
76539db5db test(@angular-devkit/build-angular): re-write live-reload tests to use new test harness.
With this change we replace the live-reload proxy tests to use the new test harness. This is an effort to reduce the flakiness of these tests.

(cherry picked from commit cdbb48f7b2998dd46bd341dd95cec596b96b8fac)
2022-08-01 11:19:50 -07:00
Jason Bedard
69a36ce3d0 test: add shard and test type/name information to test logging
(cherry picked from commit 7c6a4000fb3d99a2a800ab74c54594f09747dd5e)
2022-07-28 17:24:04 +00:00
Jason Bedard
5e4fa47be2 test: use random e2e test ports (#23541)
* test: use random e2e test ports

* test: use random ng serve ports

(cherry picked from commit 35c43577d5677cb47f0f0e7781195bbf5eabc6f2)
2022-07-28 17:23:44 +00:00
Jason Bedard
df3871a2d1 test: move tempdir creation to util method
(cherry picked from commit acd5ad5ce13d25587fdc2a6b37441b123b375dd5)
2022-07-28 17:23:17 +00:00
Alan Agius
eed54b359d fix(@angular-devkit/build-angular): catch clause variable is not an Error instance
Errors thrown in RxJs are not instanceof Error and therefore the check will always fail.

Closes #23631

(cherry picked from commit 8fd3e9fb3c15c848ac5d5e2ae1ee4b06daa2c957)
2022-07-28 07:46:55 +00:00
Alan Agius
4ee825baca fix(@angular/cli): catch clause variable is not an Error instance
Errors thrown in RxJs are not instanceof Error and therefore the check will always fail.

Closes #23631

(cherry picked from commit 44f918612a43566c7e761cdcbc7fc87f8cc172f9)
2022-07-28 07:46:55 +00:00
Charles Lyding
900f7ba543 refactor(@angular-devkit/core): add allowed extensions options to JSON workspace reader
Adjust the internal `readJsonWorkspace` to allow for future generalization
of the allowed unprefixed extension fields for the workspace and project objects.
Custom fields that start with a one to three lowercase letter prefix are still
allowed in both locations.

(cherry picked from commit fa0404daf4c56277e4b083b2de8448d75cb532a5)
2022-07-28 07:46:31 +00:00
Paul Gschwendtner
0089ec18a0 build: use rbe platform with network from shared dev-infra build tooling
This avoids having to manually declare the `platform`. We specifically
added support for the network platform due to the CLI needs.

The CLI repository should long-term set
`--sandbox_default_allow_network=false` in the `bazelrc` so that
internet access is only granted targets explicitly. We should discourage
reliance on internet as much as possible to help with hermetic tests.
2022-07-27 18:38:23 +02:00
Paul Gschwendtner
652a4af426 build: update dev-infra packages and account for build-tooling split from ng-dev
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.
2022-07-27 18:38:23 +02:00
Jason Bedard
4244da80c2 test: remove exclusion of bazel tests based on manual tag
(cherry picked from commit 9b75c7cb9edc6a251060c01689187144cdcddcac)
2022-07-27 08:01:29 +00:00
Alan Agius
cb0d3fb33f fix(@angular/create): use appropriate package manager to install dependencies
Previously, NPM was always used to install dependencies even when using `yarn create` or `pnpm create`.

Closes #23617

(cherry picked from commit f93de8071f58a176764bfeab5c63bb208c3a6765)
2022-07-22 14:00:59 -04:00
Alan Agius
94b444e4ca fix(@angular-devkit/build-angular): correctly set ngDevMode in esbuilder
During development we should not set `ngDevMode` to `true`, as this is expected to be an object literal.

Closes #23627

(cherry picked from commit aa83feb373e7c7680b92d0d53248f12b703f60e0)
2022-07-22 12:48:41 -04:00
Alan Agius
36da9d7a3e test(@angular-devkit/build-angular): remove invalid project extensions from test projects
This causes logs to be printed during test runs.

(cherry picked from commit c2c4cac13c0ee8788848b90a4530e4741d104cde)
2022-07-22 12:48:26 -04:00
Charles Lyding
ef6da4aad7 fix(@angular-devkit/build-angular): allow the esbuild-based builder to fully resolve global stylesheet packages
The esbuild-based experimental builder will now leverage the bundler to perform resolution of CSS imports.
This allows for more comprehensive resolution including packages which use the `sass` and/or `style` custom
conditions within a `package.json` exports field.

(cherry picked from commit 6a142a22f8f1005f5a40a06a5bba85213f77ce3f)
2022-07-22 10:45:33 -04:00
Alan Agius
83dcfb32f8 fix(@schematics/angular): prevent numbers from class names
With this change we prevent creating classes with invalid characters.

Closes #12868

(cherry picked from commit e995bdad32c0cfb1515ab7091e796b1f2d88bc59)
2022-07-21 19:18:50 -04:00
Alan Agius
44c18082a5 fix(@angular-devkit/core): classify string util should concat string without using a .
`.` is not a valid character in ES6 class names.

Prior to this change `foo.module` before used to be incorrectly classified to `Foo.Module` instead of `FooModule`.

Closes #13824

(cherry picked from commit e63375ea397338b71569d2c849a19e2dec18b273)
2022-07-21 19:18:50 -04:00
Alan Agius
c65e994455 ci: create e2e matrices
With this commit, we create different matrices for our e2e tests. This reduces the duration of the workflow by ~7mins

More information: https://circleci.com/docs/using-matrix-jobs

(cherry picked from commit 0cfea883074846f3cbc17f6ce1d50fdb34a1bdcd)
2022-07-21 12:55:16 -04:00
Alan Agius
fdeb676a1a ci: enable full E2E suit test on Windows for PRs
This commits changes the CI workflow to run all the complete E2E test suit on Windows for PRs.

The also increase the parallelism for Windows tests to 16 to reduce the time taken for this step and removes the requirement for the `build` step before running `e2e-cli-win`.

Based on the current timings, this change will not increase PR CI times.

(cherry picked from commit d40635145504bf2f1fc5224266585e86e541b646)
2022-07-20 16:24:39 -04:00
Charles Lyding
c4b59c8d96 release: cut the v14.1.0 release 14.1.0 2022-07-20 15:37:15 -04:00
Charles Lyding
a8fe4fcc31 fix(@schematics/angular): Allow skipping existing dependencies in E2E schematic
The E2E schematic will now (as it did previously) skip adding dependencies
if they already exist within the `package.json` regardless of the specifier.
This is accomplished with the `existing` option for the `addDependency` rule
which allows defining the behavior for when a dependency already exists.
Currently the two option behaviors are skip and replace with replace being
the default to retain behavior for existing rule usages.

(cherry picked from commit c9b2aa41dac0e296d87a4122ce3af281e59cb7a3)
2022-07-19 13:29:39 -04:00
Alan Agius
cf83bfdeb3 ci: change shell to bash in fail_fast job
Currently fail_fast doesn't work in Windows as the shell is set to Powershell

```
#!powershell.exe -ExecutionPolicy Bypass
curl -X POST --header "Content-Type: application/json" "https://circleci.com/api/v2/workflow/${CIRCLE_WORKFLOW_ID}/cancel?circle-token=${CIRCLE_TOKEN}"

Invoke-WebRequest : A parameter cannot be found that matches parameter name 'X'.
At line:1 char:6
+ curl -X POST --header "Content-Type: application/json" "https://circl ...
+      ~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Exited with code exit status 1
CircleCI received exit code 1
```

(cherry picked from commit 08ce5670d865a9003a42c43ccdcb343907040e7d)
2022-07-19 11:51:30 -04:00
Victor Porof
b5f6d862b9 feat(@angular-devkit/build-angular): Identify third-party sources in sourcemaps
This PR includes a webpack plugin which adds a field to source maps that identifies which sources are vendored or runtime-injected (aka third-party) sources. These will be consumed by Chrome DevTools to automatically ignore-list sources.

When vendor source map processing is enabled, this is interpreted as the developer intending to debug third-party code; in this case, the feature is disabled.

Signed-off-by: Victor Porof <victorporof@chromium.org>
(cherry picked from commit f3087dc4343f0dac26ffd7c633e7dcf3618db2b7)
2022-07-18 15:33:34 -04:00
Derek Cormier
163618e33c build: fix snapshot build package.json substitution
This was relying on undocumented behaviour in copy_to_directory which
now needs to be enabled with a flag.

(cherry picked from commit 58612663b2e9368a82338f396d73ea027d08a041)
2022-07-18 15:30:05 -04:00
Alan Agius
05699987df docs: remove @latest reference from npm init command
NPM doesn't correctly handle version specifier for scoped packages when using the `init` command

See: https://github.com/npm/cli/issues/5175
(cherry picked from commit 467ba5af8278399c1fcf11137644f7c61af8f59c)
2022-07-18 15:29:46 -04:00