diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md index 6cafa09eb..987e532b6 100644 --- a/dwds/CHANGELOG.md +++ b/dwds/CHANGELOG.md @@ -1,6 +1,7 @@ ## 1.0.0-dev - Remove dependency on `package:build_daemon`. +- Add `FrontendServerAssetReader` for use with Frontend Server builds. **Breaking Changes:** - No longer use the `BuildResult` abstraction from `package:build_daemon` but diff --git a/dwds/lib/dwds.dart b/dwds/lib/dwds.dart index 776fea67e..4afc6e425 100644 --- a/dwds/lib/dwds.dart +++ b/dwds/lib/dwds.dart @@ -23,6 +23,8 @@ export 'src/connections/app_connection.dart' show AppConnection; export 'src/connections/debug_connection.dart' show DebugConnection; export 'src/handlers/dev_handler.dart' show AppConnectionException; export 'src/readers/asset_reader.dart' show AssetReader; +export 'src/readers/frontend_server_asset_reader.dart' + show FrontendServerAssetReader; export 'src/readers/proxy_server_asset_reader.dart' show ProxyServerAssetReader; export 'src/services/chrome_proxy_service.dart' show ChromeDebugException; diff --git a/dwds/lib/src/readers/frontend_server_asset_reader.dart b/dwds/lib/src/readers/frontend_server_asset_reader.dart new file mode 100644 index 000000000..6c9038874 --- /dev/null +++ b/dwds/lib/src/readers/frontend_server_asset_reader.dart @@ -0,0 +1,81 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; +import 'dart:io'; + +import 'package:path/path.dart' as p; + +import 'asset_reader.dart'; + +/// A reader for Dart sources and related source maps provided by the Frontend +/// Server. +class FrontendServerAssetReader implements AssetReader { + final File _mapOriginal; + final File _mapIncremental; + final File _jsonOriginal; + final File _jsonIncremental; + + // Map of Dart module server path to source map contents. + final _mapContents = {}; + + bool _haveReadOriginals = false; + + /// Creates a [FrontendServerAssetReader]. + /// + /// [outputPath] is the file path to the Frontend Server kernel file e.g. + /// + /// /some/path/main.dart.dill + /// + /// Corresponding `.json` and `.map` files will be read relative to + /// [outputPath]. + FrontendServerAssetReader( + String outputPath, + ) : _mapOriginal = File('$outputPath.map'), + _mapIncremental = File('$outputPath.incremental.map'), + _jsonOriginal = File('$outputPath.json'), + _jsonIncremental = File('$outputPath.incremental.json'); + + @override + Future dartSourceContents(String serverPath) => + throw UnimplementedError(); + + @override + Future sourceMapContents(String serverPath) async { + if (!serverPath.endsWith('lib.js.map')) return null; + if (!serverPath.startsWith('/')) serverPath = '/$serverPath'; + // Strip the .map, sources are looked up by their js path. + return _mapContents[p.withoutExtension(serverPath)]; + } + + /// Updates the internal caches by reading the Frontend Server output files. + /// + /// Will only read the incremental files on additional calls. + Future updateCaches() async { + if (!_haveReadOriginals) { + await _updateCaches(_mapOriginal, _jsonOriginal); + _haveReadOriginals = true; + } else { + await _updateCaches(_mapIncremental, _jsonIncremental); + } + } + + Future _updateCaches(File map, File json) async { + if (!(await map.exists() && await json.exists())) { + throw StateError('$map and $json do not exist.'); + } + var sourceContents = await map.readAsBytes(); + var sourceInfo = + jsonDecode(await json.readAsString()) as Map; + for (var key in sourceInfo.keys) { + var info = sourceInfo[key]; + _mapContents[key] = utf8.decode(sourceContents + .getRange( + info['sourcemap'][0] as int, + info['sourcemap'][1] as int, + ) + .toList()); + } + } +} diff --git a/dwds/test/fixtures/main.dart.dill.json b/dwds/test/fixtures/main.dart.dill.json new file mode 100644 index 000000000..751bc10b8 --- /dev/null +++ b/dwds/test/fixtures/main.dart.dill.json @@ -0,0 +1 @@ +{"/web/main.dart.lib.js":{"code":[0,2929],"sourcemap":[0,373]},"/packages/webdev_example_app/message.dart.lib.js":{"code":[2929,3844],"sourcemap":[373,568]},"/packages/path/src/path_set.dart.lib.js":{"code":[3844,97029],"sourcemap":[568,24042]},"/packages/path/src/path_exception.dart.lib.js":{"code":[97029,98717],"sourcemap":[24042,24277]},"/packages/path/src/characters.dart.lib.js":{"code":[98717,100285],"sourcemap":[24277,24602]},"/packages/path/src/utils.dart.lib.js":{"code":[100285,102035],"sourcemap":[24602,25191]}} \ No newline at end of file diff --git a/dwds/test/fixtures/main.dart.dill.map b/dwds/test/fixtures/main.dart.dill.map new file mode 100644 index 000000000..58a3895f1 --- /dev/null +++ b/dwds/test/fixtures/main.dart.dill.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":"","sources":["main.dart"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYwB,IAAtB,WAAM;AAKJ,IAHF,4BAAkB,aAAa,SAAC,GAAG;AACb,MAApB,WAAM;AACN,YAAgC,+CAAO,AAAK,oBAAO,uCAAC,WAAW;IAChE;AACkD,IAAnD,AAAS,AAAK,kCAAO,wBAAe,YAAO;AAEvC,gBAAQ;AAGV,IAFI,kCAAqC,QAAC;AACX,MAA/B,WAAM,AAAwB,0BAAP,QAAF,AAAE,KAAK,GAAP;;EAEzB","file":"main.dart.lib.js"}{"version":3,"sourceRoot":"","sources":["message.dart"],"names":[],"mappings":";;;;;;;;;MAEM,eAAO;YAAG,WAAO,SAAS","file":"../../../../../../../../packages/webdev_example_app/message.dart.lib.js"}{"version":3,"sourceRoot":"","sources":["path_set.dart","path_map.dart","style.dart","internal_style.dart","style/windows.dart","style/url.dart","parsed_path.dart","style/posix.dart","context.dart","../path.dart"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA6BuC;AACd,MAArB,AAAQ,OAAD,IAAC,OAAR,UAAc,gBAAN;AACR,YAAO,sCACK,SAAC,OAAO;AACd,cAAI,AAAM,KAAD,IAAI,MAAM,MAAO,AAAM,MAAD,IAAI;AACnC,cAAI,AAAM,KAAD,IAAI,MAAM,MAAO;AAC1B,gBAAO,AAAQ,QAAD,QAAQ,KAAK,EAAE,KAAK;+CAE1B,QAAC,QAAS,AAAK,IAAD,IAAI,OAAO,IAAI,AAAQ,OAAD,MAAM,IAA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_set.dart.lib.js"}{"version":3,"sourceRoot":"","sources":["path_exception.dart"],"names":[],"mappings":";;;;;;;;;IAOS;;;;;;;AAIc,YAAA,AAAyB,8BAAR;IAAQ;;;IAF3B;;EAAQ","file":"../../../../../../../../../../../packages/path/src/path_exception.dart.lib.js"}{"version":3,"sourceRoot":"","sources":["characters.dart"],"names":[],"mappings":";;;;;;;;MAKM,eAAI;;;MACJ,gBAAK;;;MACL,iBAAM;;;MACN,gBAAK;;;MACL,eAAI;;;MACJ,eAAI;;;MACJ,gBAAK;;;MACL,iBAAM;;;MACN,iBAAM;;;MACN,iBAAM;;;MACN,iBAAM;;;MACN,oBAAS","file":"../../../../../../../../../../../packages/path/src/characters.dart.lib.js"}{"version":3,"sourceRoot":"","sources":["utils.dart"],"names":[],"mappings":";;;;;;;;6CAQsB;AAClB,UAAM,AAAyC,cAA9C,IAAI,WAAyB,aAAL,IAAI,WACvB,aAAL,IAAI,WAAyB,aAAL,IAAI;EAAiB;uCAG/B;AAAS,UAAK,AAAc,cAAnB,IAAI,WAAuB,aAAL,IAAI;EAAc;+CAI1C,MAAU;AAClC,QAAI,AAAK,AAAO,IAAR,UAAgB,aAAN,KAAK,IAAG,GAAG,MAAO;AACpC,mBAAK,mBAAa,AAAK,IAAD,cAAY,KAAK,KAAI,MAAO;AAClD,QAAI,AAAK,IAAD,cAAkB,aAAN,KAAK,IAAG,WAAmB,MAAO;AACtD,QAAI,AAAK,AAAO,IAAR,YAAiB,aAAN,KAAK,IAAG,GAAG,MAAO;AACrC,UAAO,AAAK,AAAsB,KAAvB,cAAkB,aAAN,KAAK,IAAG;EACjC","file":"../../../../../../../../../../../packages/path/src/utils.dart.lib.js"} \ No newline at end of file diff --git a/dwds/test/readers/frontend_server_asset_reader_test.dart b/dwds/test/readers/frontend_server_asset_reader_test.dart new file mode 100644 index 000000000..3119bf5ff --- /dev/null +++ b/dwds/test/readers/frontend_server_asset_reader_test.dart @@ -0,0 +1,83 @@ +// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; +import 'dart:io'; + +import 'package:dwds/dwds.dart'; +import 'package:path/path.dart' as p; +import 'package:test/test.dart'; + +void main() { + FrontendServerAssetReader assetReader; + Directory tempFixtures; + File jsonOriginal; + File mapOriginal; + + Future _createTempFixtures() async { + var fixtures = p.join('test', 'fixtures'); + tempFixtures = await Directory.systemTemp.createTemp('dwds_test_fixtures'); + await tempFixtures.create(); + jsonOriginal = await File(p.join(fixtures, 'main.dart.dill.json')) + .copy(p.join(tempFixtures.path, 'main.dart.dill.json')); + mapOriginal = await File(p.join(fixtures, 'main.dart.dill.map')) + .copy(p.join(tempFixtures.path, 'main.dart.dill.map')); + } + + setUp(() async { + await _createTempFixtures(); + assetReader = + FrontendServerAssetReader(p.join(tempFixtures.path, 'main.dart.dill')); + await assetReader.updateCaches(); + }); + + tearDown(() async { + if (await tempFixtures.exists()) await tempFixtures.delete(recursive: true); + }); + + group('FrontendServerAssetReader', () { + group('source maps', () { + test('can be read', () async { + var result = + await assetReader.sourceMapContents('web/main.dart.lib.js.map'); + expect(result, isNotNull); + }); + + test('are cached', () async { + // Remove the underlying fixtures. + await tempFixtures.delete(recursive: true); + + var cachedResult = + await assetReader.sourceMapContents('web/main.dart.lib.js.map'); + expect(cachedResult, isNotNull); + }); + + test('are null if the path does not exist', () async { + var result = + await assetReader.sourceMapContents('web/foo.dart.lib.js.map'); + expect(result, isNull); + }); + + test('are updated with new incremental results', () async { + var missingResult = + await assetReader.sourceMapContents('web/foo.dart.lib.js.map'); + expect(missingResult, isNull); + + // Update fixture. + await File(p.join(tempFixtures.path, 'main.dart.dill.incremental.json')) + .writeAsString((await jsonOriginal.readAsString()) + .replaceAll('web/main.dart.lib.js', 'web/foo.dart.lib.js')); + await File(p.join(tempFixtures.path, 'main.dart.dill.incremental.map')) + .writeAsString((await mapOriginal.readAsString()) + .replaceAll('web/main.dart.lib.js', 'web/foo.dart.lib.js')); + + await assetReader.updateCaches(); + + var newResult = + await assetReader.sourceMapContents('web/foo.dart.lib.js.map'); + expect(newResult, isNotNull); + }); + }); + }); +}