fix(packages): use ES modules for primary build (#11120)
This commit is contained in:

committed by
Victor Berchet

parent
8cb1046ce9
commit
979657989b
@ -1,7 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. 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
|
||||
*/
|
@ -6,26 +6,11 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export {BrowserModule, platformBrowser} from './src/browser';
|
||||
export {BrowserPlatformLocation} from './src/browser/location/browser_platform_location';
|
||||
export {Title} from './src/browser/title';
|
||||
export {disableDebugTools, enableDebugTools} from './src/browser/tools/tools';
|
||||
export {AnimationDriver} from './src/dom/animation_driver';
|
||||
export {By} from './src/dom/debug/by';
|
||||
export {DOCUMENT} from './src/dom/dom_tokens';
|
||||
export {EVENT_MANAGER_PLUGINS, EventManager} from './src/dom/events/event_manager';
|
||||
export {HAMMER_GESTURE_CONFIG, HammerGestureConfig} from './src/dom/events/hammer_gestures';
|
||||
export {DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl} from './src/security/dom_sanitization_service';
|
||||
// Web Workers
|
||||
export {ClientMessageBroker, ClientMessageBrokerFactory, FnArg, UiArguments} from './src/web_workers/shared/client_message_broker';
|
||||
export {PRIMITIVE} from './src/web_workers/shared/serializer';
|
||||
export {ReceivedMessage, ServiceMessageBroker, ServiceMessageBrokerFactory} from './src/web_workers/shared/service_message_broker';
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Entry point for all public APIs of the platform-browser package.
|
||||
*/
|
||||
export * from './src/platform-browser';
|
||||
|
||||
export * from './src/web_workers/shared/message_bus';
|
||||
export {WORKER_APP_LOCATION_PROVIDERS} from './src/web_workers/worker/location_providers';
|
||||
export {WORKER_UI_LOCATION_PROVIDERS} from './src/web_workers/ui/location_providers';
|
||||
|
||||
export {NgProbeToken} from './src/dom/debug/ng_probe';
|
||||
export {platformWorkerUi, WebWorkerInstance, WORKER_SCRIPT, WORKER_UI_STARTABLE_MESSAGING_SERVICE} from './src/worker_render';
|
||||
export {platformWorkerApp, WorkerAppModule} from './src/worker_app';
|
||||
export * from './private_export';
|
||||
// This file only reexports content of the `src` folder. Keep it that way.
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "@angular/platform-browser",
|
||||
"version": "0.0.0-PLACEHOLDER",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"jsnext:main": "esm/index.js",
|
||||
"description": "Angular 2 platform-browser",
|
||||
"main": "bundles/platform-browser.umd.js",
|
||||
"module": "index.js",
|
||||
"typings": "index.d.ts",
|
||||
"author": "angular",
|
||||
"license": "MIT",
|
||||
|
@ -1,39 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. 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
|
||||
*/
|
||||
|
||||
import {ClassProvider, ExistingProvider, FactoryProvider, TypeProvider, ValueProvider} from '@angular/core';
|
||||
|
||||
import * as browser from './src/browser';
|
||||
import * as ng_proble from './src/dom/debug/ng_probe';
|
||||
import * as dom_adapter from './src/dom/dom_adapter';
|
||||
import * as dom_renderer from './src/dom/dom_renderer';
|
||||
import * as dom_events from './src/dom/events/dom_events';
|
||||
import * as shared_styles_host from './src/dom/shared_styles_host';
|
||||
|
||||
export interface __platform_browser_private_types__ {
|
||||
DomAdapter: dom_adapter.DomAdapter;
|
||||
DomRootRenderer: dom_renderer.DomRootRenderer;
|
||||
DomRootRenderer_: dom_renderer.DomRootRenderer_;
|
||||
DomSharedStylesHost: shared_styles_host.DomSharedStylesHost;
|
||||
SharedStylesHost: shared_styles_host.SharedStylesHost;
|
||||
DomEventsPlugin: dom_events.DomEventsPlugin;
|
||||
}
|
||||
|
||||
export var __platform_browser_private__ = {
|
||||
DomAdapter: dom_adapter.DomAdapter,
|
||||
getDOM: dom_adapter.getDOM,
|
||||
setRootDomAdapter: dom_adapter.setRootDomAdapter,
|
||||
DomRootRenderer: dom_renderer.DomRootRenderer,
|
||||
DomRootRenderer_: dom_renderer.DomRootRenderer_,
|
||||
DomSharedStylesHost: shared_styles_host.DomSharedStylesHost,
|
||||
SharedStylesHost: shared_styles_host.SharedStylesHost,
|
||||
ELEMENT_PROBE_PROVIDERS: ng_proble.ELEMENT_PROBE_PROVIDERS,
|
||||
DomEventsPlugin: dom_events.DomEventsPlugin,
|
||||
initDomAdapter: browser.initDomAdapter,
|
||||
INTERNAL_BROWSER_PLATFORM_PROVIDERS: browser.INTERNAL_BROWSER_PLATFORM_PROVIDERS
|
||||
};
|
16
modules/@angular/platform-browser/rollup-testing.config.js
Normal file
16
modules/@angular/platform-browser/rollup-testing.config.js
Normal file
@ -0,0 +1,16 @@
|
||||
|
||||
export default {
|
||||
entry: '../../../dist/packages-dist/platform-browser/testing/index.js',
|
||||
dest: '../../../dist/packages-dist/platform-browser/bundles/platform-browser-testing.umd.js',
|
||||
format: 'umd',
|
||||
moduleName: 'ng.platformBrowser.testing',
|
||||
globals: {
|
||||
'@angular/core': 'ng.core',
|
||||
'@angular/common': 'ng.common',
|
||||
'@angular/platform-browser': 'ng.platformBrowser',
|
||||
'rxjs/Subject': 'Rx',
|
||||
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
|
||||
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
|
||||
'rxjs/Observable': 'Rx'
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
|
||||
export default {
|
||||
entry: '../../../dist/packages-dist/platform-browser/esm/index.js',
|
||||
dest: '../../../dist/packages-dist/platform-browser/esm/platform-browser.umd.js',
|
||||
entry: '../../../dist/packages-dist/platform-browser/index.js',
|
||||
dest: '../../../dist/packages-dist/platform-browser/bundles/platform-browser.umd.js',
|
||||
format: 'umd',
|
||||
moduleName: 'ng.platformBrowser',
|
||||
globals: {
|
||||
@ -11,8 +11,5 @@ export default {
|
||||
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
|
||||
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
|
||||
'rxjs/Observable': 'Rx'
|
||||
},
|
||||
plugins: [
|
||||
// nodeResolve({ jsnext: true, main: true }),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
import {CommonModule, PlatformLocation} from '@angular/common';
|
||||
import {ApplicationModule, ClassProvider, ErrorHandler, ExistingProvider, FactoryProvider, NgModule, Optional, PLATFORM_INITIALIZER, PlatformRef, Provider, RootRenderer, Sanitizer, SkipSelf, Testability, TypeProvider, ValueProvider, createPlatformFactory, platformCore} from '@angular/core';
|
||||
|
||||
import {wtfInit} from '../core_private';
|
||||
import {AnimationDriver} from '../src/dom/animation_driver';
|
||||
import {WebAnimationsDriver} from '../src/dom/web_animations_driver';
|
||||
|
||||
@ -51,7 +50,6 @@ export const platformBrowser =
|
||||
|
||||
export function initDomAdapter() {
|
||||
BrowserDomAdapter.makeCurrent();
|
||||
wtfInit();
|
||||
BrowserGetTestability.init();
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ export class BrowserDomAdapter extends GenericBrowserDomAdapter {
|
||||
isCommentNode(node: Node): boolean { return node.nodeType === Node.COMMENT_NODE; }
|
||||
isElementNode(node: Node): boolean { return node.nodeType === Node.ELEMENT_NODE; }
|
||||
hasShadowRoot(node: any /** TODO #9100 */): boolean {
|
||||
return node instanceof HTMLElement && isPresent(node.shadowRoot);
|
||||
return isPresent(node.shadowRoot) && node instanceof HTMLElement;
|
||||
}
|
||||
isShadowRoot(node: any /** TODO #9100 */): boolean { return node instanceof DocumentFragment; }
|
||||
importIntoDoc(node: Node): any {
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
import {AnimationPlayer} from '@angular/core';
|
||||
|
||||
import {AnimationKeyframe, AnimationStyles, NoOpAnimationPlayer} from '../../core_private';
|
||||
import {AnimationKeyframe, AnimationStyles, NoOpAnimationPlayer} from '../private_import_core';
|
||||
|
||||
class _NoOpAnimationDriver implements AnimationDriver {
|
||||
animate(
|
||||
|
@ -8,8 +8,8 @@
|
||||
|
||||
import {ApplicationRef, DebugNode, NgZone, Optional, Provider, RootRenderer, getDebugNode, isDevMode} from '@angular/core';
|
||||
|
||||
import {DebugDomRootRenderer} from '../../../core_private';
|
||||
import {StringMapWrapper} from '../../facade/collection';
|
||||
import {DebugDomRootRenderer} from '../../private_import_core';
|
||||
import {getDOM} from '../dom_adapter';
|
||||
import {DomRootRenderer} from '../dom_renderer';
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
import {Inject, Injectable, OpaqueToken, RenderComponentType, Renderer, RootRenderer, ViewEncapsulation} from '@angular/core';
|
||||
|
||||
import {AnimationKeyframe, AnimationPlayer, AnimationStyles, RenderDebugInfo} from '../../core_private';
|
||||
import {StringMapWrapper} from '../facade/collection';
|
||||
import {Json, StringWrapper, isArray, isBlank, isPresent, isString, stringify} from '../facade/lang';
|
||||
import {AnimationKeyframe, AnimationPlayer, AnimationStyles, RenderDebugInfo} from '../private_import_core';
|
||||
|
||||
import {AnimationDriver} from './animation_driver';
|
||||
import {getDOM} from './dom_adapter';
|
||||
|
@ -8,9 +8,10 @@
|
||||
|
||||
import {AUTO_STYLE} from '@angular/core';
|
||||
|
||||
import {AnimationKeyframe, AnimationPlayer, AnimationStyles, NoOpAnimationPlayer} from '../../core_private';
|
||||
import {StringMapWrapper} from '../facade/collection';
|
||||
import {StringWrapper, isNumber, isPresent} from '../facade/lang';
|
||||
import {AnimationKeyframe, AnimationPlayer, AnimationStyles, NoOpAnimationPlayer} from '../private_import_core';
|
||||
|
||||
import {AnimationDriver} from './animation_driver';
|
||||
import {DomAnimatePlayer} from './dom_animate_player';
|
||||
import {dashCaseToCamelCase} from './util';
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
import {AUTO_STYLE} from '@angular/core';
|
||||
|
||||
import {AnimationPlayer} from '../../core_private';
|
||||
import {StringMapWrapper} from '../facade/collection';
|
||||
import {isPresent} from '../facade/lang';
|
||||
import {AnimationPlayer} from '../private_import_core';
|
||||
|
||||
import {getDOM} from './dom_adapter';
|
||||
import {DomAnimatePlayer} from './dom_animate_player';
|
||||
|
31
modules/@angular/platform-browser/src/platform-browser.ts
Normal file
31
modules/@angular/platform-browser/src/platform-browser.ts
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. 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
|
||||
*/
|
||||
|
||||
export {BrowserModule, platformBrowser} from './browser';
|
||||
export {BrowserPlatformLocation} from './browser/location/browser_platform_location';
|
||||
export {Title} from './browser/title';
|
||||
export {disableDebugTools, enableDebugTools} from './browser/tools/tools';
|
||||
export {AnimationDriver} from './dom/animation_driver';
|
||||
export {By} from './dom/debug/by';
|
||||
export {DOCUMENT} from './dom/dom_tokens';
|
||||
export {EVENT_MANAGER_PLUGINS, EventManager} from './dom/events/event_manager';
|
||||
export {HAMMER_GESTURE_CONFIG, HammerGestureConfig} from './dom/events/hammer_gestures';
|
||||
export {DomSanitizer, SafeHtml, SafeResourceUrl, SafeScript, SafeStyle, SafeUrl} from './security/dom_sanitization_service';
|
||||
// Web Workers
|
||||
export {ClientMessageBroker, ClientMessageBrokerFactory, FnArg, UiArguments} from './web_workers/shared/client_message_broker';
|
||||
export {PRIMITIVE} from './web_workers/shared/serializer';
|
||||
export {ReceivedMessage, ServiceMessageBroker, ServiceMessageBrokerFactory} from './web_workers/shared/service_message_broker';
|
||||
|
||||
export * from './web_workers/shared/message_bus';
|
||||
export {WORKER_APP_LOCATION_PROVIDERS} from './web_workers/worker/location_providers';
|
||||
export {WORKER_UI_LOCATION_PROVIDERS} from './web_workers/ui/location_providers';
|
||||
|
||||
export {NgProbeToken} from './dom/debug/ng_probe';
|
||||
export {platformWorkerUi, WebWorkerInstance, WORKER_SCRIPT, WORKER_UI_STARTABLE_MESSAGING_SERVICE} from './worker_render';
|
||||
export {platformWorkerApp, WorkerAppModule} from './worker_app';
|
||||
export * from './private_export';
|
48
modules/@angular/platform-browser/src/private_export.ts
Normal file
48
modules/@angular/platform-browser/src/private_export.ts
Normal file
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. 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
|
||||
*/
|
||||
import {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ValueProvider} from '@angular/core';
|
||||
|
||||
import * as browser from './browser';
|
||||
import * as browserDomAdapter from './browser/browser_adapter';
|
||||
import * as ng_probe from './dom/debug/ng_probe';
|
||||
import * as dom_adapter from './dom/dom_adapter';
|
||||
import * as dom_renderer from './dom/dom_renderer';
|
||||
import * as dom_events from './dom/events/dom_events';
|
||||
import * as shared_styles_host from './dom/shared_styles_host';
|
||||
|
||||
export var __platform_browser_private__: {
|
||||
_DomAdapter?: typeof dom_adapter.DomAdapter; DomAdapter: typeof dom_adapter.DomAdapter;
|
||||
_BrowserDomAdapter?: typeof browserDomAdapter.BrowserDomAdapter;
|
||||
BrowserDomAdapter: typeof browserDomAdapter.BrowserDomAdapter;
|
||||
getDOM: typeof dom_adapter.getDOM;
|
||||
setRootDomAdapter: typeof dom_adapter.setRootDomAdapter;
|
||||
_DomRootRenderer_?: typeof dom_renderer.DomRootRenderer;
|
||||
DomRootRenderer_: typeof dom_renderer.DomRootRenderer_;
|
||||
_DomSharedStylesHost?: typeof shared_styles_host.DomSharedStylesHost;
|
||||
DomSharedStylesHost: typeof shared_styles_host.DomSharedStylesHost;
|
||||
_SharedStylesHost?: typeof shared_styles_host.SharedStylesHost;
|
||||
SharedStylesHost: typeof shared_styles_host.SharedStylesHost;
|
||||
ELEMENT_PROBE_PROVIDERS: typeof ng_probe.ELEMENT_PROBE_PROVIDERS;
|
||||
_DomEventsPlugin?: typeof dom_events.DomEventsPlugin;
|
||||
DomEventsPlugin: typeof dom_events.DomEventsPlugin;
|
||||
_initDomAdapter?: typeof browser.initDomAdapter,
|
||||
initDomAdapter: typeof browser.initDomAdapter,
|
||||
INTERNAL_BROWSER_PLATFORM_PROVIDERS: typeof browser.INTERNAL_BROWSER_PLATFORM_PROVIDERS;
|
||||
} = {
|
||||
DomAdapter: dom_adapter.DomAdapter,
|
||||
BrowserDomAdapter: browserDomAdapter.BrowserDomAdapter,
|
||||
getDOM: dom_adapter.getDOM,
|
||||
setRootDomAdapter: dom_adapter.setRootDomAdapter,
|
||||
DomRootRenderer_: dom_renderer.DomRootRenderer_,
|
||||
DomSharedStylesHost: shared_styles_host.DomSharedStylesHost,
|
||||
SharedStylesHost: shared_styles_host.SharedStylesHost,
|
||||
ELEMENT_PROBE_PROVIDERS: ng_probe.ELEMENT_PROBE_PROVIDERS,
|
||||
DomEventsPlugin: dom_events.DomEventsPlugin,
|
||||
initDomAdapter: browser.initDomAdapter,
|
||||
INTERNAL_BROWSER_PLATFORM_PROVIDERS: browser.INTERNAL_BROWSER_PLATFORM_PROVIDERS
|
||||
};
|
@ -6,36 +6,31 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {__core_private__ as r, __core_private_types__ as types} from '@angular/core';
|
||||
import {__core_private__ as r} from '@angular/core';
|
||||
|
||||
export declare let _browser_core_private_types: types;
|
||||
|
||||
export type RenderDebugInfo = typeof _browser_core_private_types.RenderDebugInfo;
|
||||
export type RenderDebugInfo = typeof r._RenderDebugInfo;
|
||||
export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
|
||||
export var wtfInit: typeof r.wtfInit = r.wtfInit;
|
||||
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
|
||||
export var VIEW_ENCAPSULATION_VALUES: typeof r.VIEW_ENCAPSULATION_VALUES =
|
||||
r.VIEW_ENCAPSULATION_VALUES;
|
||||
export type DebugDomRootRenderer = typeof _browser_core_private_types.DebugDomRootRenderer;
|
||||
export type DebugDomRootRenderer = typeof r._DebugDomRootRenderer;
|
||||
export var DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer;
|
||||
export var reflector: typeof r.reflector = r.reflector;
|
||||
|
||||
export type NoOpAnimationPlayer = typeof _browser_core_private_types.NoOpAnimationPlayer;
|
||||
export type NoOpAnimationPlayer = typeof r._NoOpAnimationPlayer;
|
||||
export var NoOpAnimationPlayer: typeof r.NoOpAnimationPlayer = r.NoOpAnimationPlayer;
|
||||
export type AnimationPlayer = typeof _browser_core_private_types.AnimationPlayer;
|
||||
export type AnimationPlayer = typeof r._AnimationPlayer;
|
||||
export var AnimationPlayer: typeof r.AnimationPlayer = r.AnimationPlayer;
|
||||
export type AnimationSequencePlayer = typeof _browser_core_private_types.AnimationSequencePlayer;
|
||||
export type AnimationSequencePlayer = typeof r._AnimationSequencePlayer;
|
||||
export var AnimationSequencePlayer: typeof r.AnimationSequencePlayer = r.AnimationSequencePlayer;
|
||||
export type AnimationGroupPlayer = typeof _browser_core_private_types.AnimationGroupPlayer;
|
||||
export type AnimationGroupPlayer = typeof r._AnimationGroupPlayer;
|
||||
export var AnimationGroupPlayer: typeof r.AnimationGroupPlayer = r.AnimationGroupPlayer;
|
||||
export type AnimationKeyframe = typeof _browser_core_private_types.AnimationKeyframe;
|
||||
export type AnimationKeyframe = typeof r._AnimationKeyframe;
|
||||
export var AnimationKeyframe: typeof r.AnimationKeyframe = r.AnimationKeyframe;
|
||||
export type AnimationStyles = typeof _browser_core_private_types.AnimationStyles;
|
||||
export type AnimationStyles = typeof r._AnimationStyles;
|
||||
export var AnimationStyles: typeof r.AnimationStyles = r.AnimationStyles;
|
||||
export var prepareFinalAnimationStyles: typeof r.prepareFinalAnimationStyles =
|
||||
r.prepareFinalAnimationStyles;
|
||||
export var balanceAnimationKeyframes: typeof r.balanceAnimationKeyframes =
|
||||
r.balanceAnimationKeyframes;
|
||||
export var flattenStyles: typeof r.flattenStyles = r.flattenStyles;
|
||||
export var clearStyles: typeof r.clearStyles = r.clearStyles;
|
||||
export var collectAndResolveStyles: typeof r.collectAndResolveStyles = r.collectAndResolveStyles;
|
@ -8,9 +8,10 @@
|
||||
|
||||
import {Injectable, RenderComponentType, Type, ViewEncapsulation} from '@angular/core';
|
||||
|
||||
import {VIEW_ENCAPSULATION_VALUES} from '../../../core_private';
|
||||
import {Map, MapWrapper, StringMapWrapper} from '../../facade/collection';
|
||||
import {isArray, isPresent, serializeEnum} from '../../facade/lang';
|
||||
import {VIEW_ENCAPSULATION_VALUES} from '../../private_import_core';
|
||||
|
||||
import {RenderStore} from './render_store';
|
||||
import {LocationType} from './serialized_types';
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
import {Injectable, RenderComponentType, Renderer, RootRenderer, ViewEncapsulation} from '@angular/core';
|
||||
|
||||
import {AnimationKeyframe, AnimationPlayer, AnimationStyles, RenderDebugInfo} from '../../../core_private';
|
||||
import {ListWrapper} from '../../facade/collection';
|
||||
import {isBlank, isPresent} from '../../facade/lang';
|
||||
import {AnimationKeyframe, AnimationPlayer, AnimationStyles, RenderDebugInfo} from '../../private_import_core';
|
||||
import {ClientMessageBrokerFactory, FnArg, UiArguments} from '../shared/client_message_broker';
|
||||
import {MessageBus} from '../shared/message_bus';
|
||||
import {EVENT_CHANNEL, RENDERER_CHANNEL} from '../shared/messaging_api';
|
||||
|
@ -7,7 +7,8 @@
|
||||
*/
|
||||
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {APP_INITIALIZER, ApplicationModule, ClassProvider, ErrorHandler, ExistingProvider, FactoryProvider, NgModule, NgZone, OpaqueToken, PlatformRef, ReflectiveInjector, RootRenderer, TypeProvider, ValueProvider, assertPlatform, createPlatform, createPlatformFactory, getPlatform, platformCore} from '@angular/core';
|
||||
import {APP_INITIALIZER, ApplicationModule, ClassProvider, ErrorHandler, ExistingProvider, FactoryProvider, NgModule, NgZone, PlatformRef, Provider, RootRenderer, TypeProvider, ValueProvider, createPlatformFactory, platformCore} from '@angular/core';
|
||||
|
||||
import {BROWSER_SANITIZATION_PROVIDERS} from './browser';
|
||||
import {print} from './facade/lang';
|
||||
import {ON_WEB_WORKER} from './web_workers/shared/api';
|
||||
@ -21,6 +22,7 @@ import {WebWorkerRootRenderer} from './web_workers/worker/renderer';
|
||||
import {WorkerDomAdapter} from './web_workers/worker/worker_adapter';
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
|
@ -8,8 +8,6 @@
|
||||
|
||||
import {ClassProvider, ErrorHandler, ExistingProvider, FactoryProvider, Injectable, Injector, NgZone, OpaqueToken, PLATFORM_INITIALIZER, PlatformRef, Provider, RootRenderer, Testability, TypeProvider, ValueProvider, createPlatformFactory, isDevMode, platformCore} from '@angular/core';
|
||||
|
||||
import {wtfInit} from '../core_private';
|
||||
|
||||
import {BROWSER_SANITIZATION_PROVIDERS} from './browser';
|
||||
import {BrowserDomAdapter} from './browser/browser_adapter';
|
||||
import {BrowserGetTestability} from './browser/testability';
|
||||
@ -121,7 +119,6 @@ function messageBusFactory(instance: WebWorkerInstance): MessageBus {
|
||||
function initWebWorkerRenderPlatform(injector: Injector): () => void {
|
||||
return () => {
|
||||
BrowserDomAdapter.makeCurrent();
|
||||
wtfInit();
|
||||
BrowserGetTestability.init();
|
||||
var scriptUri: string;
|
||||
try {
|
||||
|
@ -9,11 +9,11 @@
|
||||
import {beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
|
||||
import {el} from '@angular/platform-browser/testing/browser_util';
|
||||
|
||||
import {AnimationKeyframe, AnimationStyles} from '../../core_private';
|
||||
import {DomAnimatePlayer} from '../../src/dom/dom_animate_player';
|
||||
import {WebAnimationsDriver} from '../../src/dom/web_animations_driver';
|
||||
import {WebAnimationsPlayer} from '../../src/dom/web_animations_player';
|
||||
import {StringMapWrapper} from '../../src/facade/collection';
|
||||
import {AnimationKeyframe, AnimationStyles} from '../../src/private_import_core';
|
||||
import {MockDomAnimatePlayer} from '../../testing/mock_dom_animate_player';
|
||||
|
||||
class ExtendedWebAnimationsDriver extends WebAnimationsDriver {
|
||||
|
@ -10,7 +10,6 @@ import {Component, ComponentRef, Injectable, Injector} from '@angular/core';
|
||||
import {DebugDomRootRenderer} from '@angular/core/src/debug/debug_renderer';
|
||||
import {RootRenderer} from '@angular/core/src/render/api';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
import {platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
import {DomRootRenderer, DomRootRenderer_} from '@angular/platform-browser/src/dom/dom_renderer';
|
||||
import {ClientMessageBrokerFactory, ClientMessageBrokerFactory_} from '@angular/platform-browser/src/web_workers/shared/client_message_broker';
|
||||
@ -19,10 +18,11 @@ import {Serializer} from '@angular/platform-browser/src/web_workers/shared/seria
|
||||
import {ServiceMessageBrokerFactory_} from '@angular/platform-browser/src/web_workers/shared/service_message_broker';
|
||||
import {MessageBasedRenderer} from '@angular/platform-browser/src/web_workers/ui/renderer';
|
||||
import {WebWorkerRootRenderer} from '@angular/platform-browser/src/web_workers/worker/renderer';
|
||||
import {BrowserTestingModule} from '@angular/platform-browser/testing';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
import {platformBrowserDynamicTesting} from '../../../../platform-browser-dynamic/testing';
|
||||
import {dispatchEvent} from '../../../../platform-browser/testing/browser_util';
|
||||
import {BrowserTestingModule} from '../../../testing';
|
||||
import {PairedMessageBuses, createPairedMessageBuses} from '../shared/web_worker_test_util';
|
||||
|
||||
export function main() {
|
||||
|
@ -7,9 +7,9 @@
|
||||
*/
|
||||
|
||||
|
||||
import {BrowserDomAdapter} from '../src/browser/browser_adapter';
|
||||
import {document, window} from '../src/facade/browser';
|
||||
import {NumberWrapper, isBlank} from '../src/facade/lang';
|
||||
import {document, window} from './facade/browser';
|
||||
import {NumberWrapper, isBlank} from './facade/lang';
|
||||
import {BrowserDomAdapter} from './private_import_platform-browser';
|
||||
|
||||
var DOM = new BrowserDomAdapter();
|
||||
|
||||
|
@ -5,15 +5,11 @@
|
||||
* 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
|
||||
*/
|
||||
|
||||
import {APP_ID, ClassProvider, ExistingProvider, FactoryProvider, NgModule, NgZone, PLATFORM_INITIALIZER, PlatformRef, Provider, TypeProvider, ValueProvider, createPlatformFactory, platformCore} from '@angular/core';
|
||||
|
||||
import {BrowserModule} from '../src/browser';
|
||||
import {BrowserDomAdapter} from '../src/browser/browser_adapter';
|
||||
import {AnimationDriver} from '../src/dom/animation_driver';
|
||||
import {ELEMENT_PROBE_PROVIDERS} from '../src/dom/debug/ng_probe';
|
||||
import {AnimationDriver, BrowserModule} from '@angular/platform-browser';
|
||||
|
||||
import {BrowserDetection, createNgZone} from './browser_util';
|
||||
import {BrowserDomAdapter, ELEMENT_PROBE_PROVIDERS} from './private_import_platform-browser';
|
||||
|
||||
function initBrowserTests() {
|
||||
BrowserDomAdapter.makeCurrent();
|
||||
|
@ -7,9 +7,10 @@
|
||||
*/
|
||||
|
||||
import {NgZone} from '@angular/core';
|
||||
import {getDOM} from '../src/dom/dom_adapter';
|
||||
import {ListWrapper} from '../src/facade/collection';
|
||||
import {RegExp, StringWrapper, global, isPresent, isString} from '../src/facade/lang';
|
||||
|
||||
import {ListWrapper} from './facade/collection';
|
||||
import {RegExp, StringWrapper, global, isPresent, isString} from './facade/lang';
|
||||
import {getDOM} from './private_import_platform-browser';
|
||||
|
||||
export class BrowserDetection {
|
||||
private _overrideUa: string;
|
||||
|
1
modules/@angular/platform-browser/testing/facade
Symbolic link
1
modules/@angular/platform-browser/testing/facade
Symbolic link
@ -0,0 +1 @@
|
||||
../../facade/src
|
@ -6,4 +6,9 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export * from './testing/browser';
|
||||
/**
|
||||
* @module
|
||||
* @description
|
||||
* Entry point for all public APIs of the platform-browser/testing package.
|
||||
*/
|
||||
export * from './browser';
|
@ -6,9 +6,10 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {getDOM} from '../src/dom/dom_adapter';
|
||||
import {StringMapWrapper} from '../src/facade/collection';
|
||||
import {global, isString} from '../src/facade/lang';
|
||||
import {StringMapWrapper} from './facade/collection';
|
||||
import {global, isString} from './facade/lang';
|
||||
import {getDOM} from './private_import_platform-browser';
|
||||
|
||||
|
||||
/**
|
||||
* Jasmine matchers that check Angular specific conditions.
|
||||
|
@ -8,10 +8,10 @@
|
||||
|
||||
import {AnimationPlayer} from '@angular/core';
|
||||
import {MockAnimationPlayer} from '@angular/core/testing/testing_internal';
|
||||
import {AnimationDriver} from '@angular/platform-browser';
|
||||
|
||||
import {AnimationKeyframe, AnimationStyles} from '../core_private';
|
||||
import {AnimationDriver} from '../src/dom/animation_driver';
|
||||
import {StringMapWrapper} from '../src/facade/collection';
|
||||
import {StringMapWrapper} from './facade/collection';
|
||||
import {AnimationKeyframe, AnimationStyles} from './private_import_core';
|
||||
|
||||
export class MockAnimationDriver extends AnimationDriver {
|
||||
public log: {[key: string]: any}[] = [];
|
||||
@ -39,8 +39,8 @@ function _serializeKeyframes(keyframes: AnimationKeyframe[]): any[] {
|
||||
|
||||
function _serializeStyles(styles: AnimationStyles): {[key: string]: any} {
|
||||
var flatStyles: {[key: string]: any} = {};
|
||||
styles.styles.forEach(entry => StringMapWrapper.forEach(entry, (val: any, prop: string) => {
|
||||
flatStyles[prop] = val;
|
||||
}));
|
||||
styles.styles.forEach((entry: {[key: string]: string | number;}) => {
|
||||
StringMapWrapper.forEach(entry, (val: any, prop: string) => { flatStyles[prop] = val; });
|
||||
});
|
||||
return flatStyles;
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. 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
|
||||
*/
|
||||
import {__core_private__ as r} from '@angular/core';
|
||||
|
||||
|
||||
export type RenderDebugInfo = typeof r._RenderDebugInfo;
|
||||
export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
|
||||
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
|
||||
export var reflector: typeof r.reflector = r.reflector;
|
||||
|
||||
export type NoOpAnimationPlayer = typeof r._NoOpAnimationPlayer;
|
||||
export var NoOpAnimationPlayer: typeof r.NoOpAnimationPlayer = r.NoOpAnimationPlayer;
|
||||
export type AnimationPlayer = typeof r._AnimationPlayer;
|
||||
export var AnimationPlayer: typeof r.AnimationPlayer = r.AnimationPlayer;
|
||||
export type AnimationSequencePlayer = typeof r._AnimationSequencePlayer;
|
||||
export var AnimationSequencePlayer: typeof r.AnimationSequencePlayer = r.AnimationSequencePlayer;
|
||||
export type AnimationGroupPlayer = typeof r._AnimationGroupPlayer;
|
||||
export var AnimationGroupPlayer: typeof r.AnimationGroupPlayer = r.AnimationGroupPlayer;
|
||||
export type AnimationKeyframe = typeof r._AnimationKeyframe;
|
||||
export var AnimationKeyframe: typeof r.AnimationKeyframe = r.AnimationKeyframe;
|
||||
export type AnimationStyles = typeof r._AnimationStyles;
|
||||
export var AnimationStyles: typeof r.AnimationStyles = r.AnimationStyles;
|
||||
export var prepareFinalAnimationStyles: typeof r.prepareFinalAnimationStyles =
|
||||
r.prepareFinalAnimationStyles;
|
||||
export var balanceAnimationKeyframes: typeof r.balanceAnimationKeyframes =
|
||||
r.balanceAnimationKeyframes;
|
||||
export var clearStyles: typeof r.clearStyles = r.clearStyles;
|
||||
export var collectAndResolveStyles: typeof r.collectAndResolveStyles = r.collectAndResolveStyles;
|
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. 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
|
||||
*/
|
||||
|
||||
import {__platform_browser_private__ as _} from '@angular/platform-browser';
|
||||
|
||||
export var getDOM: typeof _.getDOM = _.getDOM;
|
||||
export var BrowserDomAdapter: typeof _.BrowserDomAdapter = _.BrowserDomAdapter;
|
||||
export var ELEMENT_PROBE_PROVIDERS: typeof _.ELEMENT_PROBE_PROVIDERS = _.ELEMENT_PROBE_PROVIDERS;
|
@ -1,36 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"declaration": true,
|
||||
"stripInternal": true,
|
||||
"experimentalDecorators": true,
|
||||
"module": "es2015",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "../../../dist/packages-dist/platform-browser/esm",
|
||||
"paths": {
|
||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||
"@angular/common/testing": ["../../../dist/packages-dist/common/testing"],
|
||||
|
||||
// workaround for https://github.com/Microsoft/TypeScript/issues/8723
|
||||
// we can get rid of this once we update to typescript 1.9.0-dev.20160525-1.0 or newer
|
||||
"selenium-webdriver": ["../../../node_modules/@types/selenium-webdriver/index.d.ts"]
|
||||
},
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"target": "es2015"
|
||||
},
|
||||
"files": [
|
||||
"index.ts",
|
||||
"testing.ts",
|
||||
"../../../node_modules/@types/hammerjs/index.d.ts",
|
||||
"../../../node_modules/@types/jasmine/index.d.ts",
|
||||
"../../../node_modules/@types/protractor/index.d.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"strictMetadataEmit": true
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
"declaration": true,
|
||||
"stripInternal": true,
|
||||
"experimentalDecorators": true,
|
||||
"module": "commonjs",
|
||||
"module": "es2015",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "../../../dist/packages-dist/platform-browser/",
|
||||
"paths": {
|
||||
@ -12,20 +12,17 @@
|
||||
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
|
||||
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||
"@angular/common/testing": ["../../../dist/packages-dist/common/testing"],
|
||||
|
||||
// workaround for https://github.com/Microsoft/TypeScript/issues/8723
|
||||
// we can get rid of this once we update to typescript 1.9.0-dev.20160525-1.0 or newer
|
||||
"selenium-webdriver": ["../../../node_modules/@types/selenium-webdriver/index.d.ts"]
|
||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"]
|
||||
},
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"lib": ["es6", "dom"],
|
||||
"target": "es5"
|
||||
"target": "es5",
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"files": [
|
||||
"index.ts",
|
||||
"testing.ts",
|
||||
"testing/index.ts",
|
||||
"../../../node_modules/@types/hammerjs/index.d.ts",
|
||||
"../../../node_modules/@types/jasmine/index.d.ts",
|
||||
"../../../node_modules/@types/protractor/index.d.ts",
|
29
modules/@angular/platform-browser/tsconfig.json
Normal file
29
modules/@angular/platform-browser/tsconfig.json
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"declaration": true,
|
||||
"stripInternal": true,
|
||||
"experimentalDecorators": true,
|
||||
"module": "es2015",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "../../../dist/packages-dist/platform-browser",
|
||||
"paths": {
|
||||
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||
"@angular/common": ["../../../dist/packages-dist/common"]
|
||||
},
|
||||
"rootDir": ".",
|
||||
"sourceMap": true,
|
||||
"inlineSources": true,
|
||||
"target": "es5",
|
||||
"skipLibCheck": true,
|
||||
"lib": ["es2015", "dom"]
|
||||
},
|
||||
"files": [
|
||||
"index.ts",
|
||||
"../../../node_modules/@types/hammerjs/index.d.ts",
|
||||
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||
],
|
||||
"angularCompilerOptions": {
|
||||
"strictMetadataEmit": true
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user