feat(core): extract platforms out of core
Currently, core depends on the browser, which means that other platforms (e.g., NativeScript or webworker) cannot use the bootstrapping logic core provides. This PR extract makes bootstrapping logic in core completely platform-independent. The browser-specific code was moved to "angular2/platforms/browser". BREAKING CHANGE A few private helpers (e.g., platformCommon or applicationCommon) were removed or replaced with other helpers. Look at PLATFORM_COMMON_PROVIDERS, APPLICATION_COMMON_PROVIDERS, BROWSER_PROVIDERS, BROWSER_APP_PROVIDERS to see if they export the providers you need. Closes #5219
This commit is contained in:
@ -1,29 +0,0 @@
|
||||
library angular2.src.core.application;
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:angular2/src/core/reflection/reflection.dart' show reflector;
|
||||
import 'package:angular2/src/core/reflection/reflection_capabilities.dart'
|
||||
show ReflectionCapabilities;
|
||||
import 'application_common.dart';
|
||||
|
||||
import 'package:angular2/src/compiler/compiler.dart';
|
||||
import 'package:angular2/src/core/linker/dynamic_component_loader.dart';
|
||||
export 'package:angular2/src/core/linker/dynamic_component_loader.dart'
|
||||
show ComponentRef;
|
||||
|
||||
/// Starts an application from a root component. This implementation uses
|
||||
/// mirrors. Angular 2 transformer automatically replaces this method with a
|
||||
/// static implementation (see `application_static.dart`) that does not use
|
||||
/// mirrors and produces a faster and more compact JS code.
|
||||
///
|
||||
/// See [commonBootstrap] for detailed documentation.
|
||||
Future<ComponentRef> bootstrap(Type appComponentType,
|
||||
[List componentInjectableProviders]) {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
var providers = [compilerProviders()];
|
||||
if (componentInjectableProviders != null) {
|
||||
providers.add(componentInjectableProviders);
|
||||
}
|
||||
return commonBootstrap(appComponentType, providers);
|
||||
}
|
Reference in New Issue
Block a user