fix(ivy): make defineComponent tree shakable by Closure Compiler (#26425)

PR Close #26425
This commit is contained in:
Miško Hevery
2018-10-12 15:49:42 -07:00
committed by Misko Hevery
parent 371ffef4ce
commit 4d164b6ca4
8 changed files with 74 additions and 31 deletions

View File

@ -190,7 +190,7 @@ export interface ComponentDef<T> extends DirectiveDef<T> {
/**
* Runtime unique component ID.
*/
id: string;
readonly id: string;
/**
* The View template of the component.
@ -209,7 +209,7 @@ export interface ComponentDef<T> extends DirectiveDef<T> {
* can pre-fill the array and set the binding start index.
*/
// TODO(kara): remove queries from this count
consts: number;
readonly consts: number;
/**
* The number of bindings in this component template (including pure fn bindings).
@ -217,7 +217,7 @@ export interface ComponentDef<T> extends DirectiveDef<T> {
* Used to calculate the length of the component's LViewData array, so we
* can pre-fill the array and set the host binding start index.
*/
vars: number;
readonly vars: number;
/**
* Query-related instructions for a component.
@ -271,6 +271,12 @@ export interface ComponentDef<T> extends DirectiveDef<T> {
* `PipeDefs`s. The function is necessary to be able to support forward declarations.
*/
pipeDefs: PipeDefListOrFactory|null;
/**
* Used to store the result of `noSideEffects` function so that it is not removed by closure
* compiler. The property should never be read.
*/
readonly _?: never;
}
/**