refactor(compiler): remove unused `__BUILD_OPTIMIZER_*` constants (#41040)

These constants were created in a very early phase of Ivy development.
They have never been used in the framework, no the build-optimizer tool.

PR Close #41040
This commit is contained in:
Pete Bacon Darwin 2021-03-03 11:52:02 +00:00 committed by Andrew Kushnir
parent 11e16c7b41
commit d44c7c209d
2 changed files with 1 additions and 67 deletions

View File

@ -415,55 +415,6 @@ except for the call to `ɵɵdefineInjector` would generate a `{ __symbolic: 'err
value which is ignored by the ivy compiler. This allows the system to ignore
the difference between manually and mechanically created module definitions.
## Manual Considerations
With this proposal, the compiler treats manually and mechanically generated
Angular definitions identically. This allows flexibility not only in the future
for how the declarations are mechanically produced, it also allows an alternative
mechanism to generate declarations that can be easily explored without altering the
compiler or dependent tool chain. It also allows third-party code generators
with possibly different component syntaxes to generate a component that is fully
understood by the compiler.
Unfortunately, manually generated modules contain references to
classes that might not be necessary at runtime. Manually or third-party
components can get the same payload properties of an Angular generated
component by annotating the `ngSelector` and `ngModuleScope` properties with
`// @__BUILD_OPTIMIZER_REMOVE_` comment which will cause the build optimizer
to remove the declaration.
##### Example
For example the above manually created module would have better payload
properties by including a `// @__BUILD_OPTIMIZER_REMOVE_` comment:
```ts
export class MyModule {
static ɵinj = ɵɵdefineInjector({
providers: [{
provide: Service, useClass: ServiceImpl
}],
imports: [CommonModule, UtilityModule]
});
// @__BUILD_OPTIMIZER_REMOVE_
static ngModuleScope = [{
type: MyComponent,
selector: 'my-comp'
}, {
type: MyDirective,
selector: '[my-dir]'
}, {
type: MyPipe,
name: 'myPipe'
}, {
type: UtilityModule,
isModule: true
}];
}
```
## `ngc` output (non-Bazel)
The cases that `ngc` handle are producing an application and producing a
@ -724,7 +675,7 @@ To produce an Ivy library the options would look like,
##### Example - Ivy package
Ivy packages are not supported in Angular 6.0 as they are not recommended in
npm packages as they would only be usable if inside Ivy applications.
npm packages as they would only be usable if inside Ivy applications.
Ivy applications support Renderer2 libraries so npm packages
should all be Renderer2 libraries.

View File

@ -1,17 +0,0 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Comment to insert above back-patch
*/
export const BUILD_OPTIMIZER_COLOCATE = '@__BUILD_OPTIMIZER_COLOCATE__';
/**
* Comment to mark removable expressions
*/
export const BUILD_OPTIMIZER_REMOVE = '@__BUILD_OPTIMIZER_REMOVE__';