972 Commits

Author SHA1 Message Date
Alan Agius
57d7eb5b16 fix(@angular/cli): error when updating Angular packages across multi-major migrations
With this change we show an error message when users try to update `@angular/` and `@nguniversal/` packages across multiple major versions.
2021-10-26 04:45:18 -05:00
Renovate Bot
80b026c051 build: update all non-major dependencies 2021-10-19 12:01:08 -04:00
Renovate Bot
167706a5d7 build: update all non-major dependencies 2021-10-14 12:55:20 -04:00
Alan Agius
08687d1475 fix(@schematics/angular): wrap bootstrapping code in an HMR compatible manner
With this change we update the universal schematic bootstrap code to handle HMR properly. Previously, the bootstrapping code was called only on `DOMContentLoaded` which is not triggered when running in HMR.

Closes #21932
2021-10-13 17:43:24 +02:00
Alan Agius
6cb033e1c7 fix(@angular-devkit/build-angular): update workspace tsconfig lib es2020 2021-10-08 14:40:54 +02:00
Alan Agius
81531d1b64 fix(@schematics/angular): remove target and lib options for library tsconfig
The `target` option is set directly in ng-packagr binary and cannot be overridden, while the `lib` option is inherited from the root level tsconfig.
2021-10-08 14:40:54 +02:00
Alan Agius
94c00afbf3 fix(@schematics/angular): don't export renderModuleFactory from server file
Using `renderModuleFactory` is no longer needed since this was used for ViewEngine.
2021-10-07 18:50:54 +02:00
Charles Lyding
b3dcefa13c refactor(@schematics/angular): update new project rxjs version to ~7.4.0
`rxjs` 7 versions prior to 7.4.0 did not export the ES2015 variant in a way that could be leveraged via the new package.json `exports` feature. As a result, prior versions would cause larger ES5 variants of rxjs to be bundled within applications. Version 7.4.0 is now set as the minimum version for new projects to allow for the ES2015 rxjs code to be used when building applications.
2021-10-06 19:10:24 -04:00
Alan Agius
585adacd06 fix(@schematics/angular): don't add destroyAfterEach in newly generated spec files
This is now enabled by default.

See https://github.com/angular/angular/pull/43353 for more context.
2021-10-06 14:33:42 -05:00
Alan Agius
7ff8c5350e feat(@schematics/angular): add /.angular/cache to .gitignore
With this change we add `/.angular/cache` to `.gitignore`. This folder will primary be used to store the build disk cache artifacts.
2021-10-06 08:02:22 -05:00
Doug Parker
eac18aed78 feat(@schematics/angular): drop polyfills required only for Internet Explorer now that support has been dropped for it
Removes the `classlist.js` and `web-animations-js` polyfills from any polyfills files in a workspace. Specifically, it looks for `import 'classlist.js';` and `import 'web-animations-js';`, then removes those them along with any preceeding comments (aside from the file overview and browser polyfills header comment).

Previous versions of `ng new` generated a polyfills file with commented out imports for both modules, to avoid including them by default while giving users an easy way to enable them. This migration also looks for these commented out imports and removes them along with associated descriptive comments. This has no effect on the application, but cleans up unnecessary noise from the polyfills file.

BREAKING CHANGE:

`classlist.js` and `web-animations-js` are removed from application polyfills and uninstalled from the package. These were only needed for compatibility with Internet Explorer, which is no longer needed now that Angular only supports evergreen browsers. See: https://angular.io/guide/browser-support.

Add the following to the polyfills file for an app to re-add these packages:

```typescript
import 'classlist.js';
import 'web-animations-js';
```

And then run:

```sh
npm install classlist.js web-animations-js --save
```
2021-10-06 06:11:23 -05:00
Doug Parker
ba9c60360f refactor(@schematics/angular): drop IE-only polyfills and drop versions from comment.
This removes polyfills only required on Internet Explorer since it is no longer supported (`web-animations-js`). Also updates the doc comment to leave specific versions unspecified, since they are already out of date and updating them now would just cause them to go out of date again in the future. Instead, users can visit the browser support guide to understand find the most up to date browser versions supported.
2021-10-01 14:07:58 -05:00
Alan Agius
000b0e51c1 feat(@angular-devkit/build-angular): remove deprecated dev-server options
BREAKING CHANGE: With this change a number of deprecated dev-server builder options which proxied to the browser builder have been removed. These options should be configured in the browser builder instead.

