2174 Commits

Author SHA1 Message Date
Alan Agius
019614b9e8 Revert "fix(@angular-devkit/build-angular): ensure Sass worker implementation supports Node.js 12.14"
This reverts commit 4dc7cf952961183abcd201db6a5747a7b22e5953.
2021-08-09 22:10:50 +02:00
Charles Lyding
1e142cd29a refactor(@angular-devkit/build-angular): remove legacy ES5 build optimizer usage
The legacy standalone build optimizer was still used when targetting ES5 due to the new babel-based build optimizer only supporting the analysis of ES2015+ code. Mainly due to the presence of native classes, the new build optimizer is faster and significantly less complex. To fully remove the legacy build optimizer, ES5 downleveling of application code is now also performed by babel when the TypeScript configuration specifies an ES5 target. TypeScript will now internally emit ES2015 in this configuration and ES2015 code will be used as the input to the remainder of the build pipeline. This has been the behavior for third-party packages and now all code will be consistently downleveled to ES5 using the same tooling.
2021-08-09 16:50:49 +02:00
Alan Agius
a7b2e6f512 feat(@schematics/angular): update ngsw-config resources extensions
With this change we update service worker ngsw-config resources extensions.

- Remove `eot`. Old IE font format. Not supported by browsers which support service worker.
- Remove `ani`. Not supported by browsers.
- Add `jpeg` as common alias for `jpg`.
- Add `apng` as modern alternative to `gif`.
- Add `avif` a modern image format.

Closes #21526
2021-08-09 16:50:16 +02:00
Charles Lyding
c4baba4459 refactor(@angular-devkit/build-angular): reduce repeat TypeScript configuration loading
An application's TypeScript configuration was previously being loaded multiple times in several different aspects of the build setup process. These aspects need to access specific compiler options relevant to that particular area of the setup. However, loading the configuration can be expensive due to the process also calculating the root files for the TypeScript compilation which can result in a large amount of file access. To improve the setup performance, the number of times the TypeScript configuration will be loaded has now been reduced with further reductions possible with additional refactorings.
2021-08-09 14:15:13 +02:00
Charles Lyding
3bcb729a33 refactor(@angular-devkit/build-angular): remove unneeded ivy enabled checks
Applications can now only be built with Ivy. However, several checks were still present in the code to determine if Ivy was enabled. Since Ivy is always enabled these checks have since become unused code and can be removed.
2021-08-09 14:15:13 +02:00
Renovate Bot
7098d652f9 build: update all non-major dependencies 2021-08-09 11:29:36 +02:00
Charles Lyding
cdfaeee089 fix(@angular-devkit/build-angular): support both pure annotation forms for static properties
The static property optimization pass analyzes the initializers of static properties for possible side effects to determine if optimization is safe to perform. Previously the pure annotation of the form `@__PURE__` was not considered during the analysis. This has now been corrected and all of the following forms are supported: `@__PURE__`, `#__PURE__`, and `@pureOrBreakMyCode`.
2021-08-06 19:38:11 +02:00
Alan Agius
2aa6f579d7 fix(@angular-devkit/build-angular): do not consume inline sourcemaps when vendor sourcemaps is disabled.
Not removing inline sourcemaps when vendor sourcemaps is disabled causes an issue during the JS optimization sourcemap merging phase.

```
Optimization error [936.cf7797927c7f989bd40d.js]: Error: Transformation map 1 must have exactly one source file.
```

When vendor sourcemaps is disabled we are not interested into the said sourcemaps so now we remove the inline sourcemap.

Closes #21508
2021-08-06 15:46:50 +02:00
Charles Lyding
167eed4654 fix(@angular-devkit/build-angular): update Angular peer dependencies to v13.0 prerelease 2021-08-06 08:12:06 +02:00
Alan Agius
7dcfffafff feat(@angular-devkit/build-angular): drop support for karma-coverage-instanbul-reporter
BREAKING CHANGE:

