673 Commits

Author SHA1 Message Date
Charles Lyding
e55923656c fix(@angular-devkit/build-angular): avoid double build optimizer processing
TypeScript files had the potential to be processed twice by the build optimizer. This did not affect the output code but could lead to longer production build times. The build optimizer is now configured in one centralized location for both TypeScript and JavaScript files. The Webpack configuration partial for TypeScript support is also reduced to one common function for both AOT and JIT as a result.
2021-04-19 20:30:21 +02:00
Alan Agius
0396d0839e build: update angular packages
With this change we also remove the workaround to fix stale reuse program. Which was fixed in https://github.com/angular/angular/pull/41289
2021-04-19 20:27:28 +02:00
Alan Agius
3705483782 test(@angular-devkit/build-angular): remove karma v5.2 E2E
Karma v5.2 is no longer supported in v12.
2021-04-14 16:25:56 -04:00
Renovate Bot
21a5eed825 build: update angular packages 2021-04-14 16:22:14 -04:00
Charles Lyding
bac563e5ee feat(@angular-devkit/build-angular): support specifying stylesheet language for inline component styles
A new build option named `inlineStyleLanguage` has been introduced that will allow a project to define the stylesheet language used in an application's inline component styles. Inline component styles are styles defined via the `styles` property within the Angular `Component` decorator. Both JIT and AOT mode are supported. However, JIT mode requires that inline styles only be string literals (compile-time partial evaluation is not supported in JIT mode). Currently supported language options are: `CSS` (default), `Sass`, `SCSS`, and `Less`. If the option is not specified, `CSS` will be used and enables existing projects to continue to function as expected.
2021-04-14 07:21:11 -04:00
Alan Agius
08753138d3 feat(@angular-devkit/core): update schema validator
With this change we update ajv to version 8

BREAKING CHANGE: support for JSON Schema draft-04 and draft-06 is removed. If you have schemas using the `id` keyword replace them with `$id`. For an interim period we will auto rename any top level `id` keyword to `$id`.

**NB**: This change only effects schematics and builders authors.
2021-04-13 10:51:12 -04:00
Renovate Bot
6fca8d950c build: update angular packages 2021-04-12 20:31:42 -04:00
Charles Lyding
d47b4417d4 feat(@angular-devkit/build-angular): support processing component inline CSS styles
The internal Webpack configuration now includes support for style rules with MIME type conditions. This allows the data URIs generated for inline component CSS styles by the Angular Webpack plugin to be processed with the same loaders as file based styles.
2021-04-12 14:08:43 -04:00
Alan Agius
88c7622842 test: remove webpack 5 e2e test
This is no longer needed since all tests use Webpack 5.
2021-04-11 11:27:33 -04:00
Alan Agius
695a01ba02 feat(@schematics/angular): configure new libraries to be published in Ivy partial mode
With this change we configure new libraries to be published using Ivy partial compilation instead of the deprecated View Engine rendering engine, we also remove several view engine specific `angularCompilerOptions`.

New libraries can be published using this format, as they are not depend upon by View Engine libraries or application.
2021-04-09 18:40:39 -04:00
Renovate Bot
dc2f678416 build: update angular packages 2021-04-08 12:20:44 -04:00
Charles Lyding
df988c2493 fix(@schematics/angular): update web-worker to support Webpack 5
Webpack 5 now includes web worker support. However, the structure of the URL within the `Worker` constructor must be in a specific format.
Before: `new Worker('./app.worker', ...)`
After: `new Worker(new URL('./app.worker', import.meta.url), ...)`
2021-04-08 09:42:47 -04:00
Charles Lyding
118ffb17fe test(@ngtools/webpack): update webpack test-app E2E to use Webpack 5
The direct Webpack test for the Webpack plugin is now updated to use Webpack 5 as Webpack 5 is now the default for the Angular tooling.
2021-04-08 09:42:47 -04:00
Charles Lyding
d883ce5d7e feat(@angular-devkit/build-angular): upgrade to Webpack 5 throughout the build system
With this change Webpack 5 is now used by the Angular tooling to build applications. Webpack 4 usage and support has been removed.
No project level configuration changes are required to take advantage of the upgraded Webpack version when using the official Angular builders.
Custom builders based on this package that use the experimental programmatic APIs may need to be updated to become compatible with Webpack 5.

BREAKING CHANGE: Webpack 5 lazy loaded file name changes
Webpack 5 generates similar but differently named files for lazy loaded JavaScript files in development configurations (when the `namedChunks` option is enabled).
For the majority of users this change should have no effect on the application and/or build process. Production builds should also not be affected as the `namedChunks` option is disabled by default in production configurations.
However, if a project's post-build process makes assumptions as to the file names then adjustments may need to be made to account for the new naming paradigm.
Such post-build processes could include custom file transformations after the build, integration into service-side frameworks, or deployment procedures.
Example development file name change: `lazy-lazy-module.js` --> `src_app_lazy_lazy_module_ts.js`

