angular/modules/angular2/src/core
Jason Teplitz 1710272b3c refactor(WebWorker): Use the new generic bootstrap.
BREAKING CHANGE:

You can no longer bootstrap a WebWorker or Isolate using `bootstrap` or `bootstrapWebWorker`. Instead you have to do the following:

In TypeScript:
```TypeScript
// index.js
import {WORKER_RENDER_PLATFORM, WORKER_RENDER_APPLICATION, WORKER_SCRIPT} from "angular2/platforms/worker_render";
import {platform} from "angular2/platform";

platform([WORKER_RENDER_PLATFORM])
.application([WORKER_RENDER_APPLICATION, new Provider(WORKER_SCRIPT, {useValue: "loader.js"});
```
```JavaScript
// loader.js
importScripts("https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.3/es6-shim.js", "https://jspm.io/system@0.16.js", "angular2/web_worker/worker.js");
System.import("app");
```
```TypeScript
// app.ts
import {Component, View} from "angular2/core";
import {WORKER_APP_PLATFORM, setupWebWorker} from "angular2/platforms/worker_app";
import {platform} from "angular2/platform";

@Component({
  selector: "hello-world"
})
@View({
  template: "<h1>Hello {{name}}</h1>
})
export class HelloWorld {
  name: string = "Jane";
}

platform([WORKER_APP_PLATFORM])
.asyncApplication(setupWebWorker, optionalProviders?)
.then((ref) => ref.bootstrap(RootComponent));
```

In Dart:
```Dart
// index.dart
import "angular2/platform.dart";
import "angular2/platforms/worker_render.dart";

main() {
  platform([WORKER_RENDER_PLATFORM])
  .asyncApplication(initIsolate("my_worker.dart"));
}
```
```Dart
// background_index.dart
import "angular2/platform.dart";
import "angular2/platforms/worker_app.dart";
import "package:angular2/src/core/reflection/reflection.dart";
import "package:angular2/src/core/reflection/reflection_capabilities.dart";

@Component(
  selector: "hello-world"
)
@View(
  template: "<h1>Hello {{name}}</h1>"
)
class HelloWorld {
  String name = "Jane";
}

main(List<String> args, SendPort replyTo) {
  reflector.reflectionCapabilities = new ReflectionCapabilities();
  platform([WORKER_APP_PLATFORM])
    .asyncApplication(setupIsolate(replyTo))
      .then((ref) => ref.bootstrap(RootComponent));
}

```

You should no longer import from the `angular2/web_worker/worker` and `angular2/web_worker/ui` paths. Instead you can now import directly from core, directives, etc..

The WebWorkerApplication class has been removed. If you want to use ServiceMessageBroker or ClientMessageBroker on the render thread, you must inject their factories via DI.
If you need to use the MessageBus on the render thread you must also obtain it through DI.

closes #3277
closes #5473

Closes #5519
2015-12-03 19:51:43 +00:00
..
change_detection refactor(pipes): use angular lifecycle hooks instead of PipeOnDestroy 2015-11-30 16:40:50 -08:00
debug refactor(core): move render/dom from core 2015-11-17 15:53:55 -08:00
di refactor(core): move render/dom from core 2015-11-17 15:53:55 -08:00
dom test(matchers): add support for toHaveCssStyle matcher 2015-11-23 22:43:01 +00:00
linker refactor(pipes): use angular lifecycle hooks instead of PipeOnDestroy 2015-11-30 16:40:50 -08:00
metadata docs: fix typo event1 -> event 2015-12-02 11:40:20 -08:00
pipes refactor(core): move facades out of core 2015-11-07 01:36:06 +00:00
profile refactor(core): move facades out of core 2015-11-07 01:36:06 +00:00
reflection refactor(ListWrapper): drop filter, find, reduce & any 2015-11-09 19:24:14 +00:00
render refactor(core): move EventManager from core to platform/dom 2015-11-30 22:24:35 +00:00
testability refactor(core): move render/dom from core 2015-11-17 15:53:55 -08:00
util refactor(core): move facades out of core 2015-11-07 01:36:06 +00:00
zone refactor(EventEmitter): rename .next() to .emit() 2015-11-18 22:16:40 +00:00
angular_entrypoint.ts feat(dart/transform): Introduce @AngularEntrypoint() 2015-12-01 13:34:29 -08:00
application_common_providers.ts refactor(core): move EventManager from core to platform/dom 2015-11-30 22:24:35 +00:00
application_ref.ts refactor(WebWorker): Use the new generic bootstrap. 2015-12-03 19:51:43 +00:00
application_tokens.ts feat(bootstrap): add platform and app initializers 2015-11-18 22:22:32 +00:00
change_detection.ts refactor(pipes): use angular lifecycle hooks instead of PipeOnDestroy 2015-11-30 16:40:50 -08:00
dev_mode.ts refactor(core): move facades out of core 2015-11-07 01:36:06 +00:00
di.ts feat(di): rename Binding into Provider 2015-10-11 05:13:31 +00:00
linker.ts refactor(core): move render/dom from core 2015-11-17 15:53:55 -08:00
metadata.dart refactor(core): move facades out of core 2015-11-07 01:36:06 +00:00
metadata.ts refactor(lifecycle): prefix lifecycle methods with "ng" 2015-11-30 16:40:50 -08:00
platform_common_providers.ts feat(core): extract platforms out of core 2015-11-13 19:26:14 +00:00
platform_directives_and_pipes.ts feat(core): renam AMBIENT_DIRECTIVES and AMBIENT_PIPES into PLATFORM_DIRECTIVES and PLATFORM_PIPES 2015-11-10 01:45:25 +00:00
render.ts refactor(core): move EventManager from core to platform/dom 2015-11-30 22:24:35 +00:00
util.dart fix(core): various dart-specific fixes for core and facades 2015-11-11 11:45:58 -08:00
util.ts refactor: export core APIs from angular2/core 2015-09-05 07:01:34 +00:00
zone.ts feat: move NgZone to Stream/Observable-based callback API 2015-10-20 21:51:19 -07:00