Support for `karma-coverage-instanbul-reporter` has been dropped in favor of the official karma coverage plugin `karma-coverage`.
2021-08-05 22:02:10 +02:00
Charles Lyding
f5d019f9d6 fix(@angular-devkit/build-angular): avoid attempting to optimize copied JavaScript assets
When in watch mode (`ng serve`/`ng build --watch`), Webpack's `copy-webpack-plugin` is currently used to implement the project `assets` option within `angular.json`. Files specified by the `assets` option are intended to be copied to the output unmodified and in their original form.  However, if any JavaScript assets were present they previously would have been unintentionally subject to their respective optimization plugins which would result in modified asset outputs and the potential for breakage of the assets. `ng build` outside of watch mode uses a direct file copy with copy-on-write (where supported) to process assets and is therefore not affected by this situation.
When the `copy-webpack-plugin` is used, it adds a `copied` flag to an asset's info metadata. This flag is now used to exclude all such copied JavaScript assets from optimization.
2021-08-05 18:42:39 +02:00
Charles Lyding
8499cfe1d4 test(@angular-devkit/build-angular): properly discover Bazel units tests
The unit tests for builders are now within the `src/builders/...` path.
2021-08-05 18:41:58 +02:00
Alan Agius
8758e4415d fix(@angular-devkit/build-angular): handle null maps in JavaScript optimizer worker
`asset.map` can be `null` which causes an unhandled exception.

```
Error: Optimization error [generated/js/custom-elements-es5-polyfills.js]: TypeError: Cannot destructure property 'mappings' of 'map' as it is null.
    at decodeSourceMap (/angular/aio/node_modules/@ampproject/remapping/dist/remapping.umd.js:178:15)
    at Array.map (<anonymous>)
    at buildSourceMapTree (/angular/aio/node_modules/@ampproject/remapping/dist/remapping.umd.js:725:37)
    at Object.remapping [as default] (/angular/aio/node_modules/@ampproject/remapping/dist/remapping.umd.js:831:23)
    at default_1 (/angular/aio/node_modules/@angular-devkit/build-angular/src/webpack/plugins/javascript-optimizer-worker.js:44:44)
```

AIO CI failure: https://app.circleci.com/pipelines/github/angular/angular/35940/workflows/c9c91ad3-1645-4a88-bb5b-6a06a9b887b9/jobs/1032993
2021-08-05 16:26:06 +02:00
Renovate Bot
aedbc2d49b build: update dependency esbuild to v0.12.18 2021-08-05 08:34:27 +02:00
Alan Agius
f53bf9dc21 feat(@angular-devkit/build-angular): add type=module to all scripts tags
With this change we add `type=module` to all script tags. This is now possible since IE is no longer supported.

More information about modules can be found here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
2021-08-05 08:34:13 +02:00
Renovate Bot
86dd832828 build: update all non-major dependencies 2021-08-05 08:03:51 +02:00
Charles Lyding
0afdff028c refactor(@angular-devkit/build-angular): move all builders into a builders subdirectory
All Angular builders are now located within one subdirectory of the `src` directory. This organization provides better discovery of the builders and will allow builder specific code to be stored in a single area.
2021-08-05 06:49:55 +02:00
Charles Lyding
f0987ee088 refactor(@angular-devkit/build-angular): remove unused rxjs version discovery
In the Angular version check, the rxjs version was acquired by resolving and reading the rxjs package's package.json file. However, the rxjs version checks were removed in a previous major.
2021-08-05 06:48:55 +02:00
Charles Lyding
a2bc175dbf refactor(@angular-devkit/build-angular): remove Webpack loader resolve custom setting
The Webpack configuration setup previously walked up the directory structure to find all `node_modules` directories and then pass this list to Webpack's `resolverLoader.modules` option. This was previously done to ensure that hoisted packages were properly resolved. However, all loader paths are now fully resolved prior to being added to the Webpack configuration. Since loader paths will now be absolute, Webpack no longer needs to resolve them which makes the resolve settings no longer necessary.
2021-08-05 06:48:55 +02:00
Charles Lyding
734d61df3f refactor(@angular-devkit/build-angular): remove empty.js Webpack alias file
Webpack 5 supports setting a module's alias to `false` to signify that a module should be ignored. This option removes the need for the `empty.js` file as an alias option value.
2021-08-05 06:48:55 +02:00
Charles Lyding
28f302855f refactor(@angular-devkit/build-angular): remove Node.js 10 copyfile workaround
The workaround code was gated on the presence of Node.js 10 but the CLI no longer supports Node.js 10 and will execute with an error if attempted. As a result, the workaround code would never be executed.
2021-08-05 06:48:55 +02:00
Alan Agius
20e48a33c1 feat(@angular-devkit/build-angular): remove deprecated options
BREAKING CHANGE:

