angular/modules/angular2/test
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
..
animate cleanup: move DomAdapter from angular2/core into angular2/platform/common_dom 2015-11-20 00:14:24 +00:00
common refactor(tests): rename beforeEachBindings -> beforeEachProviders 2015-12-02 14:09:13 -08:00
compiler feat(HtmlParser): better error message when a void tag has content 2015-12-02 14:17:41 -08:00
core refactor(WebWorker): Use the new generic bootstrap. 2015-12-03 19:51:43 +00:00
facade chore(build): make the unit tests campaign to run again in Edge 2015-12-02 14:34:31 -08:00
http test(http): remove stale SpyObserver 2015-12-03 10:54:42 -08:00
mock refactor(core): move facades out of core 2015-11-07 01:36:06 +00:00
platform chore(build): fix flakiness of the element probe global test 2015-12-02 14:19:07 -08:00
router chore(test): remove deprecated RootTestComponent 2015-12-02 15:00:55 -08:00
symbol_inspector chore(test): fix public API test failure when no support of Symbol.for 2015-11-10 11:23:01 +01:00
testing feat(testing): export useful properties from componentFixture 2015-12-02 16:05:01 -08:00
upgrade refactor(lifecycle): prefix lifecycle methods with "ng" 2015-11-30 16:40:50 -08:00
web_workers refactor(WebWorker): Use the new generic bootstrap. 2015-12-03 19:51:43 +00:00
dev_mode_spec.ts test: add a test verifying that the tests are run in the checked mode 2015-12-02 11:29:11 -08:00
public_api_spec.ts refactor(facade): use rxjs package 2015-12-02 16:02:34 -08:00