Chromium Code Reviews| Index: sdk/lib/_internal/pub/lib/src/barback/transformer_isolate.dart |
| diff --git a/sdk/lib/_internal/pub/lib/src/barback/transformer_isolate.dart b/sdk/lib/_internal/pub/lib/src/barback/transformer_isolate.dart |
| index e2e84e58162bc93e783507f7889dbdedc4c82ed5..8a563e922fa945885a4099a3244ca0b4d8c4bd08 100644 |
| --- a/sdk/lib/_internal/pub/lib/src/barback/transformer_isolate.dart |
| +++ b/sdk/lib/_internal/pub/lib/src/barback/transformer_isolate.dart |
| @@ -58,8 +58,7 @@ class TransformerIsolate { |
| var baseUrl = transformerServer.url; |
| var idsToUrls = mapMap(idsToAssetIds, value: (id, assetId) { |
| var path = assetId.path.replaceFirst('lib/', ''); |
| - // TODO(nweiz): load from a "package:" URI when issue 12474 is fixed. |
| - return baseUrl.resolve('packages/${id.package}/$path'); |
| + return Uri.parse('package:${id.package}/$path'); |
| }); |
| var code = new StringBuffer(); |
| @@ -70,7 +69,7 @@ class TransformerIsolate { |
| } |
| code.writeln("import " |
| - "r'$baseUrl/packages/\$pub/transformer_isolate.dart';"); |
| + "r'package:\$pub/transformer_isolate.dart';"); |
|
Bob Nystrom
2014/09/23 21:56:11
Will this fit on one line now?
nweiz
2014/09/23 23:23:58
Done.
|
| code.writeln( |
| "void main(_, SendPort replyTo) => loadTransformers(replyTo);"); |
| @@ -78,6 +77,7 @@ class TransformerIsolate { |
| var port = new ReceivePort(); |
| return dart.runInIsolate(code.toString(), port.sendPort, |
| + packageRoot: baseUrl.resolve('packages'), |
| snapshot: snapshot) |
| .then((_) => port.first) |
| .then((sendPort) { |
| @@ -113,11 +113,7 @@ class TransformerIsolate { |
| /// return an empty set. |
| Future<Set<Transformer>> create(TransformerConfig config) { |
| return call(_port, { |
| - // TODO(nweiz): Right now, we can load a library either from a running |
| - // server or from a snapshot. This means the base URL isn't known except |
| - // in the isolate, so we pass just the path.component and let the isolate |
| - // resolve it. When issue 12474 is fixed, we can send the full URL. |
| - 'library': _idsToUrls[config.id].path.toString(), |
| + 'library': _idsToUrls[config.id].toString(), |
| 'mode': _mode.name, |
| 'configuration': JSON.encode(config.configuration) |
| }).then((transformers) { |