fix(web_workers): support @AngularEntrypoint in web workers
And enable transformers on all playground apps Closes #6013
This commit is contained in:
@@ -19,20 +19,12 @@ transformers:
|
||||
- angular2:
|
||||
platform_directives: 'package:angular2/src/common/directives.dart#CORE_DIRECTIVES'
|
||||
entry_points:
|
||||
- web/src/animate/index.dart
|
||||
- web/src/async/index.dart
|
||||
- web/src/gestures/index.dart
|
||||
- web/src/hash_routing/index.dart
|
||||
- web/src/hello_world/index.dart
|
||||
- web/src/key_events/index.dart
|
||||
- web/src/sourcemap/index.dart
|
||||
- web/src/todo/index.dart
|
||||
- web/src/order_management/index.dart
|
||||
- web/src/model_driven_forms/index.dart
|
||||
- web/src/observable_models/index.dart
|
||||
- web/src/person_management/index.dart
|
||||
- web/src/routing/index.dart
|
||||
- web/src/template_driven_forms/index.dart
|
||||
- web/src/zippy_component/index.dart
|
||||
- web/src/relative_assets/index.dart
|
||||
- web/src/svg/index.dart
|
||||
- web/src/material/button/index.dart
|
||||
- web/src/material/checkbox/index.dart
|
||||
- web/src/material/dialog/index.dart
|
||||
@@ -41,25 +33,50 @@ transformers:
|
||||
- web/src/material/progress-linear/index.dart
|
||||
- web/src/material/radio/index.dart
|
||||
- web/src/material/switcher/index.dart
|
||||
|
||||
# These entrypoints are disabled untl the transformer supports UI bootstrap (issue #3971)
|
||||
# - web/src/web_workers/message_broker/index.dart
|
||||
# - web/src/web_workers/kitchen_sink/index.dart
|
||||
# - web/src/web_workers/todo/index.dart
|
||||
# - web/src/web_workers/todo/server_index.dart
|
||||
# - web/src/web_workers/todo/background_index.dart
|
||||
# - web/src/web_workers/message_broker/background_index.dart
|
||||
# - web/src/web_workers/kitchen_sink/background_index.dart
|
||||
#
|
||||
# This entrypoint is not needed:
|
||||
# - web/src/material/demo_common.dart
|
||||
- web/src/model_driven_forms/index.dart
|
||||
- web/src/observable_models/index.dart
|
||||
- web/src/order_management/index.dart
|
||||
- web/src/person_management/index.dart
|
||||
- web/src/relative_assets/index.dart
|
||||
- web/src/routing/index.dart
|
||||
- web/src/sourcemap/index.dart
|
||||
- web/src/svg/index.dart
|
||||
- web/src/template_driven_forms/index.dart
|
||||
- web/src/todo/index.dart
|
||||
- web/src/web_workers/kitchen_sink/background_index.dart
|
||||
- web/src/web_workers/kitchen_sink/index.dart
|
||||
- web/src/web_workers/message_broker/background_index.dart
|
||||
- web/src/web_workers/message_broker/index.dart
|
||||
- web/src/web_workers/todo/background_index.dart
|
||||
- web/src/web_workers/todo/index.dart
|
||||
- web/src/web_workers/todo/server_index.dart
|
||||
- web/src/zippy_component/index.dart
|
||||
|
||||
- $dart2js:
|
||||
$include:
|
||||
- web/src/**
|
||||
$exclude:
|
||||
# web worker code compiled separately; see below
|
||||
- web/src/web_workers/**
|
||||
minify: false
|
||||
commandLineOptions:
|
||||
- --show-package-warnings
|
||||
- --trust-type-annotations
|
||||
- --trust-primitives
|
||||
- --enable-experimental-mirrors
|
||||
# Uncomment to generate summaries from dart2js
|
||||
# - --dump-info
|
||||
- --show-package-warnings
|
||||
- --trust-type-annotations
|
||||
- --trust-primitives
|
||||
- --enable-experimental-mirrors
|
||||
- --fatal-warnings
|
||||
|
||||
# TODO(yjbanov): cannot use --fatal-warnings on web-worker code due to
|
||||
# dart2js bug https://github.com/dart-lang/sdk/issues/23875
|
||||
- $dart2js:
|
||||
$include:
|
||||
- web/src/web_workers/**
|
||||
$exclude:
|
||||
- web/src/web_workers/images/**
|
||||
- web/src/web_workers/todo/server_index.dart
|
||||
minify: false
|
||||
commandLineOptions:
|
||||
- --show-package-warnings
|
||||
- --trust-type-annotations
|
||||
- --trust-primitives
|
||||
- --enable-experimental-mirrors
|
||||
|
||||
@@ -4,11 +4,9 @@ import "index_common.dart" show HelloCmp;
|
||||
import "dart:isolate";
|
||||
import "package:angular2/platform/worker_app.dart";
|
||||
import "package:angular2/core.dart";
|
||||
import "package:angular2/src/core/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/core/reflection/reflection.dart";
|
||||
|
||||
@AngularEntrypoint()
|
||||
main(List<String> args, SendPort replyTo) {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
platform([WORKER_APP_PLATFORM, new Provider(RENDER_SEND_PORT, useValue: replyTo)])
|
||||
.application([WORKER_APP_APPLICATION])
|
||||
.bootstrap(HelloCmp);
|
||||
|
||||
@@ -2,11 +2,9 @@ library angular2.examples.web_workers.kitchen_sink.index;
|
||||
|
||||
import "package:angular2/platform/worker_render.dart";
|
||||
import "package:angular2/core.dart";
|
||||
import "package:angular2/src/core/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/core/reflection/reflection.dart";
|
||||
|
||||
@AngularEntrypoint()
|
||||
main() {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
platform([WORKER_RENDER_PLATFORM])
|
||||
.asyncApplication(initIsolate("background_index.dart"));
|
||||
}
|
||||
|
||||
@@ -2,13 +2,11 @@ library angular2.examples.message_broker.background_index;
|
||||
|
||||
import "package:angular2/platform/worker_app.dart";
|
||||
import "package:angular2/core.dart";
|
||||
import "package:angular2/src/core/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/core/reflection/reflection.dart";
|
||||
import "index_common.dart" show App;
|
||||
import "dart:isolate";
|
||||
|
||||
@AngularEntrypoint()
|
||||
main(List<String> args, SendPort replyTo) {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
platform([WORKER_APP_PLATFORM, new Provider(RENDER_SEND_PORT, useValue: replyTo)])
|
||||
.application([WORKER_APP_APPLICATION])
|
||||
.bootstrap(App);
|
||||
|
||||
@@ -2,12 +2,10 @@ library angular2.examples.message_broker.index;
|
||||
|
||||
import "package:angular2/platform/worker_render.dart";
|
||||
import "package:angular2/core.dart";
|
||||
import "package:angular2/src/core/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/core/reflection/reflection.dart";
|
||||
import "dart:html";
|
||||
|
||||
@AngularEntrypoint()
|
||||
main() {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
const ECHO_CHANNEL = "ECHO";
|
||||
platform([WORKER_RENDER_PLATFORM])
|
||||
.asyncApplication(initIsolate("background_index.dart"))
|
||||
|
||||
@@ -4,11 +4,9 @@ import "index_common.dart" show TodoApp;
|
||||
import "dart:isolate";
|
||||
import "package:angular2/platform/worker_app.dart";
|
||||
import "package:angular2/core.dart";
|
||||
import "package:angular2/src/core/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/core/reflection/reflection.dart";
|
||||
|
||||
@AngularEntrypoint()
|
||||
main(List<String> args, SendPort replyTo) {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
platform([WORKER_APP_PLATFORM, new Provider(RENDER_SEND_PORT, useValue: replyTo)])
|
||||
.application([WORKER_APP_APPLICATION])
|
||||
.bootstrap(TodoApp);
|
||||
|
||||
@@ -2,11 +2,9 @@ library angular2.examples.web_workers.todo.index;
|
||||
|
||||
import "package:angular2/platform/worker_render.dart";
|
||||
import "package:angular2/core.dart";
|
||||
import "package:angular2/src/core/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/core/reflection/reflection.dart";
|
||||
|
||||
@AngularEntrypoint()
|
||||
main() {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
platform([WORKER_RENDER_PLATFORM])
|
||||
.asyncApplication(initIsolate("background_index.dart"));
|
||||
}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
library angular2.examples.web_workers.todo.index_web_socket;
|
||||
|
||||
import "package:angular2/src/core/reflection/reflection_capabilities.dart";
|
||||
import "package:angular2/src/core/reflection/reflection.dart";
|
||||
import "package:angular2/core.dart";
|
||||
import "package:angular2/platform/worker_render.dart";
|
||||
import "package:angular2/src/web_workers/debug_tools/web_socket_message_bus.dart";
|
||||
import 'dart:html' show WebSocket;
|
||||
|
||||
@AngularEntrypoint()
|
||||
main() {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
var webSocket = new WebSocket("ws://127.0.0.1:1337/ws");
|
||||
webSocket.onOpen.listen((e) {
|
||||
var bus = new WebSocketMessageBus.fromWebSocket(webSocket);
|
||||
|
||||
Reference in New Issue
Block a user