reflection_capabilities.dart imports dart:mirrors, so we need to remove it from the source.
Currently, examples/src/hello_world/index.dart directly imports & creates ReflectionCapabilities, but if possible we should avoid having the user deal with this directly. This is made a bit more complicated since transformers cannot write across package boundaries.
One option would be to use bootstrap as a seam. If we do this, we should probably move bootstrap into its own file to avoid having to rewrite all imports of angular2/angular2.dart.
In a new file, maybe lib/src/core/life_cycle/bootstrap_internal.dart:
Future<Injector> bootstrapInternal(...) {
// Actual bootstrapping
}
We could move bootstrap into, say, lib/bootstrap.dart:
import '.../reflection_capabilities.dart';
import 'application_internal.dart';
Future<Injector> bootstrap(...) {
reflector.reflectionCapabilities = new ReflectionCapabilities();
return bootstrapInternal(...);
}
In the generated code:
// examples/web/src/hello_world/index.bootstrap.dart (generated)
Future<Injector> bootstrap(...) {
// Generated registration code
return bootstrapInternal(...);
}
And we rewrite the user's calls to bootstrap to use our generated call.
This involves some moving around of files, messing around with imports, and completely ignores how this would affect the js side of things, so it may not be the appropriate solution -- just somewhere to start the discussion.
reflection_capabilities.dartimports dart:mirrors, so we need to remove it from the source.Currently, examples/src/hello_world/index.dart directly imports & creates
ReflectionCapabilities, but if possible we should avoid having the user deal with this directly. This is made a bit more complicated since transformers cannot write across package boundaries.One option would be to use
bootstrapas a seam. If we do this, we should probably movebootstrapinto its own file to avoid having to rewrite all imports ofangular2/angular2.dart.In a new file, maybe
lib/src/core/life_cycle/bootstrap_internal.dart:We could move
bootstrapinto, say,lib/bootstrap.dart:In the generated code:
And we rewrite the user's calls to
bootstrapto use our generated call.This involves some moving around of files, messing around with imports, and completely ignores how this would affect the js side of things, so it may not be the appropriate solution -- just somewhere to start the discussion.