BREAKING CHANGE: Webpack 5 web worker support
Webpack 5 now includes web worker support. However, the structure of the URL within the `Worker` constructor must be in a specific format that differs from the current requirement.
Web worker usage should be updated as shown below (where `./app.worker` should be replaced with the actual worker name):
Before: `new Worker('./app.worker', ...)`
After:  `new Worker(new URL('./app.worker', import.meta.url), ...)`
2021-04-08 09:42:47 -04:00
Renovate Bot
a5d723cc10 build: update angular packages 2021-04-07 11:03:27 +02:00
Renovate Bot
027366099d build: update angular packages 2021-04-05 13:18:56 +02:00
Alan Agius
5cf9a08dc7 refactor(@angular-devkit/build-angular): remove deprecated i18n options from server and browser builder
BREAKING CHANGE:

Removal of deprecated browser and server command options.
- `i18nFile`,  use `locales` object in the project metadata instead.
- `i18nFormat`, No longer needed as the format will be determined automatically.
- `i18nLocale`, use `localize` option instead.
2021-04-03 14:45:58 +02:00
Charles Lyding
677913fc38 fix(@angular-devkit/build-angular): remove usage of deprecated View Engine compiler
BREAKING CHANGE: Removal of View Engine support from application builds
With the removal of the deprecated View Engine compiler in Angular version 12 for applications, Ivy-based compilation will always be used when building an application.
The default behavior for applications is to use the Ivy compiler when building and no changes are required for these applications.
For applications that have opted-out of Ivy, a warning will be shown and an Ivy-based build will be attempted. If the build fails,
the application may need to be updated to become Ivy compatible.
2021-04-02 08:11:11 +02:00
Renovate Bot
f6759c0bbd build: update angular packages 2021-04-02 08:09:41 +02:00
Charles Lyding
8a805fe0b9 fix(@angular/cli): exclude deprecated packages with removal migrations from update
Deprecated packages that may have been included in a project by the tooling are now ignored when validating an update. This change removes the need to use the `--force` option in a situation where the later migrations will remove and cleanup the deprecated packages.
2021-04-02 08:09:16 +02:00
Charles Lyding
e84fa72751 fix(@angular/cli): ensure update migrations are fully executed
With the move to refactor and centralize the update logic, the schematics wrapper context needs to be updated to create an exception for the new location of the update schematic.
2021-04-02 08:09:16 +02:00
Charles Lyding
2a6bda2fce test(@angular/cli): account for windows line endings in generate exports E2E tests 2021-04-02 08:08:30 +02:00
Alan Agius
1fcc120b16 test(@angular/cli): remove E2E tests which are not used 2021-03-31 12:21:47 -06:00
Charles Lyding
055fa17823 test(@ngtools/webpack): update webpack test-app E2E to use ivy plugin
This webpack E2E test application now uses the Ivy webpack plugin instead of the deprecated ViewEngine plugin.
2021-03-31 10:05:15 -06:00
Alan Agius
fd2dbb37ca test(@angular-devkit/build-angular): clean up tests from ViewEngine code 2021-03-31 10:04:23 -06:00
Alan Agius
14c8a09014 refactor(@angular/cli): remove Ivy Workspace from ng version
In version 12, only Ivy will be allowed to be used to compile an application.
2021-03-30 14:36:48 -06:00
Charles Lyding
012700ace5 fix(@angular-devkit/build-angular): remove deprecated View Engine support for i18n extraction
BREAKING CHANGE: Removal of View Engine support from i18n extraction
With the removal of the deprecated View Engine compiler in Angular version 12 for applications, the `ng extract-i18n` command will now always use the Ivy compiler.
The `--ivy` option has also been removed as Ivy-based extraction is always enabled.
The default behavior for applications is to use the Ivy compiler for building/extraction and no changes are required for these applications.
For applications that have opted-out of Ivy, a warning will be shown and Ivy-based extraction will be attempted. If the extraction fails,
the application may need to be updated to become Ivy compatible.
2021-03-30 14:34:52 -06:00
George Kalpakas
fb14945c02 fix(@schematics/angular): correctly handle adding multi-line strings to @NgModule metadata
Previously, `addSymbolToNgModuleMetadata()` assumed that the added
symbol would not span multiple lines. In most cases, the added symbol is
a single word, so this assumption was correct. In some cases, however,
we might want to add a mutli-line string, such as a static method of an
`@NgModule`:

