parent
20acb86ca2
commit
5d403966d5
|
@ -63,7 +63,7 @@ import {
|
|||
} from 'angular2/src/render/render';
|
||||
import {ElementSchemaRegistry} from 'angular2/src/render/dom/schema/element_schema_registry';
|
||||
import {DomElementSchemaRegistry} from 'angular2/src/render/dom/schema/dom_element_schema_registry';
|
||||
import {Serializer} from "angular2/src/web-workers/shared/serializer";
|
||||
import {Serializer} from "angular2/src/web_workers/shared/serializer";
|
||||
import {Log} from './utils';
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,7 +3,7 @@ library angular2.src.web_workers.shared.isolate_message_bus;
|
|||
import 'dart:isolate';
|
||||
import 'dart:async';
|
||||
import 'dart:core';
|
||||
import 'package:angular2/src/web-workers/shared/message_bus.dart'
|
||||
import 'package:angular2/src/web_workers/shared/message_bus.dart'
|
||||
show MessageBus, MessageBusSink, MessageBusSource;
|
||||
import 'package:angular2/src/facade/async.dart';
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
import {EventEmitter} from 'angular2/src/facade/async';
|
||||
import {BaseException} from 'angular2/src/facade/lang';
|
||||
// TODO(jteplitz602): Replace both the interface and the exported class with an abstract class #3683
|
||||
|
||||
function _abstract() {
|
||||
throw new BaseException("This method is abstract");
|
||||
|
@ -11,21 +10,20 @@ function _abstract() {
|
|||
* Communication is based on a channel abstraction. Messages published in a
|
||||
* given channel to one MessageBusSink are received on the same channel
|
||||
* by the corresponding MessageBusSource.
|
||||
* TODO(jteplitz602): This should just extend both the source and the sink once
|
||||
* https://github.com/angular/ts2dart/issues/263 is closed.
|
||||
*/
|
||||
export interface MessageBusInterface {
|
||||
export /* abstract (with TS 1.6) */ class MessageBus implements MessageBusSource, MessageBusSink {
|
||||
/**
|
||||
* Returns an {@link EventEmitter} that emits every time a messsage
|
||||
* is received on the given channel.
|
||||
*/
|
||||
from(channel: string): EventEmitter;
|
||||
from(channel: string): EventEmitter { throw _abstract(); }
|
||||
|
||||
|
||||
/**
|
||||
* Returns an {@link EventEmitter} for the given channel
|
||||
* To publish methods to that channel just call next (or add in dart) on the returned emitter
|
||||
*/
|
||||
to(channel: string): EventEmitter;
|
||||
to(channel: string): EventEmitter { throw _abstract(); }
|
||||
}
|
||||
|
||||
export interface MessageBusSource {
|
||||
|
@ -43,10 +41,3 @@ export interface MessageBusSink {
|
|||
*/
|
||||
to(channel: string): EventEmitter;
|
||||
}
|
||||
|
||||
// TODO(jteplitz602): Remove this class once we have abstract classes #3683
|
||||
export class MessageBus implements MessageBusInterface {
|
||||
from(channel: string): EventEmitter { throw _abstract(); }
|
||||
|
||||
to(channel: string): EventEmitter { throw _abstract(); }
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
import {
|
||||
MessageBusInterface,
|
||||
MessageBus,
|
||||
MessageBusSource,
|
||||
MessageBusSink
|
||||
} from "angular2/src/web-workers/shared/message_bus";
|
||||
} from "angular2/src/web_workers/shared/message_bus";
|
||||
import {EventEmitter} from 'angular2/src/facade/async';
|
||||
import {StringMap, StringMapWrapper} from 'angular2/src/facade/collection';
|
||||
import {Injectable} from "angular2/di";
|
||||
|
@ -12,7 +12,7 @@ import {Injectable} from "angular2/di";
|
|||
* postMessage API.
|
||||
*/
|
||||
@Injectable()
|
||||
export class PostMessageBus implements MessageBusInterface {
|
||||
export class PostMessageBus implements MessageBus {
|
||||
constructor(private _sink: PostMessageBusSink, private _source: PostMessageBusSource) {}
|
||||
|
||||
from(channel: string): EventEmitter { return this._source.from(channel); }
|
|
@ -1,6 +1,6 @@
|
|||
import {Injectable, Inject} from "angular2/di";
|
||||
import {RenderProtoViewRef} from "angular2/src/render/api";
|
||||
import {ON_WEB_WORKER} from "angular2/src/web-workers/shared/api";
|
||||
import {ON_WEB_WORKER} from "angular2/src/web_workers/shared/api";
|
||||
|
||||
@Injectable()
|
||||
export class RenderProtoViewRefStore {
|
|
@ -1,6 +1,6 @@
|
|||
import {Injectable, Inject} from "angular2/di";
|
||||
import {RenderViewRef, RenderFragmentRef, RenderViewWithFragments} from "angular2/src/render/api";
|
||||
import {ON_WEB_WORKER} from "angular2/src/web-workers/shared/api";
|
||||
import {ON_WEB_WORKER} from "angular2/src/web_workers/shared/api";
|
||||
import {List, ListWrapper} from "angular2/src/facade/collection";
|
||||
|
||||
@Injectable()
|
|
@ -31,14 +31,14 @@ import {
|
|||
ViewEncapsulation,
|
||||
PropertyBindingType
|
||||
} from "angular2/src/render/api";
|
||||
import {WebWorkerElementRef} from 'angular2/src/web-workers/shared/api';
|
||||
import {WebWorkerElementRef} from 'angular2/src/web_workers/shared/api';
|
||||
import {AST, ASTWithSource} from 'angular2/src/change_detection/change_detection';
|
||||
import {Parser} from "angular2/src/change_detection/parser/parser";
|
||||
import {Injectable} from "angular2/di";
|
||||
import {RenderProtoViewRefStore} from 'angular2/src/web-workers/shared/render_proto_view_ref_store';
|
||||
import {RenderProtoViewRefStore} from 'angular2/src/web_workers/shared/render_proto_view_ref_store';
|
||||
import {
|
||||
RenderViewWithFragmentsStore
|
||||
} from 'angular2/src/web-workers/shared/render_view_with_fragments_store';
|
||||
} from 'angular2/src/web_workers/shared/render_view_with_fragments_store';
|
||||
|
||||
@Injectable()
|
||||
export class Serializer {
|
|
@ -3,10 +3,10 @@ library angular2.src.web_workers.ui;
|
|||
import 'dart:isolate';
|
||||
import 'dart:async';
|
||||
import 'dart:core';
|
||||
import 'package:angular2/src/web-workers/shared/message_bus.dart'
|
||||
import 'package:angular2/src/web_workers/shared/message_bus.dart'
|
||||
show MessageBus;
|
||||
import 'package:angular2/src/web-workers/ui/impl.dart' show bootstrapUICommon;
|
||||
import 'package:angular2/src/web-workers/shared/isolate_message_bus.dart';
|
||||
import 'package:angular2/src/web_workers/ui/impl.dart' show bootstrapUICommon;
|
||||
import 'package:angular2/src/web_workers/shared/isolate_message_bus.dart';
|
||||
|
||||
/**
|
||||
* Bootstrapping a WebWorker
|
|
@ -2,10 +2,10 @@ import {
|
|||
PostMessageBus,
|
||||
PostMessageBusSink,
|
||||
PostMessageBusSource
|
||||
} from 'angular2/src/web-workers/shared/post_message_bus';
|
||||
import {MessageBus} from 'angular2/src/web-workers/shared/message_bus';
|
||||
} from 'angular2/src/web_workers/shared/post_message_bus';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {BaseException} from "angular2/src/facade/lang";
|
||||
import {bootstrapUICommon} from "angular2/src/web-workers/ui/impl";
|
||||
import {bootstrapUICommon} from "angular2/src/web_workers/ui/impl";
|
||||
|
||||
/**
|
||||
* Bootstrapping a WebWorker
|
|
@ -52,19 +52,19 @@ import {UrlResolver} from 'angular2/src/services/url_resolver';
|
|||
import {Testability} from 'angular2/src/core/testability/testability';
|
||||
import {XHR} from 'angular2/src/render/xhr';
|
||||
import {XHRImpl} from 'angular2/src/render/xhr_impl';
|
||||
import {Serializer} from 'angular2/src/web-workers/shared/serializer';
|
||||
import {ON_WEB_WORKER} from 'angular2/src/web-workers/shared/api';
|
||||
import {RenderProtoViewRefStore} from 'angular2/src/web-workers/shared/render_proto_view_ref_store';
|
||||
import {Serializer} from 'angular2/src/web_workers/shared/serializer';
|
||||
import {ON_WEB_WORKER} from 'angular2/src/web_workers/shared/api';
|
||||
import {RenderProtoViewRefStore} from 'angular2/src/web_workers/shared/render_proto_view_ref_store';
|
||||
import {
|
||||
RenderViewWithFragmentsStore
|
||||
} from 'angular2/src/web-workers/shared/render_view_with_fragments_store';
|
||||
} from 'angular2/src/web_workers/shared/render_view_with_fragments_store';
|
||||
import {AnchorBasedAppRootUrl} from 'angular2/src/services/anchor_based_app_root_url';
|
||||
import {WebWorkerMain} from 'angular2/src/web-workers/ui/impl';
|
||||
import {MessageBus, MessageBusInterface} from 'angular2/src/web-workers/shared/message_bus';
|
||||
import {MessageBasedRenderCompiler} from 'angular2/src/web-workers/ui/render_compiler';
|
||||
import {MessageBasedRenderer} from 'angular2/src/web-workers/ui/renderer';
|
||||
import {MessageBasedXHRImpl} from 'angular2/src/web-workers/ui/xhr_impl';
|
||||
import {WebWorkerSetup} from 'angular2/src/web-workers/ui/setup';
|
||||
import {WebWorkerMain} from 'angular2/src/web_workers/ui/impl';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {MessageBasedRenderCompiler} from 'angular2/src/web_workers/ui/render_compiler';
|
||||
import {MessageBasedRenderer} from 'angular2/src/web_workers/ui/renderer';
|
||||
import {MessageBasedXHRImpl} from 'angular2/src/web_workers/ui/xhr_impl';
|
||||
import {WebWorkerSetup} from 'angular2/src/web_workers/ui/setup';
|
||||
|
||||
var _rootInjector: Injector;
|
||||
|
||||
|
@ -139,7 +139,7 @@ function _injectorBindings(): List<any> {
|
|||
];
|
||||
}
|
||||
|
||||
export function createInjector(zone: NgZone, bus: MessageBusInterface): Injector {
|
||||
export function createInjector(zone: NgZone, bus: MessageBus): Injector {
|
||||
BrowserDomAdapter.makeCurrent();
|
||||
_rootBindings.push(bind(NgZone).toValue(zone));
|
||||
_rootBindings.push(bind(MessageBus).toValue(bus));
|
|
@ -2,13 +2,13 @@ import {
|
|||
RenderViewRef,
|
||||
RenderEventDispatcher,
|
||||
} from 'angular2/src/render/api';
|
||||
import {Serializer} from 'angular2/src/web-workers/shared/serializer';
|
||||
import {Serializer} from 'angular2/src/web_workers/shared/serializer';
|
||||
import {
|
||||
serializeMouseEvent,
|
||||
serializeKeyboardEvent,
|
||||
serializeGenericEvent,
|
||||
serializeEventWithTarget
|
||||
} from 'angular2/src/web-workers/ui/event_serializer';
|
||||
} from 'angular2/src/web_workers/ui/event_serializer';
|
||||
import {BaseException} from "angular2/src/facade/lang";
|
||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
|
@ -6,15 +6,15 @@
|
|||
*/
|
||||
|
||||
import {createInjector} from "./di_bindings";
|
||||
import {MessageBus, MessageBusSink} from "angular2/src/web-workers/shared/message_bus";
|
||||
import {MessageBus, MessageBusSink} from "angular2/src/web_workers/shared/message_bus";
|
||||
import {createNgZone} from 'angular2/src/core/application_common';
|
||||
import {Injectable} from 'angular2/di';
|
||||
import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter';
|
||||
import {wtfInit} from 'angular2/src/profile/wtf_init';
|
||||
import {WebWorkerSetup} from 'angular2/src/web-workers/ui/setup';
|
||||
import {MessageBasedRenderCompiler} from 'angular2/src/web-workers/ui/render_compiler';
|
||||
import {MessageBasedRenderer} from 'angular2/src/web-workers/ui/renderer';
|
||||
import {MessageBasedXHRImpl} from 'angular2/src/web-workers/ui/xhr_impl';
|
||||
import {WebWorkerSetup} from 'angular2/src/web_workers/ui/setup';
|
||||
import {MessageBasedRenderCompiler} from 'angular2/src/web_workers/ui/render_compiler';
|
||||
import {MessageBasedRenderer} from 'angular2/src/web_workers/ui/renderer';
|
||||
import {MessageBasedXHRImpl} from 'angular2/src/web_workers/ui/xhr_impl';
|
||||
|
||||
/**
|
||||
* Creates a zone, sets up the DI bindings
|
|
@ -1,6 +1,6 @@
|
|||
import {Injectable} from 'angular2/di';
|
||||
import {MessageBus} from 'angular2/src/web-workers/shared/message_bus';
|
||||
import {Serializer} from 'angular2/src/web-workers/shared/serializer';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {Serializer} from 'angular2/src/web_workers/shared/serializer';
|
||||
import {
|
||||
RenderDirectiveMetadata,
|
||||
ProtoViewDto,
|
||||
|
@ -10,8 +10,8 @@ import {
|
|||
RenderCompiler
|
||||
} from 'angular2/src/render/api';
|
||||
import {EventEmitter, ObservableWrapper, PromiseWrapper, Promise} from 'angular2/src/facade/async';
|
||||
import {RENDER_COMPILER_CHANNEL} from 'angular2/src/web-workers/shared/messaging_api';
|
||||
import {ReceivedMessage} from 'angular2/src/web-workers/ui/impl';
|
||||
import {RENDER_COMPILER_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api';
|
||||
import {ReceivedMessage} from 'angular2/src/web_workers/ui/impl';
|
||||
import {BaseException, Type} from 'angular2/src/facade/lang';
|
||||
|
||||
// TODO(jteplitz602): Create parent UIComponent class #3703
|
|
@ -1,21 +1,21 @@
|
|||
import {Injectable} from 'angular2/di';
|
||||
import {MessageBus} from 'angular2/src/web-workers/shared/message_bus';
|
||||
import {Serializer} from 'angular2/src/web-workers/shared/serializer';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {Serializer} from 'angular2/src/web_workers/shared/serializer';
|
||||
import {
|
||||
RenderViewRef,
|
||||
RenderFragmentRef,
|
||||
RenderProtoViewRef,
|
||||
Renderer
|
||||
} from 'angular2/src/render/api';
|
||||
import {WebWorkerElementRef} from 'angular2/src/web-workers/shared/api';
|
||||
import {WebWorkerElementRef} from 'angular2/src/web_workers/shared/api';
|
||||
import {EventEmitter, ObservableWrapper, PromiseWrapper, Promise} from 'angular2/src/facade/async';
|
||||
import {EVENT_CHANNEL, RENDERER_CHANNEL} from 'angular2/src/web-workers/shared/messaging_api';
|
||||
import {ReceivedMessage} from 'angular2/src/web-workers/ui/impl';
|
||||
import {EVENT_CHANNEL, RENDERER_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api';
|
||||
import {ReceivedMessage} from 'angular2/src/web_workers/ui/impl';
|
||||
import {BaseException, Type} from 'angular2/src/facade/lang';
|
||||
import {EventDispatcher} from 'angular2/src/web-workers/ui/event_dispatcher';
|
||||
import {EventDispatcher} from 'angular2/src/web_workers/ui/event_dispatcher';
|
||||
import {
|
||||
RenderViewWithFragmentsStore
|
||||
} from 'angular2/src/web-workers/shared/render_view_with_fragments_store';
|
||||
} from 'angular2/src/web_workers/shared/render_view_with_fragments_store';
|
||||
|
||||
@Injectable()
|
||||
export class MessageBasedRenderer {
|
|
@ -1,6 +1,6 @@
|
|||
import {SETUP_CHANNEL} from 'angular2/src/web-workers/shared/messaging_api';
|
||||
import {SETUP_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api';
|
||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {MessageBus} from 'angular2/src/web-workers/shared/message_bus';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {AnchorBasedAppRootUrl} from 'angular2/src/services/anchor_based_app_root_url';
|
||||
import {Injectable} from 'angular2/di';
|
||||
|
||||
|
@ -17,4 +17,4 @@ export class WebWorkerSetup {
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
import {Injectable} from 'angular2/di';
|
||||
import {MessageBus} from 'angular2/src/web-workers/shared/message_bus';
|
||||
import {Serializer} from 'angular2/src/web-workers/shared/serializer';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {Serializer} from 'angular2/src/web_workers/shared/serializer';
|
||||
import {EventEmitter, ObservableWrapper, PromiseWrapper, Promise} from 'angular2/src/facade/async';
|
||||
import {XHR_CHANNEL} from 'angular2/src/web-workers/shared/messaging_api';
|
||||
import {ReceivedMessage} from 'angular2/src/web-workers/ui/impl';
|
||||
import {XHR_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api';
|
||||
import {ReceivedMessage} from 'angular2/src/web_workers/ui/impl';
|
||||
import {BaseException, Type} from 'angular2/src/facade/lang';
|
||||
import {XHR} from 'angular2/src/render/xhr';
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
library angular2.src.web_workers.worker;
|
||||
|
||||
import "package:angular2/src/web-workers/shared/isolate_message_bus.dart";
|
||||
import "package:angular2/src/web-workers/worker/application_common.dart"
|
||||
import "package:angular2/src/web_workers/shared/isolate_message_bus.dart";
|
||||
import "package:angular2/src/web_workers/worker/application_common.dart"
|
||||
show bootstrapWebWorkerCommon;
|
||||
import "package:angular2/src/facade/async.dart" show Future;
|
||||
import "package:angular2/src/core/application_ref.dart" show ApplicationRef;
|
|
@ -2,12 +2,12 @@ import {
|
|||
PostMessageBus,
|
||||
PostMessageBusSink,
|
||||
PostMessageBusSource
|
||||
} from 'angular2/src/web-workers/shared/post_message_bus';
|
||||
} from 'angular2/src/web_workers/shared/post_message_bus';
|
||||
import {Type, BaseException} from "angular2/src/facade/lang";
|
||||
import {Binding} from "angular2/di";
|
||||
import {Map} from 'angular2/src/facade/collection';
|
||||
import {Promise} from 'angular2/src/facade/async';
|
||||
import {bootstrapWebWorkerCommon} from "angular2/src/web-workers/worker/application_common";
|
||||
import {bootstrapWebWorkerCommon} from "angular2/src/web_workers/worker/application_common";
|
||||
import {ApplicationRef} from "angular2/src/core/application_ref";
|
||||
import {Injectable} from "angular2/di";
|
||||
|
|
@ -34,7 +34,7 @@ import {Promise, PromiseWrapper, PromiseCompleter} from 'angular2/src/facade/asy
|
|||
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
||||
import {LifeCycle} from 'angular2/src/core/life_cycle/life_cycle';
|
||||
import {XHR} from 'angular2/src/render/xhr';
|
||||
import {WebWorkerXHRImpl} from 'angular2/src/web-workers/worker/xhr_impl';
|
||||
import {WebWorkerXHRImpl} from 'angular2/src/web_workers/worker/xhr_impl';
|
||||
import {ComponentUrlMapper} from 'angular2/src/core/compiler/component_url_mapper';
|
||||
import {UrlResolver} from 'angular2/src/services/url_resolver';
|
||||
import {AppRootUrl} from 'angular2/src/services/app_root_url';
|
||||
|
@ -52,19 +52,19 @@ import {WebWorkerRenderer, WebWorkerCompiler} from './renderer';
|
|||
import {Renderer, RenderCompiler} from 'angular2/src/render/api';
|
||||
import {internalView} from 'angular2/src/core/compiler/view_ref';
|
||||
|
||||
import {MessageBrokerFactory} from 'angular2/src/web-workers/worker/broker';
|
||||
import {MessageBus, MessageBusInterface} from 'angular2/src/web-workers/shared/message_bus';
|
||||
import {MessageBrokerFactory} from 'angular2/src/web_workers/worker/broker';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {APP_COMPONENT_REF_PROMISE, APP_COMPONENT} from 'angular2/src/core/application_tokens';
|
||||
import {ApplicationRef} from 'angular2/src/core/application_ref';
|
||||
import {Serializer} from "angular2/src/web-workers/shared/serializer";
|
||||
import {ON_WEB_WORKER} from "angular2/src/web-workers/shared/api";
|
||||
import {RenderProtoViewRefStore} from 'angular2/src/web-workers/shared/render_proto_view_ref_store';
|
||||
import {Serializer} from "angular2/src/web_workers/shared/serializer";
|
||||
import {ON_WEB_WORKER} from "angular2/src/web_workers/shared/api";
|
||||
import {RenderProtoViewRefStore} from 'angular2/src/web_workers/shared/render_proto_view_ref_store';
|
||||
import {
|
||||
RenderViewWithFragmentsStore
|
||||
} from 'angular2/src/web-workers/shared/render_view_with_fragments_store';
|
||||
} from 'angular2/src/web_workers/shared/render_view_with_fragments_store';
|
||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {SETUP_CHANNEL} from 'angular2/src/web-workers/shared/messaging_api';
|
||||
import {WebWorkerEventDispatcher} from 'angular2/src/web-workers/worker/event_dispatcher';
|
||||
import {SETUP_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api';
|
||||
import {WebWorkerEventDispatcher} from 'angular2/src/web_workers/worker/event_dispatcher';
|
||||
|
||||
var _rootInjector: Injector;
|
||||
|
||||
|
@ -77,8 +77,8 @@ class PrintLogger {
|
|||
logGroupEnd() {}
|
||||
}
|
||||
|
||||
function _injectorBindings(appComponentType, bus: MessageBusInterface,
|
||||
initData: StringMap<string, any>): List<Type | Binding | List<any>> {
|
||||
function _injectorBindings(appComponentType, bus: MessageBus, initData: StringMap<string, any>):
|
||||
List<Type | Binding | List<any>> {
|
||||
var bestChangeDetection = new DynamicChangeDetection();
|
||||
if (PreGeneratedChangeDetection.isSupported()) {
|
||||
bestChangeDetection = new PreGeneratedChangeDetection();
|
||||
|
@ -142,7 +142,7 @@ function _injectorBindings(appComponentType, bus: MessageBusInterface,
|
|||
}
|
||||
|
||||
export function bootstrapWebWorkerCommon(
|
||||
appComponentType: Type, bus: MessageBusInterface,
|
||||
appComponentType: Type, bus: MessageBus,
|
||||
componentInjectableBindings: List<Type | Binding | List<any>> = null): Promise<ApplicationRef> {
|
||||
var bootstrapProcess: PromiseCompleter<any> = PromiseWrapper.completer();
|
||||
|
||||
|
@ -187,8 +187,8 @@ export function bootstrapWebWorkerCommon(
|
|||
}
|
||||
|
||||
function _createAppInjector(appComponentType: Type, bindings: List<Type | Binding | List<any>>,
|
||||
zone: NgZone, bus: MessageBusInterface,
|
||||
initData: StringMap<string, any>): Injector {
|
||||
zone: NgZone, bus: MessageBus, initData: StringMap<string, any>):
|
||||
Injector {
|
||||
if (isBlank(_rootInjector)) _rootInjector = Injector.resolveAndCreate(_rootBindings);
|
||||
var mergedBindings: any[] =
|
||||
isPresent(bindings) ?
|
|
@ -1,5 +1,5 @@
|
|||
/// <reference path="../../../globals.d.ts" />
|
||||
import {MessageBus} from "angular2/src/web-workers/shared/message_bus";
|
||||
import {MessageBus} from "angular2/src/web_workers/shared/message_bus";
|
||||
import {print, isPresent, DateWrapper, stringify} from "../../facade/lang";
|
||||
import {
|
||||
Promise,
|
||||
|
@ -9,7 +9,7 @@ import {
|
|||
EventEmitter
|
||||
} from "angular2/src/facade/async";
|
||||
import {ListWrapper, StringMapWrapper, MapWrapper} from "../../facade/collection";
|
||||
import {Serializer} from "angular2/src/web-workers/shared/serializer";
|
||||
import {Serializer} from "angular2/src/web_workers/shared/serializer";
|
||||
import {Injectable} from "angular2/di";
|
||||
import {Type} from "angular2/src/facade/lang";
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
import {Injectable} from 'angular2/di';
|
||||
import {Map, MapWrapper} from 'angular2/src/facade/collection';
|
||||
import {RenderViewRef, RenderEventDispatcher} from 'angular2/src/render/api';
|
||||
import {Serializer} from 'angular2/src/web-workers/shared/serializer';
|
||||
import {EVENT_CHANNEL} from 'angular2/src/web-workers/shared/messaging_api';
|
||||
import {MessageBus} from 'angular2/src/web-workers/shared/message_bus';
|
||||
import {Serializer} from 'angular2/src/web_workers/shared/serializer';
|
||||
import {EVENT_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {EventEmitter, ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {deserializeGenericEvent} from './event_deserializer';
|
||||
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
|
@ -18,19 +18,19 @@ import {
|
|||
MessageBrokerFactory,
|
||||
FnArg,
|
||||
UiArguments
|
||||
} from "angular2/src/web-workers/worker/broker";
|
||||
} from "angular2/src/web_workers/worker/broker";
|
||||
import {isPresent, print, BaseException} from "angular2/src/facade/lang";
|
||||
import {Injectable} from "angular2/di";
|
||||
import {
|
||||
RenderViewWithFragmentsStore,
|
||||
WebWorkerRenderViewRef
|
||||
} from 'angular2/src/web-workers/shared/render_view_with_fragments_store';
|
||||
import {WebWorkerElementRef} from 'angular2/src/web-workers/shared/api';
|
||||
} from 'angular2/src/web_workers/shared/render_view_with_fragments_store';
|
||||
import {WebWorkerElementRef} from 'angular2/src/web_workers/shared/api';
|
||||
import {
|
||||
RENDER_COMPILER_CHANNEL,
|
||||
RENDERER_CHANNEL
|
||||
} from 'angular2/src/web-workers/shared/messaging_api';
|
||||
import {WebWorkerEventDispatcher} from 'angular2/src/web-workers/worker/event_dispatcher';
|
||||
} from 'angular2/src/web_workers/shared/messaging_api';
|
||||
import {WebWorkerEventDispatcher} from 'angular2/src/web_workers/worker/event_dispatcher';
|
||||
|
||||
@Injectable()
|
||||
export class WebWorkerCompiler implements RenderCompiler {
|
|
@ -6,8 +6,8 @@ import {
|
|||
UiArguments,
|
||||
MessageBroker,
|
||||
MessageBrokerFactory
|
||||
} from 'angular2/src/web-workers/worker/broker';
|
||||
import {XHR_CHANNEL} from 'angular2/src/web-workers/shared/messaging_api';
|
||||
} from 'angular2/src/web_workers/worker/broker';
|
||||
import {XHR_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api';
|
||||
|
||||
/**
|
||||
* Implementation of render/xhr that relays XHR requests to the UI side where they are sent
|
|
@ -11,7 +11,7 @@ import {
|
|||
proxy
|
||||
} from 'angular2/test_lib';
|
||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {MessageBusInterface} from 'angular2/src/web-workers/shared/message_bus';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {createConnectedMessageBus} from './message_bus_util';
|
||||
|
||||
export function main() {
|
||||
|
@ -19,7 +19,7 @@ export function main() {
|
|||
* Tests the PostMessageBus in TypeScript and the IsolateMessageBus in Dart
|
||||
*/
|
||||
describe("MessageBus", () => {
|
||||
var bus: MessageBusInterface;
|
||||
var bus: MessageBus;
|
||||
|
||||
beforeEach(() => { bus = createConnectedMessageBus(); });
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
library angular2.test.web_workers.shared.message_bus_util;
|
||||
|
||||
import 'dart:isolate';
|
||||
import 'package:angular2/src/web-workers/shared/message_bus.dart'
|
||||
show MessageBusInterface;
|
||||
import 'package:angular2/src/web-workers/shared/isolate_message_bus.dart';
|
||||
import 'package:angular2/src/web_workers/shared/message_bus.dart'
|
||||
show MessageBus;
|
||||
import 'package:angular2/src/web_workers/shared/isolate_message_bus.dart';
|
||||
|
||||
/*
|
||||
* Returns an IsolateMessageBus thats sink is connected to its own source.
|
||||
* Useful for testing the sink and source.
|
||||
*/
|
||||
MessageBusInterface createConnectedMessageBus() {
|
||||
MessageBus createConnectedMessageBus() {
|
||||
var receivePort = new ReceivePort();
|
||||
var sendPort = receivePort.sendPort;
|
||||
|
|
@ -2,14 +2,14 @@ import {
|
|||
PostMessageBusSource,
|
||||
PostMessageBusSink,
|
||||
PostMessageBus
|
||||
} from 'angular2/src/web-workers/shared/post_message_bus';
|
||||
import {MessageBusInterface} from 'angular2/src/web-workers/shared/message_bus';
|
||||
} from 'angular2/src/web_workers/shared/post_message_bus';
|
||||
import {MessageBus} from 'angular2/src/web_workers/shared/message_bus';
|
||||
|
||||
/*
|
||||
* Returns a PostMessageBus thats sink is connected to its own source.
|
||||
* Useful for testing the sink and source.
|
||||
*/
|
||||
export function createConnectedMessageBus(): MessageBusInterface {
|
||||
export function createConnectedMessageBus(): MessageBus {
|
||||
var mockPostMessage = new MockPostMessage();
|
||||
var source = new PostMessageBusSource(<any>mockPostMessage);
|
||||
var sink = new PostMessageBusSink(mockPostMessage);
|
|
@ -1,6 +1,6 @@
|
|||
import {AsyncTestCompleter, inject, describe, it, expect} from "angular2/test_lib";
|
||||
import {RenderProtoViewRef} from "angular2/src/render/api";
|
||||
import {RenderProtoViewRefStore} from "angular2/src/web-workers/shared/render_proto_view_ref_store";
|
||||
import {RenderProtoViewRefStore} from "angular2/src/web_workers/shared/render_proto_view_ref_store";
|
||||
|
||||
export function main() {
|
||||
describe("RenderProtoViewRefStore", () => {
|
|
@ -4,7 +4,7 @@ import {
|
|||
RenderViewWithFragmentsStore,
|
||||
WebWorkerRenderViewRef,
|
||||
WebWorkerRenderFragmentRef
|
||||
} from "angular2/src/web-workers/shared/render_view_with_fragments_store";
|
||||
} from "angular2/src/web_workers/shared/render_view_with_fragments_store";
|
||||
import {List, ListWrapper} from "angular2/src/facade/collection";
|
||||
|
||||
export function main() {
|
|
@ -11,20 +11,20 @@ import {
|
|||
proxy
|
||||
} from 'angular2/test_lib';
|
||||
import {IMPLEMENTS} from 'angular2/src/facade/lang';
|
||||
import {Serializer} from 'angular2/src/web-workers/shared/serializer';
|
||||
import {Serializer} from 'angular2/src/web_workers/shared/serializer';
|
||||
import {NgZone} from 'angular2/src/core/zone/ng_zone';
|
||||
import {ON_WEB_WORKER} from 'angular2/src/web-workers/shared/api';
|
||||
import {ON_WEB_WORKER} from 'angular2/src/web_workers/shared/api';
|
||||
import {bind} from 'angular2/di';
|
||||
import {RenderProtoViewRefStore} from 'angular2/src/web-workers/shared/render_proto_view_ref_store';
|
||||
import {RenderProtoViewRefStore} from 'angular2/src/web_workers/shared/render_proto_view_ref_store';
|
||||
import {
|
||||
RenderViewWithFragmentsStore,
|
||||
WebWorkerRenderViewRef
|
||||
} from 'angular2/src/web-workers/shared/render_view_with_fragments_store';
|
||||
} from 'angular2/src/web_workers/shared/render_view_with_fragments_store';
|
||||
import {RenderEventDispatcher, RenderViewRef} from 'angular2/src/render/api';
|
||||
import {createPairedMessageBuses} from './worker_test_util';
|
||||
import {WebWorkerEventDispatcher} from 'angular2/src/web-workers/worker/event_dispatcher';
|
||||
import {WebWorkerEventDispatcher} from 'angular2/src/web_workers/worker/event_dispatcher';
|
||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {EVENT_CHANNEL} from 'angular2/src/web-workers/shared/messaging_api';
|
||||
import {EVENT_CHANNEL} from 'angular2/src/web_workers/shared/messaging_api';
|
||||
|
||||
export function main() {
|
||||
describe("EventDispatcher", () => {
|
|
@ -11,9 +11,9 @@ import {
|
|||
import {DOM} from 'angular2/src/dom/dom_adapter';
|
||||
import {DomTestbed, TestRootView, elRef} from '../../render/dom/dom_testbed';
|
||||
import {bind} from 'angular2/di';
|
||||
import {WebWorkerCompiler, WebWorkerRenderer} from "angular2/src/web-workers/worker/renderer";
|
||||
import {MessageBrokerFactory, UiArguments, FnArg} from "angular2/src/web-workers/worker/broker";
|
||||
import {Serializer} from "angular2/src/web-workers/shared/serializer";
|
||||
import {WebWorkerCompiler, WebWorkerRenderer} from "angular2/src/web_workers/worker/renderer";
|
||||
import {MessageBrokerFactory, UiArguments, FnArg} from "angular2/src/web_workers/worker/broker";
|
||||
import {Serializer} from "angular2/src/web_workers/shared/serializer";
|
||||
import {isPresent, isBlank, BaseException, Type} from "angular2/src/facade/lang";
|
||||
import {MapWrapper, ListWrapper} from "angular2/src/facade/collection";
|
||||
import {
|
||||
|
@ -29,16 +29,16 @@ import {
|
|||
import {
|
||||
RenderProtoViewRefStore,
|
||||
WebWorkerRenderProtoViewRef
|
||||
} from "angular2/src/web-workers/shared/render_proto_view_ref_store";
|
||||
} from "angular2/src/web_workers/shared/render_proto_view_ref_store";
|
||||
import {
|
||||
RenderViewWithFragmentsStore,
|
||||
WebWorkerRenderViewRef
|
||||
} from 'angular2/src/web-workers/shared/render_view_with_fragments_store';
|
||||
} from 'angular2/src/web_workers/shared/render_view_with_fragments_store';
|
||||
import {resolveInternalDomProtoView, DomProtoView} from 'angular2/src/render/dom/view/proto_view';
|
||||
import {someComponent} from '../../render/dom/dom_renderer_integration_spec';
|
||||
import {WebWorkerMain} from 'angular2/src/web-workers/ui/impl';
|
||||
import {MessageBasedRenderCompiler} from 'angular2/src/web-workers/ui/render_compiler';
|
||||
import {MessageBasedRenderer} from 'angular2/src/web-workers/ui/renderer';
|
||||
import {WebWorkerMain} from 'angular2/src/web_workers/ui/impl';
|
||||
import {MessageBasedRenderCompiler} from 'angular2/src/web_workers/ui/render_compiler';
|
||||
import {MessageBasedRenderer} from 'angular2/src/web_workers/ui/renderer';
|
||||
import {
|
||||
createPairedMessageBuses
|
||||
} from './worker_test_util'
|
|
@ -1,10 +1,9 @@
|
|||
import {StringMap, StringMapWrapper, ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {
|
||||
MessageBusInterface,
|
||||
MessageBusSink,
|
||||
MessageBusSource,
|
||||
MessageBus
|
||||
} from 'angular2/src/web-workers/shared/message_bus';
|
||||
} from 'angular2/src/web_workers/shared/message_bus';
|
||||
import {MockEventEmitter} from './mock_event_emitter';
|
||||
|
||||
/**
|
||||
|
@ -25,7 +24,7 @@ export function createPairedMessageBuses(): PairedMessageBuses {
|
|||
}
|
||||
|
||||
export class PairedMessageBuses {
|
||||
constructor(public ui: MessageBusInterface, public worker: MessageBusInterface) {}
|
||||
constructor(public ui: MessageBus, public worker: MessageBus) {}
|
||||
}
|
||||
|
||||
export class MockMessageBusSource implements MessageBusSource {
|
|
@ -15,8 +15,8 @@ import {
|
|||
MessageBroker,
|
||||
UiArguments,
|
||||
MessageBrokerFactory
|
||||
} from 'angular2/src/web-workers/worker/broker';
|
||||
import {WebWorkerXHRImpl} from "angular2/src/web-workers/worker/xhr_impl";
|
||||
} from 'angular2/src/web_workers/worker/broker';
|
||||
import {WebWorkerXHRImpl} from "angular2/src/web_workers/worker/xhr_impl";
|
||||
import {PromiseWrapper} from "angular2/src/facade/async";
|
||||
|
||||
export function main() {
|
|
@ -1,11 +1,11 @@
|
|||
library angular2.examples.message_broker.background_index;
|
||||
|
||||
import "package:angular2/src/web-workers/worker/broker.dart"
|
||||
import "package:angular2/src/web_workers/worker/broker.dart"
|
||||
show MessageBroker, UiArguments;
|
||||
import "package:angular2/src/web-workers/shared/serializer.dart"
|
||||
import "package:angular2/src/web_workers/shared/serializer.dart"
|
||||
show Serializer;
|
||||
import "package:angular2/src/web-workers/shared/isolate_message_bus.dart";
|
||||
import "package:angular2/src/web-workers/worker/application.dart"
|
||||
import "package:angular2/src/web_workers/shared/isolate_message_bus.dart";
|
||||
import "package:angular2/src/web_workers/worker/application.dart"
|
||||
show WebWorkerMessageBusSink;
|
||||
import "package:angular2/src/facade/async.dart";
|
||||
import "dart:isolate";
|
||||
|
|
|
@ -2,10 +2,10 @@ import {
|
|||
PostMessageBus,
|
||||
PostMessageBusSink,
|
||||
PostMessageBusSource
|
||||
} from 'angular2/src/web-workers/shared/post_message_bus';
|
||||
} from 'angular2/src/web_workers/shared/post_message_bus';
|
||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
||||
import {MessageBroker, UiArguments} from "angular2/src/web-workers/worker/broker";
|
||||
import {Serializer} from "angular2/src/web-workers/shared/serializer";
|
||||
import {MessageBroker, UiArguments} from "angular2/src/web_workers/worker/broker";
|
||||
import {Serializer} from "angular2/src/web_workers/shared/serializer";
|
||||
|
||||
interface PostMessageInterface {
|
||||
(message: any, transferrables?:[ArrayBuffer]): void;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
library angular2.examples.message_broker.index;
|
||||
|
||||
import "package:angular2/src/web-workers/ui/application.dart"
|
||||
import "package:angular2/src/web_workers/ui/application.dart"
|
||||
show spawnWebWorker;
|
||||
import "package:angular2/src/facade/async.dart";
|
||||
import "dart:html";
|
||||
|
|
|
@ -2,7 +2,7 @@ import {
|
|||
PostMessageBus,
|
||||
PostMessageBusSink,
|
||||
PostMessageBusSource
|
||||
} from 'angular2/src/web-workers/shared/post_message_bus';
|
||||
} from 'angular2/src/web_workers/shared/post_message_bus';
|
||||
import {ObservableWrapper} from 'angular2/src/facade/async';
|
||||
|
||||
var webWorker = new Worker("loader.js");
|
||||
|
|
|
@ -2,7 +2,7 @@ library examples.src.web_workers.images.background_index;
|
|||
|
||||
import "index_common.dart" show ImageDemo;
|
||||
import "dart:isolate";
|
||||
import "package:angular2/src/web-workers/worker/application.dart"
|
||||
import "package:angular2/src/web_workers/worker/application.dart"
|
||||
show bootstrapWebWorker;
|
||||
import "package:angular2/src/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/reflection/reflection.dart";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrapWebWorker} from "angular2/src/web-workers/worker/application";
|
||||
import {bootstrapWebWorker} from "angular2/src/web_workers/worker/application";
|
||||
import {ImageDemo} from "./index_common";
|
||||
|
||||
export function main() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
library angular2.examples.web_workers.images.index;
|
||||
|
||||
import "package:angular2/src/web-workers/ui/application.dart" show bootstrap;
|
||||
import "package:angular2/src/web_workers/ui/application.dart" show bootstrap;
|
||||
import "package:angular2/src/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/reflection/reflection.dart";
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
import {bootstrap} from "angular2/src/web-workers/ui/application";
|
||||
import {bootstrap} from "angular2/src/web_workers/ui/application";
|
||||
bootstrap("loader.js");
|
||||
|
|
|
@ -2,7 +2,7 @@ library examples.src.web_workers.kitchen_sink.background_index;
|
|||
|
||||
import "index_common.dart" show HelloCmp;
|
||||
import "dart:isolate";
|
||||
import "package:angular2/src/web-workers/worker/application.dart"
|
||||
import "package:angular2/src/web_workers/worker/application.dart"
|
||||
show bootstrapWebWorker;
|
||||
import "package:angular2/src/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/reflection/reflection.dart";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {HelloCmp} from "./index_common";
|
||||
import {bootstrapWebWorker} from "angular2/src/web-workers/worker/application";
|
||||
import {bootstrapWebWorker} from "angular2/src/web_workers/worker/application";
|
||||
|
||||
export function main() {
|
||||
bootstrapWebWorker(HelloCmp);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
library angular2.examples.web_workers.kitchen_sink.index;
|
||||
|
||||
import "package:angular2/src/web-workers/ui/application.dart" show bootstrap;
|
||||
import "package:angular2/src/web_workers/ui/application.dart" show bootstrap;
|
||||
import "package:angular2/src/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/reflection/reflection.dart";
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
import {bootstrap} from "angular2/src/web-workers/ui/application";
|
||||
bootstrap("loader.js");
|
||||
import {bootstrap} from "angular2/src/web_workers/ui/application";
|
||||
bootstrap("loader.js");
|
||||
|
|
|
@ -2,7 +2,7 @@ library examples.src.web_workers.todo.background_index;
|
|||
|
||||
import "index_common.dart" show TodoApp;
|
||||
import "dart:isolate";
|
||||
import "package:angular2/src/web-workers/worker/application.dart"
|
||||
import "package:angular2/src/web_workers/worker/application.dart"
|
||||
show bootstrapWebWorker;
|
||||
import "package:angular2/src/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/reflection/reflection.dart";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {bootstrapWebWorker} from "angular2/src/web-workers/worker/application";
|
||||
import {bootstrapWebWorker} from "angular2/src/web_workers/worker/application";
|
||||
import {TodoApp} from "./index_common";
|
||||
|
||||
export function main() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
library angular2.examples.web_workers.todo.index;
|
||||
|
||||
import "package:angular2/src/web-workers/ui/application.dart" show bootstrap;
|
||||
import "package:angular2/src/web_workers/ui/application.dart" show bootstrap;
|
||||
import "package:angular2/src/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/reflection/reflection.dart";
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
import {bootstrap} from "angular2/src/web-workers/ui/application";
|
||||
import {bootstrap} from "angular2/src/web_workers/ui/application";
|
||||
bootstrap("loader.js");
|
||||
|
|
Loading…
Reference in New Issue