With this change we removed several deprecated builder options
- `extractCss` has been removed from the browser builder. CSS is now always extracted.
- `servePathDefaultWarning` and `hmrWarning` have been removed from the dev-server builder. These options had no effect.
2021-08-03 15:07:04 +01:00
Charles Lyding
3e80b8841f test(@angular-devkit/build-angular): remove unused tslint builder tests
The tslint builder has been removed and these tests are no longer executed.
2021-08-03 11:07:32 +01:00
Charles Lyding
7576136b2f feat(@angular-devkit/build-angular): remove automatic inclusion of ES5 browser polyfills
BREAKING CHANGE:
The automatic inclusion of Angular-required ES2015 polyfills to support ES5 browsers has been removed. Previously when targetting ES5 within the application's TypeScript configuration or listing an ES5 requiring browser in the browserslist file, Angular-required polyfills were included in the built application. However, with Angular no longer supporting IE11, there are now no browsers officially supported by Angular that would require these polyfills. As a result, the automatic inclusion of these ES2015 polyfills has been removed. Any polyfills manually added to an application's code are not affected by this change.
2021-08-03 11:07:16 +01:00
Renovate Bot
5a46ff3fbc build: update all non-major dependencies 2021-08-02 17:02:31 +01:00
Charles Lyding
701214d174 feat(@angular-devkit/build-angular): remove differential loading support
BREAKING CHANGE:
Differential loading support has been removed. With Angular no longer supporting IE11, there are now no browsers officially supported by Angular that require ES5 code. As a result, differential loading's functionality for creating and conditionally loading ES5 and ES2015+ variants of an application is no longer required.
2021-08-02 16:59:48 +01:00
Alan Agius
e78f6ab5d8 feat(@angular-devkit/build-angular): remove deprecated tslint builder
BREAKING CHANGE:

Deprecated `@angular-devkit/build-angular:tslint` builder has been removed. Use https://github.com/angular-eslint/angular-eslint instead.
2021-08-02 16:57:56 +01:00
Alan Agius
e82eef924e refactor(@angular-devkit/build-angular): remove WOFF handling from inline-fonts processor
BREAKING CHANGE:

We remove inlining of Google fonts in WOFF format since IE 11 is no longer supported. Other supported browsers use WOFF2.
2021-07-30 14:27:07 +01:00
Alan Agius
ac3fc2752f feat(@angular-devkit/build-angular): drop support for node-sass
BREAKING CHANGE:

Support for `node-sass` has been removed. `sass` will be used by default to compile SASS and SCSS files.
2021-07-30 14:26:39 +01:00
Charles Lyding
bd9e3905b5 refactor(@angular-devkit/build-angular): remove unused code in webpack configuration partials
Several unused imports and variables as well as redundant conditional checks were removed from the Webpack configuration partials.
2021-07-30 12:44:55 +01:00
Alan Agius
0346d6953e refactor: move testy-utils under testing folder
This is so that it is easier to exlude this when globbing.
2021-07-30 12:43:18 +01:00
Alan Agius
8ea82e593c build: add tsconfig-build.json
This TypeScript configuration file is used to build the monorepo. This will only include actual sourcefiles ie. non test files.
2021-07-30 12:43:18 +01:00
Alan Agius
c1efaa17fe fix(@angular-devkit/build-angular): calculate valid Angular versions from peerDependencies
With this change we update the `assertCompatibleAngularVersion` logic to use `peerDependencies` on `@angular/compiler-cli` listed in the `package.json` to determine if the installed Angular version is supported or not.

