Skip to content

Commit

Permalink
refactor: remove Angular Compatibility Compiler (ngcc) (#49101)
Browse files Browse the repository at this point in the history
This commit removes the NGCC code and all the related infra setup required to support it.

BREAKING CHANGE: Angular Compatibility Compiler (ngcc) has been removed and as a result Angular View Engine libraries will no longer work

PR Close #49101
  • Loading branch information
alan-agius4 authored and alxhub committed Feb 17, 2023
1 parent 9105c41 commit 48aa96e
Show file tree
Hide file tree
Showing 196 changed files with 202 additions and 53,383 deletions.
1 change: 0 additions & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ integration/ng_elements/node_modules
integration/ng_elements_schematics/node_modules
integration/ng_update/node_modules
integration/ng_update_migrations/node_modules
integration/ngcc/node_modules
integration/platform-server/node_modules
integration/service-worker-schema/node_modules
integration/side-effects/node_modules
Expand Down
1 change: 0 additions & 1 deletion .ng-dev/commit-message.mts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const commitMessage: CommitMessageConfig = {
'language-service',
'localize',
'migrations',
'ngcc',
'packaging',
'platform-browser',
'platform-browser-dynamic',
Expand Down
2 changes: 0 additions & 2 deletions .ng-dev/google-sync-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
"packages/bazel/src/protractor/**",
"packages/bazel/src/schematics/**",
"packages/bazel/src/types_bundle/**",
"packages/compiler-cli/src/ngcc/**",
"packages/compiler-cli/linker/**",
"packages/compiler-cli/ngcc/**",
"packages/compiler-cli/src/ngtsc/sourcemaps/**",
"packages/compiler-cli/src/ngtsc/testing/**",
"packages/compiler-cli/private/bazel.ts",
Expand Down
14 changes: 1 addition & 13 deletions .pullapprove.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ groups:
<<: *defaults
conditions:
- >
contains_any_globs(files.exclude('packages/compiler-cli/ngcc/*'), [
contains_any_globs(files, [
'packages/compiler/**/{*,.*}',
'packages/examples/compiler/**/{*,.*}',
'aio/content/examples/angular-compiler-options/**/{*,.*}',
Expand All @@ -166,18 +166,6 @@ groups:
- atscott
- JoostK

# =========================================================
# Framework: Compiler / ngcc
# =========================================================
fw-ngcc:
<<: *defaults
conditions:
- files.include('packages/compiler-cli/ngcc/*')
reviewers:
users:
- alxhub
- JoostK

# =========================================================
# Framework: Migrations
# =========================================================
Expand Down
6 changes: 1 addition & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ The `footer` is optional. The [Commit Message Footer](#commit-footer) format des
│ └─⫸ Commit Scope: animations|bazel|benchpress|common|compiler|compiler-cli|core|
│ elements|forms|http|language-service|localize|platform-browser|
│ platform-browser-dynamic|platform-server|router|service-worker|
│ upgrade|zone.js|packaging|changelog|docs-infra|migrations|ngcc|ve|
│ upgrade|zone.js|packaging|changelog|docs-infra|migrations|
│ devtools
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test
Expand Down Expand Up @@ -306,10 +306,6 @@ There are currently a few exceptions to the "use package name" rule:

* `migrations`: used for changes to the `ng update` migrations.

* `ngcc`: used for changes to the [Angular Compatibility Compiler](./packages/compiler-cli/ngcc/README.md)

* `ve`: used for changes specific to ViewEngine (legacy compiler/renderer).

* `devtools`: used for changes in the [browser extension](./devtools/README.md).

* none/empty string: useful for `test` and `refactor` changes that are done across all packages (e.g. `test: add missing unit tests`) and for docs changes that are not related to a specific package (e.g. `docs: fix typo in tutorial`).
Expand Down
8 changes: 1 addition & 7 deletions aio/content/guide/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,11 +500,6 @@ Install Angular libraries with the [npm package manager][NpmjsDocsAboutNpm] and

Compare to [NgModule][AioGuideGlossaryNgmodule].

## ngcc

Angular compatibility compiler.
If you build your application using [Ivy][AioGuideGlossaryIvy], but it depends on libraries that have not been compiled with Ivy, the Angular CLI uses `ngcc` to automatically update the dependent libraries to use Ivy.

## NgModule

A class definition preceded by the `@NgModule()` [decorator][AioGuideGlossaryDecoratorDecoration], which declares and serves as a manifest for a block of code dedicated to an application domain, a workflow, or a closely related set of capabilities.
Expand Down Expand Up @@ -1085,7 +1080,6 @@ Learn more about zones in this [Brian Ford video][YoutubeWatchV3iqtmusceU].
[AioGuideGlossaryLibrary]: guide/glossary#library "library - Glossary | Angular"
[AioGuideGlossaryM]: guide/glossary#module "M - Glossary | Angular"
[AioGuideGlossaryModule]: guide/glossary#module "module - Glossary | Angular"
[AioGuideGlossaryN]: guide/glossary#ngcc "N - Glossary | Angular"
[AioGuideGlossaryNgmodule]: guide/glossary#ngmodule "NgModule - Glossary | Angular"
[AioGuideGlossaryNpmPackage]: guide/glossary#npm-package "npm package - Glossary | Angular"
[AioGuideGlossaryO]: guide/glossary#observable "O - Glossary | Angular"
Expand Down Expand Up @@ -1212,4 +1206,4 @@ Learn more about zones in this [Brian Ford video][YoutubeWatchV3iqtmusceU].

<!-- end links -->

@reviewed 2022-02-28
@reviewed 2023-02-16
6 changes: 1 addition & 5 deletions aio/content/guide/migration-module-with-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,10 @@ It should match the type of whichever `NgModule` is returned in the `ModuleWithP

Libraries should add the generic type to any usages of the `ModuleWithProviders` type.

## What about applications using non-migrated libraries?

The [Angular compatibility compiler](guide/glossary#ngcc) \(`ngcc`\) should automatically transform any non-migrated libraries to generate the proper code.

<!-- links -->

<!-- external links -->

<!-- end links -->

@reviewed 2022-02-28
@reviewed 2023-02-16
6 changes: 1 addition & 5 deletions aio/content/guide/migration-undecorated-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,10 @@ Classes that don't use Angular features don't need an Angular decorator.
As support for selectorless decorators is introduced in Angular version 9, if you want to support Angular version 8 and earlier, you shouldn't add a selectorless `@Directive()` decorator.
You can either add `@Directive()` with a selector or move the Angular-specific features to affected subclasses.

## What about applications using non-migrated libraries?

The [Angular compatibility compiler](guide/glossary#ngcc) \(`ngcc`\) should automatically transform any non-migrated libraries to generate the proper code.

<!-- links -->

<!-- external links -->

<!-- end links -->

@reviewed 2022-02-28
@reviewed 2023-02-16
2 changes: 1 addition & 1 deletion aio/content/guide/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ As the next step, we need to finalize the recommendations and compile a list of

Earlier in 2020, we shared an [RFC](https://github.com/angular/angular/issues/38366) for Ivy library distribution.
After invaluable feedback from the community, we developed a design of the project.
We are now investing in the development of Ivy library distribution, including an update of the library package format to use Ivy compilation, unblock the deprecation of the View Engine library format, and [ngcc](guide/glossary#ngcc).
We are now investing in the development of Ivy library distribution, including an update of the library package format to use Ivy compilation, unblock the deprecation of the View Engine library format, and ngcc.

### Improve test times and debugging with automatic test environment tear down

Expand Down
4 changes: 4 additions & 0 deletions aio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
"npm": "Please use yarn instead of NPM to install dependencies"
},
"private": true,
"// resolutions": "Temp resolutions until CLI releases v16.0.0-next.0",
"resolutions": {
"@ngtools/webpack": "https://github.com/angular/ngtools-webpack-builds.git#c784933671856a6529d7dd560ba1026890898f57"
},
"dependencies": {
"@angular/animations": "15.2.0-next.4",
"@angular/cdk": "15.2.0-next.4",
Expand Down
1 change: 0 additions & 1 deletion aio/tools/examples/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"http-server": "http-server",
"protractor": "protractor",
"postinstall": "ngcc --properties es2015 main",
"sync-deps": "node sync-boilerplate-dependencies"
},
"//engines-comment": "Keep this in sync with /package.json and /aio/package.json",
Expand Down
12 changes: 3 additions & 9 deletions aio/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2877,15 +2877,9 @@
resolved "https://registry.yarnpkg.com/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz#c3ec604a0b54b9a9b87e9735dfc59e1a5da6a5fb"
integrity sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==

"@ngtools/webpack@15.2.0-next.3":
version "15.2.0-next.3"
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-15.2.0-next.3.tgz#3fc8b605d1be5ad6a66b908b89847681319ee95e"
integrity sha512-Je7rwxLPcpmkHIvOzzdhWr9xqK6FMi1lGh5rEW49E9O9E1ESfh5OMnC3pgC8gOEzrhcnOuXgV7JZ5AjJwCgmgQ==

"@ngtools/webpack@15.2.0-next.4":
version "15.2.0-next.4"
resolved "https://registry.yarnpkg.com/@ngtools/webpack/-/webpack-15.2.0-next.4.tgz#354d6096329a7f33e787d218385dbb610ad42bee"
integrity sha512-Ftqqo9AHVVbDLKS5q5AzN+InimGwCZQTCPfnA5WoDOPHjEDoA0Ekg+7IaRjRWpOd7lPYr9fh62KQLXVc2vIydg==
"@ngtools/webpack@15.2.0-next.3", "@ngtools/webpack@15.2.0-next.4", "@ngtools/webpack@https://github.com/angular/ngtools-webpack-builds.git#c784933671856a6529d7dd560ba1026890898f57":
version "16.0.0-next.0"
resolved "https://github.com/angular/ngtools-webpack-builds.git#c784933671856a6529d7dd560ba1026890898f57"

"@nodelib/fs.scandir@2.1.5":
version "2.1.5"
Expand Down
1 change: 0 additions & 1 deletion docs/TRIAGE_AND_LABELS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ of this repo.
* `area: core & compiler` - because core, compiler, compiler-cli and
browser-platforms are very intertwined, we will be treating them as one
* `area: ivy` - a subset of core representing the new Ivy renderer.
* `area: ngcc` - a subset of ivy representing the [Angular Compatibility Compiler](../packages/compiler-cli/ngcc/README.md)
* `area: ve` - a subset of `core & compiler` representing changes specific to ViewEngine (legacy compiler/renderer).
* `area: docs-infra` - the angular.io application and docs-related tooling
* `area: elements`
Expand Down
4 changes: 0 additions & 4 deletions goldens/circular-deps/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
"packages/animations/browser/src/render/animation_driver.ts",
"packages/animations/browser/src/render/shared.ts"
],
[
"packages/compiler-cli/ngcc/src/packages/configuration.ts",
"packages/compiler-cli/ngcc/src/packages/entry_point.ts"
],
[
"packages/compiler-cli/src/ngtsc/partial_evaluator/src/interface.ts",
"packages/compiler-cli/src/ngtsc/partial_evaluator/src/interpreter.ts"
Expand Down
15 changes: 0 additions & 15 deletions integration/ngcc/BUILD.bazel

This file was deleted.

30 changes: 0 additions & 30 deletions integration/ngcc/debug-test.sh

This file was deleted.

50 changes: 0 additions & 50 deletions integration/ngcc/mock-ngcc-version-marker.js

This file was deleted.

6 changes: 0 additions & 6 deletions integration/ngcc/ngcc.config.js

This file was deleted.

26 changes: 0 additions & 26 deletions integration/ngcc/package.json

This file was deleted.

Loading

0 comments on commit 48aa96e

Please sign in to comment.