```ts
  imports: [
    SomeModule.staticMethod({
      prop1: 'val1',
      prop2: 'val2'
    })
  ]
```

This commit allows `addSymbolToNgModuleMetadata()` to correctly handle
multi-line strings by ensuring that added metadata symbols are always
put on a new line (even if the array is empty) and each line in the
string is indented as necessary.
2021-03-30 14:33:19 -06:00
Renovate Bot
0b0a835216 build: update angular packages 2021-03-22 15:41:57 -04:00
Alan Agius
09daf7a7e0 fix(@schematics/angular): remove leftover workspace tslint config 2021-03-22 09:16:05 -04:00
Renovate Bot
e4d3437d2b build: update angular packages 2021-03-19 10:54:04 -04:00
Alan Agius
e469348c1d ci: update sauce browsers 2021-03-19 09:33:40 -04:00
Charles Lyding
aec0078404 ci: fix component-path-case E2E test on Windows CI
Windows CI is failing when trying to use the common test cleanup routine for the `generate/component/component-path-case` E2E test. This fix manually removes the newly created directory within the test.
2021-03-18 17:16:25 +01:00
Alan Agius
2616ef0d3f feat(@angular-devkit/build-angular): integrate JIT mode linker
With this change we intergate JIT mode linker into the Angular CLI.

Closes #20281
2021-03-18 15:38:52 +01:00
Renovate Bot
2e3bd24e6e build: update angular packages 2021-03-18 10:45:34 +01:00
Charles Lyding
583fc2a0d4 test(@angular/cli): fully test update process in update from v8 E2E
This commit changes the update-8 E2E test to use the recommended update procedure of updating one major version at a time.
2021-03-18 08:10:04 +01:00
Alan Agius
79856644b4 feat(@angular/cli): support TypeScript 4.2
BREAKING CHANGE

Drop support for TypeScript versions prior to 4.2.3
2021-03-17 19:32:01 +01:00
Alan Agius
b1fa5bd1bf test(@schematics/angular): update version 8 migration to use NPM packages
This is needed as otherwise the installation of older packages will fai.
2021-03-17 19:06:37 +01:00
Alan Agius
d37f731f40 test(@angular/cli): add ng add e2e tests to yarn subset 2021-03-17 18:24:15 +01:00
Renovate Bot
02b7862813 build: update angular packages 2021-03-17 13:33:25 +01:00
Alan Agius
fe5c3e05f9 test(@angular-devkit/build-angular): remove tslint E2E tests 2021-03-16 15:49:46 +01:00
Alan Agius
74537a11d4 test(@angular-devkit/build-angular): update tests to reflect the change in ES targets 2021-03-15 20:31:25 +01:00
Renovate Bot
625f47d42c build: update angular packages 2021-03-15 09:02:21 +01:00
Charles Lyding
985dc1a4c7 feat(@angular/cli): confirm ng add action before installation
BREAKING CHANGE:
The `ng add` command will now ask the user to confirm the package and version prior to installing and executing an uninstalled package.
This new behavior allows a user to abort the action if the version selected is not appropriate or if a typo occurred on the command line and an incorrect package would be installed.
A `--skip-confirmation` option has been added to skip the prompt and directly install and execute the package. This option is useful in CI and non-TTY scenarios such as automated scripts.
2021-03-11 08:54:07 +01:00
Renovate Bot
3c2f58314f build: update angular packages 2021-03-11 08:39:00 +01:00
Alan Agius
0d1826b2d1 test(@ngtools/webpack): update lazy loading string syntax to use dynamic imports 2021-03-10 12:44:04 -06:00
Charles Lyding
b98d969a92 refactor(@angular-devkit/build-angular): remove speed-measure-plugin usage
The plugin was only used when the `NG_BUILD_PROFILING` environment variable was used.  The environment variable also enabled the Webpack builtin `ProfilingPlugin` which is retained.
The builtin plugin provides a chrome events JSON output which can be loaded in Chrome DevTools and allows for graphical timeline views of the build.
The `speed-measure-plugin` is also currently incompatible with Webpack 5 which would prevent the CLI profiling support from working with Webpack 5.
2021-03-10 08:19:56 -06:00
Alan Agius
af1cc2d642 test(@ngtools/webpack): delete disabled test-app-weird and server-app 2021-03-10 08:19:23 -06:00
Alan Agius
55b833c9f8 test(@angular/cli): change tests to reflect prod mode by default changes 2021-03-10 08:16:38 -06:00
Renovate Bot
d26be396f8 build: update angular packages 2021-03-08 08:51:30 -06:00