This is a fix for:
https://github.com/angular/angular-cli/pull/21449
https://circleci.com/gh/angular/angular-cli/259835?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
2021-07-30 12:42:10 +01:00
Renovate Bot
edaa4c007a build: update all non-major dependencies 2021-07-30 12:39:46 +01:00
Renovate Bot
7e3a6227c1 build: update dependency webpack to v5.47.0 2021-07-28 11:27:39 -04:00
originalfrostig
d750c686fd fix(@angular-devkit/build-angular): add priority to copy-webpack-plugin patterns 2021-07-28 11:27:00 -04:00
Alan Agius
6153530220 fix(@angular-devkit/build-webpack): emit result when webpack is closed
With this change we emit the compilation result when the compilation is closed, when the compilation is not in watch mode.

This is needed so that when persistent caching is enabled and architect promise API is used (`.result`) instead of `.output` we wait for the cache to be written prior to terminating the process/resolving the result promise.

The `result` API currently, takes the first emit 4f9df9f4a4/packages/angular_devkit/architect/src/schedule-by-name.ts (L118-L120)

Closes #21419
2021-07-27 12:15:02 -04:00
Renovate Bot
1e9be09bfa build: update all non-major dependencies 2021-07-26 10:23:20 -04:00
Renovate Bot
0eb271ed5f build: update dependency regenerator-runtime to v0.13.9 2021-07-23 10:10:06 -04:00
Renovate Bot
734e396b14 build: update all non-major dependencies 2021-07-22 12:31:52 -04:00
Alan Agius
8bea912724 build: update angular dependencies to 12.2.0-next.3 2021-07-22 11:51:51 -04:00
Charles Lyding
1cb07caddc build: transition from ts-api-guardian to dev-infra api-golden utility
The dev-infra tooling now directly provides public API change testing capabilities that leverage the `api-extractor` utility. These new testing capabilities are shared with framework and components.
`ts-api-guardian` has been removed as a dependency as a result.
2021-07-21 14:55:18 -07:00
Charles Lyding
4bcd1dc9ee fix(@angular-devkit/build-angular): allow classes with pure annotated static properties to be optimized
When script optimizations are enabled, classes containing downlevelled static properties are wrapped in a pure annotated IIFE to allow the class to be removed if it is otherwise unused. Only properties with initializer values that do not have the potential for side effects can be safely wrapped. Previously, pure annotations were not considered when analyzing the values and this caused classes to be retained that could be considered safe for removal. To resolve this issue, pure annotations are now considered when analyzing a property's initializer value for potential side effects.
2021-07-21 14:54:57 -07:00
Renovate Bot
33ec9d6ec3 build: update all non-major dependencies 2021-07-21 11:57:17 +02:00
Renovate Bot
cd3eb98d80 build: update all non-major dependencies 2021-07-20 08:46:06 +02:00
LeonEck
ceade0c27e fix(@angular-devkit/build-angular): dasherize disable-host-check suggestion
Camel case arguments have been deprecated and therefore shouldn't be suggested.
2021-07-19 07:06:51 +02:00
Renovate Bot
cb1db78f12 build: update all non-major dependencies 2021-07-19 07:05:44 +02:00
Renovate Bot
577dcfa618 build: update dependency css-loader to v6 2021-07-15 14:49:23 +02:00
Renovate Bot
a155bc5467 build: update all non-major dependencies 2021-07-14 13:57:01 -07:00
Alan Agius
1be3b07836 fix(@angular-devkit/build-angular): exclude outputPath from persistent build cache key
With this change we exclude `outputPath` from cache key due to i18n extraction which causes it to change on every build 736a5f89de/packages/angular_devkit/build_angular/src/utils/i18n-options.ts (L264-L265)

Closes #21275
2021-07-14 13:13:37 -07:00