build: turn on tsc's stripInternal when producint public d.ts file

I also made some changes to fix imports and remove some stuff that caused
breakage once stripInternals was turned on.
This commit is contained in:
Igor Minar 2016-05-19 15:29:50 -07:00
parent 7bfe8aa553
commit 0035575c82
24 changed files with 33 additions and 27 deletions

@ -10,5 +10,4 @@ export {NgTemplateOutlet} from './directives/ng_template_outlet';
export {NgStyle} from './directives/ng_style'; export {NgStyle} from './directives/ng_style';
export {NgSwitch, NgSwitchWhen, NgSwitchDefault} from './directives/ng_switch'; export {NgSwitch, NgSwitchWhen, NgSwitchDefault} from './directives/ng_switch';
export {NgPlural, NgPluralCase, NgLocalization} from './directives/ng_plural'; export {NgPlural, NgPluralCase, NgLocalization} from './directives/ng_plural';
export * from './directives/observable_list_diff';
export {CORE_DIRECTIVES} from './directives/core_directives'; export {CORE_DIRECTIVES} from './directives/core_directives';

@ -1,11 +0,0 @@
// TS does not have Observables
// I need to be here to make TypeScript think this is a module.
import {} from '../../src/facade/lang';
/**
* This module exists in Dart, but not in Typescript. This exported symbol
* is only here to help Typescript think this is a module.
* @internal
*/
export var workaround_empty_observable_list_diff: any;

@ -1,5 +1,5 @@
import {Injectable, Inject} from '@angular/core'; import {Injectable, EventEmitter} from '@angular/core';
import {EventEmitter, ObservableWrapper} from '../../src/facade/async'; import {ObservableWrapper} from '../../src/facade/async';
import {LocationStrategy} from './location_strategy'; import {LocationStrategy} from './location_strategy';

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "commonjs",

@ -14,7 +14,7 @@ import {
import {IS_DART, stringify} from '../src/facade/lang'; import {IS_DART, stringify} from '../src/facade/lang';
import {CompileMetadataResolver} from '../src/metadata_resolver'; import {CompileMetadataResolver} from '../src/metadata_resolver';
import {LifecycleHooks, LIFECYCLE_HOOKS_VALUES} from '@angular/core/src/metadata/lifecycle_hooks'; import {LIFECYCLE_HOOKS_VALUES} from '@angular/core/src/metadata/lifecycle_hooks';
import { import {
Component, Component,
Directive, Directive,

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "commonjs",

@ -11,9 +11,6 @@ export enum LifecycleHooks {
AfterViewChecked AfterViewChecked
} }
/**
* @internal
*/
export var LIFECYCLE_HOOKS_VALUES = [ export var LIFECYCLE_HOOKS_VALUES = [
LifecycleHooks.OnInit, LifecycleHooks.OnInit,
LifecycleHooks.OnDestroy, LifecycleHooks.OnDestroy,

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "commonjs",

@ -98,8 +98,11 @@ export class ObservableWrapper {
* Once a reference implementation of the spec is available, switch to it. * Once a reference implementation of the spec is available, switch to it.
*/ */
export class EventEmitter<T> extends Subject<T> { export class EventEmitter<T> extends Subject<T> {
/** @internal */ // TODO: mark this as internal once all the facades are gone
_isAsync: boolean; // we can't mark it as internal now because EventEmitter exported via @angular/core would not
// contain this property making it incompatible with all the code that uses EventEmitter via
// facades, which are local to the code and do not have this property stripped.
__isAsync: boolean;
/** /**
* Creates an instance of [EventEmitter], which depending on [isAsync], * Creates an instance of [EventEmitter], which depending on [isAsync],
@ -107,7 +110,7 @@ export class EventEmitter<T> extends Subject<T> {
*/ */
constructor(isAsync: boolean = true) { constructor(isAsync: boolean = true) {
super(); super();
this._isAsync = isAsync; this.__isAsync = isAsync;
} }
emit(value: T) { super.next(value); } emit(value: T) { super.next(value); }
@ -123,30 +126,30 @@ export class EventEmitter<T> extends Subject<T> {
let completeFn = () => null; let completeFn = () => null;
if (generatorOrNext && typeof generatorOrNext === 'object') { if (generatorOrNext && typeof generatorOrNext === 'object') {
schedulerFn = this._isAsync ? (value) => { setTimeout(() => generatorOrNext.next(value)); } : schedulerFn = this.__isAsync ? (value) => { setTimeout(() => generatorOrNext.next(value)); } :
(value) => { generatorOrNext.next(value); }; (value) => { generatorOrNext.next(value); };
if (generatorOrNext.error) { if (generatorOrNext.error) {
errorFn = this._isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } : errorFn = this.__isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } :
(err) => { generatorOrNext.error(err); }; (err) => { generatorOrNext.error(err); };
} }
if (generatorOrNext.complete) { if (generatorOrNext.complete) {
completeFn = this._isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } : completeFn = this.__isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } :
() => { generatorOrNext.complete(); }; () => { generatorOrNext.complete(); };
} }
} else { } else {
schedulerFn = this._isAsync ? (value) => { setTimeout(() => generatorOrNext(value)); } : schedulerFn = this.__isAsync ? (value) => { setTimeout(() => generatorOrNext(value)); } :
(value) => { generatorOrNext(value); }; (value) => { generatorOrNext(value); };
if (error) { if (error) {
errorFn = errorFn =
this._isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); }; this.__isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); };
} }
if (complete) { if (complete) {
completeFn = completeFn =
this._isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); }; this.__isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); };
} }
} }

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "commonjs",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "commonjs",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "commonjs",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "commonjs",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "commonjs",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",

@ -5,6 +5,7 @@
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"declaration": true, "declaration": true,
"stripInternal": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "commonjs",