The removed options are:
- `aot`
- `sourceMap`
- `deployUrl`
- `baseHref`
- `vendorChunk`
- `commonChunk`
- `optimization`
- `progress`
2021-10-01 14:07:42 -05:00
Alan Agius
9c924a4c24 build: update to TypeScript 4.4 2021-09-28 09:35:19 -04:00
Alan Agius
31ec09c111 refactor(@schematics/angular): remove migrations for unsupported versions 2021-09-24 15:38:33 -04:00
Charles Lyding
7bdcd7da1f feat(@schematics/angular): create new projects with rxjs 7
With the Angular framework supporting rxjs 7 for Angular 13, new projects (`ng new ...`) can now be created using rxjs 7. rxjs 6 is also still fully supported with Angular 13 allowing existing projects to continue to use rxjs 6 if preferred or required.
Support for rxjs 7 within the framework was enabled via https://github.com/angular/angular/pull/42991
2021-09-23 06:59:14 -04:00
Renovate Bot
7ab1cf3b29 build: update all non-major dependencies 2021-09-03 10:34:02 +02:00
Alan Agius
c13cc888d0 build: update ng-packagr to version 13.0.0-next.1 2021-09-02 17:54:09 +02:00
Alan Agius
732ef79852 fix(@schematics/angular): add browserslist configuration in library projects
Previously, browserslist configuration was not added in library projects. This in some cases caused a large number of CSS prefixes to be included in components stylesheets
2021-08-27 15:57:57 +02:00
Charles Lyding
a7de97e485 build: add Bazel ts_library rule package_name properties to all packages
rules_nodejs 4 requires that a package_name property be specified within a ts_library rule for the output to be linked into the package repository. Failing to add the property can cause test failures due to unresolved packages.
2021-08-26 07:30:44 +02:00
Charles Lyding
51f89d633f test: enable no-useless-escape lint rule
The `no-useless-escape` eslint rule has now been enabled which removes unneeded characters and complexity from string literals and regular expressions. All files that were in violation of this rule have also been corrected.
2021-08-24 10:51:14 +01:00
Renovate Bot
9e71069610 build: update all non-major dependencies 2021-08-23 11:07:13 +01:00
Alan Agius
4f91816b29 feat(@schematics/angular): migrate libraries to be published from ViewEngine to Ivy Partial compilation
This migration updates libraries to be published in partial mode instead of view engine. Also, it removed deprecated options from ng-packagr configuration.
2021-08-23 11:06:07 +01:00
Alan Agius
3ba13f467c feat(@schematics/angular): add noImplicitOverride and noPropertyAccessFromIndexSignature to workspace tsconfig
With this change, when the workspace is created in strict mode (the default) we add the following  additional tsconfig options;
- [noImplicitOverride](https://www.typescriptlang.org/tsconfig#noImplicitOverride)
- [noPropertyAccessFromIndexSignature](https://www.typescriptlang.org/tsconfig#noPropertyAccessFromIndexSignature)

Closes #21279
2021-08-09 20:02:19 +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
Alan Agius
59fb11794b docs(@schematics/angular): replace app with application 2021-08-09 13:52:03 +02:00
Charles Lyding
f227e145df fix(@schematics/angular): updated Angular new project version to v13.0 prerelease 2021-08-06 08:12:06 +02:00
Alan Agius
268a03b630 feat(@schematics/angular): add migration to update the workspace config
With this change we add a migration to update the workspace configuration to version 13 by removed deprecated options and builders.
2021-08-03 15:07:04 +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
5986befcdc feat(@schematics/angular): remove deprecated options
With this change we removed several deprecated `@schematics/angular` deprecated options.

BREAKING CHANGE:

We removed several deprecated `@schematics/angular` deprecated options.
- `lintFix` have been removed from all schematics. `ng lint --fix` should be used instead.
- `legacyBrowsers` have been removed from the `application` schematics since IE 11 is no longer supported.
- `configuration` has been removed from the `web-worker` as it was unused.
- `target` has been removed from the `service-worker` as it was unused.
2021-07-30 14:26:53 +01:00
Alan Agius
9fbd16655e feat(@schematics/angular): remove IE 11 specific polyfills 2021-07-30 12:56:30 +01:00
Joey Perrott
bec21de06a refactor(@schematics/angular): hard code version of Angular in latest-verisons
Update the version of Angular in latest-verions as 13.0.0-next.0 is not on npm.
2021-07-29 14:20:43 +02:00
Alan Agius
c92a381710 refactor(@schematics/angular): improve automatic versions
With this change we improve the versions we set in the users project to be less confusing.  Previously, for both stable and next versions we set the versions of Angular packages to the below;

```
"@angular/animations": "~12.2.0-"
```

This might be problematic as one might not immediately notice that they might depend on a prerelease. The `-` is short character and can be missed when having a large set of dependencies.

With this can we are more explicate by adding `--next` when it's a prerelease and omit the suffix for stable releases.
2021-07-22 14:42:42 -04:00
Joey Perrott
3772836c1d refactor(@schematics/angular): automatically determine the version string to match latest Angular
Automatically determine the latest compatible Angular Framework version by using `~` matching
for the current minor version of @schematics/angular.
2021-07-21 14:51:24 -07:00
Alan Agius
14df2aaef9 refactor(@schematics/angular): sync schematics dependencies using Renovate
With this change we sync workspace and library schematic dependencies using Renovate. We do this to avoid having to keep these in sync by hand.

We could have used TypeScripts' `resolveJsonModule` to make the `latestVersion` object typesafe. But `ts_library` doesn't support JSON inputs.
2021-07-20 18:58:29 +02:00
Charles Lyding
2b14ac6924 refactor(@schematics/angular): use a helper function for basic generation schematics
An internal schematics helper rule has been introduced for Angular schematics that only generate a set of project files from a set of templated files. Multiple current generation schematics contained essentially the same code which increased the sustainment burden and made refactoring and improvements more complicated.
2021-07-15 12:54:34 +02:00
Joey Perrott
792bdb9f34 release: v12.2.0-next.2 2021-07-14 15:07:54 -07:00
Alan Agius
0907b69417 fix(@schematics/angular): use stricter semver for karma-jasmine-html-reporter
This is not the first time, that this package caused a breaking change in a minor version, were it drops support for older `jasmine-core` versions.

Related to #21326
2021-07-12 16:40:12 +01:00
Alan Agius
52034151b2 build: update @types/jasmine and jasmine for new projects 2021-07-09 17:02:52 +01:00
Alan Agius
1b5e18e7b4 fix(@schematics/angular): replace interactive div with button in application component template
A keyboard user who has a problem in using a mouse, will not be able to select the `div`, because he cannot initiate the click event, which is specific to the mouse. Interactive elements like button can initiate the click event on keyboard events.

Instead of adding additional events, such as `keyup`, `keydown` or `keypress`, we replace these with a `button`.
2021-07-08 11:55:28 -04:00
Charles Lyding
5b10d4f549 fix(@schematics/angular): remove unsafe any usage in application spec file
The `nativeElement` property on a `TestBed` fixture is of type `any`. In one of the tests within a new application's spec file, the `nativeElement` is accessed but not cast to an appropriate type which results in potentially unsafe member access. The `nativeElement` is now cast as an `HTMLElement` and allows additional usage to be type checked.
2021-07-07 11:15:34 -04:00
Alan Agius
20fd33f6d4 feat(@schematics/angular): destroy test module after every test
In version 12.1, the framework added the `destroyAfterEach` an opt-in feature that improves tests performance and also addresses two long-standing issues.

The idea, is to have this enabled by default in the future.  Related PR: https://github.com/angular/angular/pull/42566

Closes #21280
2021-07-07 10:31:20 -04:00
Doug Parker
0c285d3e98 release: v12.2.0-next.1 2021-07-01 09:38:26 -07:00
Alan Agius
7d2ed2a248 build: update ng-packagr to 12.1 stable version 2021-06-27 16:01:13 +02:00
Doug Parker
c666d0b73b release: v12.2.0-next.0 2021-06-24 16:26:12 -07:00
Doug Parker
e08323b4c1 Revert "release: v12.1.0"
This reverts commit d9fc97198da1a76773cc4dc840ec04b5416c22a8.

This should be on the `12.1.x` branch, not `master`.
2021-06-24 16:21:43 -07:00
Doug Parker
d9fc97198d release: v12.1.0 2021-06-24 16:18:15 -07:00
Alan Agius
4fc33ca0c0 build: update to ng-packagr to 12.1.0-next.0 2021-06-23 11:51:09 +01:00
twerske
a44dc02fee fix(@schematics/angular): add devtools to ng new
adds devtools to ng new resources list
2021-06-22 17:39:49 +01:00
Alan Agius
e5ba29c7d5 fix(@schematics/angular): display warning during migrations when using third-party builders 2021-06-21 11:10:51 +01:00