Integrate DWDS 7.0.0
diff --git a/packages/flutter_tools/lib/src/isolated/devfs_web.dart b/packages/flutter_tools/lib/src/isolated/devfs_web.dart
index db2fe90..c82ee71 100644
--- a/packages/flutter_tools/lib/src/isolated/devfs_web.dart
+++ b/packages/flutter_tools/lib/src/isolated/devfs_web.dart
@@ -9,7 +9,6 @@
import 'package:dwds/dwds.dart';
import 'package:html/dom.dart';
import 'package:html/parser.dart';
-import 'package:logging/logging.dart' as logging;
import 'package:meta/meta.dart';
import 'package:mime/mime.dart' as mime;
import 'package:package_config/package_config.dart';
@@ -37,23 +36,20 @@
import '../web/bootstrap.dart';
import '../web/chrome.dart';
-typedef DwdsLauncher = Future<Dwds> Function({
- @required AssetReader assetReader,
- @required Stream<BuildResult> buildResults,
- @required ConnectionProvider chromeConnection,
- @required LoadStrategy loadStrategy,
- @required bool enableDebugging,
- bool enableDebugExtension,
- String hostname,
- bool useSseForDebugProxy,
- bool useSseForDebugBackend,
- bool serveDevTools,
- void Function(logging.Level, String) logWriter,
- bool verbose,
- UrlEncoder urlEncoder,
- bool useFileProvider,
- ExpressionCompiler expressionCompiler,
-});
+typedef DwdsLauncher = Future<Dwds> Function(
+ {@required AssetReader assetReader,
+ @required Stream<BuildResult> buildResults,
+ @required ConnectionProvider chromeConnection,
+ @required LoadStrategy loadStrategy,
+ @required bool enableDebugging,
+ ExpressionCompiler expressionCompiler,
+ bool enableDebugExtension,
+ String hostname,
+ bool useSseForDebugProxy,
+ bool useSseForDebugBackend,
+ bool serveDevTools,
+ UrlEncoder urlEncoder,
+ bool spawnDds});
// A minimal index for projects that do not yet support web.
const String _kDefaultIndex = '''
@@ -86,8 +82,9 @@
String moduleName,
String expression,
) async {
- final CompilerOutput compilerOutput = await _generator.compileExpressionToJs(libraryUri,
- line, column, jsModules, jsFrameValues, moduleName, expression);
+ final CompilerOutput compilerOutput =
+ await _generator.compileExpressionToJs(libraryUri, line, column,
+ jsModules, jsFrameValues, moduleName, expression);
if (compilerOutput != null && compilerOutput.outputFilename != null) {
final String content = utf8.decode(
@@ -97,8 +94,12 @@
}
return ExpressionCompilationResult(
- 'InternalError: frontend server failed to compile \'$expression\'', true);
+ 'InternalError: frontend server failed to compile \'$expression\'',
+ true);
}
+
+ @override
+ Future<bool> updateDependencies(Map<String, String> modules) async => true;
}
/// A web server which handles serving JavaScript and assets.
@@ -129,9 +130,8 @@
// We skip computing the digest by using the hashCode of the underlying buffer.
// Whenever a file is updated, the corresponding Uint8List.view it corresponds
// to will change.
- final String moduleName = module.startsWith('/')
- ? module.substring(1)
- : module;
+ final String moduleName =
+ module.startsWith('/') ? module.substring(1) : module;
final String name = moduleName.replaceAll('.lib.js', '');
final String path = moduleName.replaceAll('.js', '');
_modules[name] = path;
@@ -202,48 +202,24 @@
shelf.serveRequests(httpServer, releaseAssetServer.handle);
return server;
}
- // Return the set of all active modules. This is populated by the
- // frontend_server update logic.
- Future<Map<String, String>> moduleProvider(String path) async {
- return modules;
- }
+
// Return a version string for all active modules. This is populated
// along with the `moduleProvider` update logic.
- Future<Map<String, String>> digestProvider(String path) async {
- return digests;
- }
- // Return the module name for a given server path. These are the names
- // used by the browser to request JavaScript files.
- String moduleForServerPath(String serverPath) {
- if (serverPath.endsWith('.lib.js')) {
- serverPath = serverPath.startsWith('/')
- ? serverPath.substring(1)
- : serverPath;
- return serverPath.replaceAll('.lib.js', '');
- }
- return null;
- }
- // Return the server path for modules. These are the JavaScript file names
- // output by the frontend_server.
- String serverPathForModule(String module) {
- return '$module.lib.js';
- }
- // Return the server path for modules or resources that have an
- // org-dartlang-app scheme.
- String serverPathForAppUri(String appUri) {
- if (appUri.startsWith('org-dartlang-app:')) {
- return Uri.parse(appUri).path.substring(1);
- }
- return null;
- }
+ Future<Map<String, String>> _digestProvider(
+ MetadataProvider provider) async =>
+ digests;
+
// Ensure dwds is present and provide middleware to avoid trying to
// load the through the isolate APIs.
- final Directory directory = await _loadDwdsDirectory(globals.fs, globals.logger);
- final shelf.Middleware middleware = (FutureOr<shelf.Response> Function(shelf.Request) innerHandler) {
+ final Directory directory =
+ await _loadDwdsDirectory(globals.fs, globals.logger);
+ final shelf.Middleware middleware =
+ (FutureOr<shelf.Response> Function(shelf.Request) innerHandler) {
return (shelf.Request request) async {
if (request.url.path.endsWith('dwds/src/injected/client.js')) {
final Uri uri = directory.uri.resolve('src/injected/client.js');
- final String result = await globals.fs.file(uri.toFilePath()).readAsString();
+ final String result =
+ await globals.fs.file(uri.toFilePath()).readAsString();
return shelf.Response.ok(result, headers: <String, String>{
HttpHeaders.contentTypeHeader: 'application/javascript'
});
@@ -254,41 +230,33 @@
// In debug builds, spin up DWDS and the full asset server.
final Dwds dwds = await dwdsLauncher(
- assetReader: server,
- enableDebugExtension: true,
- buildResults: const Stream<BuildResult>.empty(),
- chromeConnection: () async {
- final Chromium chromium = await chromiumLauncher.connectedInstance;
- return chromium.chromeConnection;
- },
- hostname: hostname,
- urlEncoder: urlTunneller,
- enableDebugging: true,
- useSseForDebugProxy: useSseForDebugProxy,
- useSseForDebugBackend: useSseForDebugBackend,
- serveDevTools: false,
- logWriter: (logging.Level logLevel, String message) => globals.printTrace(message),
- loadStrategy: RequireStrategy(
- ReloadConfiguration.none,
- '.lib.js',
- moduleProvider,
- digestProvider,
- moduleForServerPath,
- serverPathForModule,
- serverPathForAppUri,
- ),
- useFileProvider: true,
- expressionCompiler: expressionCompiler
- );
+ assetReader: server,
+ enableDebugExtension: true,
+ buildResults: const Stream<BuildResult>.empty(),
+ chromeConnection: () async {
+ final Chromium chromium = await chromiumLauncher.connectedInstance;
+ return chromium.chromeConnection;
+ },
+ hostname: hostname,
+ urlEncoder: urlTunneller,
+ enableDebugging: true,
+ useSseForDebugProxy: useSseForDebugProxy,
+ useSseForDebugBackend: useSseForDebugBackend,
+ serveDevTools: false,
+ loadStrategy: FrontendServerRequireStrategyProvider(
+ ReloadConfiguration.none, server, _digestProvider)
+ .strategy,
+ expressionCompiler: expressionCompiler,
+ spawnDds: true);
shelf.Pipeline pipeline = const shelf.Pipeline();
if (enableDwds) {
pipeline = pipeline.addMiddleware(middleware);
pipeline = pipeline.addMiddleware(dwds.middleware);
}
- final shelf.Handler dwdsHandler = pipeline.addHandler(server.handleRequest);
- final shelf.Cascade cascade = shelf.Cascade()
- .add(dwds.handler)
- .add(dwdsHandler);
+ final shelf.Handler dwdsHandler =
+ pipeline.addHandler(server.handleRequest);
+ final shelf.Cascade cascade =
+ shelf.Cascade().add(dwds.handler).add(dwdsHandler);
shelf.serveRequests(httpServer, cascade.handler);
server.dwds = dwds;
return server;
@@ -325,6 +293,7 @@
Uint8List getMetadata(String path) => _metadataFiles[path];
@visibleForTesting
+
/// The base path to serve from.
///
/// It should have no leading or trailing slashes.
@@ -357,9 +326,10 @@
// If this is a JavaScript file, it must be in the in-memory cache.
// Attempt to look up the file by URI.
- final String webServerPath = requestPath.replaceFirst('.dart.js', '.dart.lib.js');
+ final String webServerPath =
+ requestPath.replaceFirst('.dart.js', '.dart.lib.js');
if (_files.containsKey(requestPath) || _files.containsKey(webServerPath)) {
- final List<int> bytes = getFile(requestPath) ?? getFile(webServerPath);
+ final List<int> bytes = getFile(requestPath) ?? getFile(webServerPath);
// Use the underlying buffer hashCode as a revision string. This buffer is
// replaced whenever the frontend_server produces new output files, which
// will also change the hashCode.
@@ -405,15 +375,18 @@
// If all of the lookups above failed, the file might have been an asset.
// Try and resolve the path relative to the built asset directory.
if (!file.existsSync()) {
- final Uri potential = globals.fs.directory(getAssetBuildDirectory())
- .uri.resolve(requestPath.replaceFirst('assets/', ''));
+ final Uri potential = globals.fs
+ .directory(getAssetBuildDirectory())
+ .uri
+ .resolve(requestPath.replaceFirst('assets/', ''));
file = globals.fs.file(potential);
}
if (!file.existsSync()) {
final Uri webPath = globals.fs.currentDirectory
- .childDirectory('web')
- .uri.resolve(requestPath);
+ .childDirectory('web')
+ .uri
+ .resolve(requestPath);
file = globals.fs.file(webPath);
}
@@ -428,8 +401,8 @@
// For real files, use a serialized file stat plus path as a revision.
// This allows us to update between canvaskit and non-canvaskit SDKs.
- final String etag = file.lastModifiedSync().toIso8601String()
- + Uri.encodeComponent(file.path);
+ final String etag = file.lastModifiedSync().toIso8601String() +
+ Uri.encodeComponent(file.path);
if (ifNoneMatch == etag) {
return shelf.Response.notModified();
}
@@ -470,24 +443,26 @@
///
/// Returns a list of updated modules.
List<String> write(
- File codeFile,
- File manifestFile,
- File sourcemapFile,
- File metadataFile) {
+ File codeFile, File manifestFile, File sourcemapFile, File metadataFile) {
final List<String> modules = <String>[];
final Uint8List codeBytes = codeFile.readAsBytesSync();
final Uint8List sourcemapBytes = sourcemapFile.readAsBytesSync();
final Uint8List metadataBytes = metadataFile.readAsBytesSync();
- final Map<String, dynamic> manifest = castStringKeyedMap(json.decode(manifestFile.readAsStringSync()));
+ final Map<String, dynamic> manifest =
+ castStringKeyedMap(json.decode(manifestFile.readAsStringSync()));
for (final String filePath in manifest.keys) {
if (filePath == null) {
globals.printTrace('Invalid manfiest file: $filePath');
continue;
}
- final Map<String, dynamic> offsets = castStringKeyedMap(manifest[filePath]);
- final List<int> codeOffsets = (offsets['code'] as List<dynamic>).cast<int>();
- final List<int> sourcemapOffsets = (offsets['sourcemap'] as List<dynamic>).cast<int>();
- final List<int> metadataOffsets = (offsets['metadata'] as List<dynamic>).cast<int>();
+ final Map<String, dynamic> offsets =
+ castStringKeyedMap(manifest[filePath]);
+ final List<int> codeOffsets =
+ (offsets['code'] as List<dynamic>).cast<int>();
+ final List<int> sourcemapOffsets =
+ (offsets['sourcemap'] as List<dynamic>).cast<int>();
+ final List<int> metadataOffsets =
+ (offsets['metadata'] as List<dynamic>).cast<int>();
if (codeOffsets.length != 2 ||
sourcemapOffsets.length != 2 ||
metadataOffsets.length != 2) {
@@ -506,15 +481,15 @@
codeStart,
codeEnd - codeStart,
);
- final String fileName = filePath.startsWith('/')
- ? filePath.substring(1)
- : filePath;
+ final String fileName =
+ filePath.startsWith('/') ? filePath.substring(1) : filePath;
_files[fileName] = byteView;
final int sourcemapStart = sourcemapOffsets[0];
final int sourcemapEnd = sourcemapOffsets[1];
if (sourcemapStart < 0 || sourcemapEnd > sourcemapBytes.lengthInBytes) {
- globals.printTrace('Invalid byte index: [$sourcemapStart, $sourcemapEnd]');
+ globals
+ .printTrace('Invalid byte index: [$sourcemapStart, $sourcemapEnd]');
continue;
}
final Uint8List sourcemapView = Uint8List.view(
@@ -528,7 +503,8 @@
final int metadataStart = metadataOffsets[0];
final int metadataEnd = metadataOffsets[1];
if (metadataStart < 0 || metadataEnd > metadataBytes.lengthInBytes) {
- globals.printTrace('Invalid byte index: [$metadataStart, $metadataEnd]');
+ globals
+ .printTrace('Invalid byte index: [$metadataStart, $metadataEnd]');
continue;
}
final Uint8List metadataView = Uint8List.view(
@@ -543,8 +519,8 @@
}
_mergedMetadata = _metadataFiles.values
- .map((Uint8List encoded) => utf8.decode(encoded))
- .join('\n');
+ .map((Uint8List encoded) => utf8.decode(encoded))
+ .join('\n');
return modules;
}
@@ -557,11 +533,12 @@
HttpHeaders.contentTypeHeader: 'text/html',
};
final File indexFile = globals.fs.currentDirectory
- .childDirectory('web')
- .childFile('index.html');
+ .childDirectory('web')
+ .childFile('index.html');
if (indexFile.existsSync()) {
- headers[HttpHeaders.contentLengthHeader] = indexFile.lengthSync().toString();
+ headers[HttpHeaders.contentLengthHeader] =
+ indexFile.lengthSync().toString();
return shelf.Response.ok(indexFile.openRead(), headers: headers);
}
@@ -576,23 +553,30 @@
case 'dart_sdk.js':
if (_buildInfo.nullSafetyMode == NullSafetyMode.unsound) {
return globals.fs.file(canvasKitRendering
- ? globals.artifacts.getArtifactPath(Artifact.webPrecompiledCanvaskitSdk)
- : globals.artifacts.getArtifactPath(Artifact.webPrecompiledSdk));
+ ? globals.artifacts
+ .getArtifactPath(Artifact.webPrecompiledCanvaskitSdk)
+ : globals.artifacts.getArtifactPath(Artifact.webPrecompiledSdk));
} else {
return globals.fs.file(canvasKitRendering
- ? globals.artifacts.getArtifactPath(Artifact.webPrecompiledCanvaskitSoundSdk)
- : globals.artifacts.getArtifactPath(Artifact.webPrecompiledSoundSdk));
+ ? globals.artifacts
+ .getArtifactPath(Artifact.webPrecompiledCanvaskitSoundSdk)
+ : globals.artifacts
+ .getArtifactPath(Artifact.webPrecompiledSoundSdk));
}
break;
case 'dart_sdk.js.map':
if (_buildInfo.nullSafetyMode == NullSafetyMode.unsound) {
return globals.fs.file(canvasKitRendering
- ? globals.artifacts.getArtifactPath(Artifact.webPrecompiledCanvaskitSdkSourcemaps)
- : globals.artifacts.getArtifactPath(Artifact.webPrecompiledSdkSourcemaps));
+ ? globals.artifacts.getArtifactPath(
+ Artifact.webPrecompiledCanvaskitSdkSourcemaps)
+ : globals.artifacts
+ .getArtifactPath(Artifact.webPrecompiledSdkSourcemaps));
} else {
return globals.fs.file(canvasKitRendering
- ? globals.artifacts.getArtifactPath(Artifact.webPrecompiledCanvaskitSoundSdkSourcemaps)
- : globals.artifacts.getArtifactPath(Artifact.webPrecompiledSoundSdkSourcemaps));
+ ? globals.artifacts.getArtifactPath(
+ Artifact.webPrecompiledCanvaskitSoundSdkSourcemaps)
+ : globals.artifacts
+ .getArtifactPath(Artifact.webPrecompiledSoundSdkSourcemaps));
}
}
// This is the special generated entrypoint.
@@ -603,7 +587,8 @@
// If this is a dart file, it must be on the local file system and is
// likely coming from a source map request. The tool doesn't currently
// consider the case of Dart files as assets.
- final File dartFile = globals.fs.file(globals.fs.currentDirectory.uri.resolve(path));
+ final File dartFile =
+ globals.fs.file(globals.fs.currentDirectory.uri.resolve(path));
if (dartFile.existsSync()) {
return dartFile;
}
@@ -616,8 +601,8 @@
// The file might have been a package file which is signaled by a
// `/packages/<package>/<path>` request.
if (segments.first == 'packages') {
- final Uri filePath = _packages.resolve(Uri(
- scheme: 'package', pathSegments: segments.skip(1)));
+ final Uri filePath = _packages
+ .resolve(Uri(scheme: 'package', pathSegments: segments.skip(1)));
if (filePath != null) {
final File packageFile = globals.fs.file(filePath);
if (packageFile.existsSync()) {
@@ -628,15 +613,16 @@
// Otherwise it must be a Dart SDK source or a Flutter Web SDK source.
final Directory dartSdkParent = globals.fs
- .directory(globals.artifacts.getArtifactPath(Artifact.engineDartSdkPath))
- .parent;
+ .directory(
+ globals.artifacts.getArtifactPath(Artifact.engineDartSdkPath))
+ .parent;
final File dartSdkFile = globals.fs.file(dartSdkParent.uri.resolve(path));
if (dartSdkFile.existsSync()) {
return dartSdkFile;
}
- final Directory flutterWebSdk = globals.fs.directory(globals.artifacts
- .getArtifactPath(Artifact.flutterWebSdk));
+ final Directory flutterWebSdk = globals.fs
+ .directory(globals.artifacts.getArtifactPath(Artifact.flutterWebSdk));
final File webSdkFile = globals.fs.file(flutterWebSdk.uri.resolve(path));
return webSdkFile;
@@ -666,6 +652,9 @@
}
return null;
}
+
+ @override
+ Future<void> close() async {}
}
class ConnectionResult {
@@ -722,16 +711,20 @@
///
/// Only calls [AppConnection.runMain] on the subsequent connections.
Future<ConnectionResult> connect(bool useDebugExtension) {
- final Completer<ConnectionResult> firstConnection = Completer<ConnectionResult>();
- _connectedApps = dwds.connectedApps.listen((AppConnection appConnection) async {
+ final Completer<ConnectionResult> firstConnection =
+ Completer<ConnectionResult>();
+ _connectedApps =
+ dwds.connectedApps.listen((AppConnection appConnection) async {
try {
final DebugConnection debugConnection = useDebugExtension
- ? await (_cachedExtensionFuture ??= dwds.extensionDebugConnections.stream.first)
- : await dwds.debugConnection(appConnection);
+ ? await (_cachedExtensionFuture ??=
+ dwds.extensionDebugConnections.stream.first)
+ : await dwds.debugConnection(appConnection);
if (firstConnection.isCompleted) {
appConnection.runMain();
} else {
- firstConnection.complete(ConnectionResult(appConnection, debugConnection));
+ firstConnection
+ .complete(ConnectionResult(appConnection, debugConnection));
}
} on Exception catch (error, stackTrace) {
if (!firstConnection.isCompleted) {
@@ -739,7 +732,8 @@
}
}
}, onError: (dynamic error, StackTrace stackTrace) {
- globals.printError('Unknown error while waiting for debug connection:$error\n$stackTrace');
+ globals.printError(
+ 'Unknown error while waiting for debug connection:$error\n$stackTrace');
if (!firstConnection.isCompleted) {
firstConnection.completeError(error, stackTrace);
}
@@ -831,15 +825,20 @@
final String outputDirectoryPath = mainFile.parent.path;
if (bundleFirstUpload) {
- webAssetServer.entrypointCacheDirectory = globals.fs.directory(outputDirectoryPath);
+ webAssetServer.entrypointCacheDirectory =
+ globals.fs.directory(outputDirectoryPath);
generator.addFileSystemRoot(outputDirectoryPath);
final String entrypoint = globals.fs.path.basename(mainFile.path);
webAssetServer.writeBytes(entrypoint, mainFile.readAsBytesSync());
webAssetServer.writeBytes('require.js', requireJS.readAsBytesSync());
- webAssetServer.writeBytes('stack_trace_mapper.js', stackTraceMapper.readAsBytesSync());
- webAssetServer.writeFile('manifest.json', '{"info":"manifest not generated in run mode."}');
- webAssetServer.writeFile('flutter_service_worker.js', '// Service worker not loaded in run mode.');
- webAssetServer.writeFile('version.json', FlutterProject.current().getVersionInfo());
+ webAssetServer.writeBytes(
+ 'stack_trace_mapper.js', stackTraceMapper.readAsBytesSync());
+ webAssetServer.writeFile(
+ 'manifest.json', '{"info":"manifest not generated in run mode."}');
+ webAssetServer.writeFile('flutter_service_worker.js',
+ '// Service worker not loaded in run mode.');
+ webAssetServer.writeFile(
+ 'version.json', FlutterProject.current().getVersionInfo());
webAssetServer.writeFile(
'main.dart.js',
generateBootstrapScript(
@@ -879,7 +878,8 @@
),
invalidatedFiles,
outputPath: dillOutputPath ??
- getDefaultApplicationKernelPath(trackWidgetCreation: trackWidgetCreation),
+ getDefaultApplicationKernelPath(
+ trackWidgetCreation: trackWidgetCreation),
packageConfig: packageConfig,
);
if (compilerOutput == null || compilerOutput.errorCount > 0) {
@@ -896,12 +896,18 @@
File metadataFile;
List<String> modules;
try {
- final Directory parentDirectory = globals.fs.directory(outputDirectoryPath);
- codeFile = parentDirectory.childFile('${compilerOutput.outputFilename}.sources');
- manifestFile = parentDirectory.childFile('${compilerOutput.outputFilename}.json');
- sourcemapFile = parentDirectory.childFile('${compilerOutput.outputFilename}.map');
- metadataFile = parentDirectory.childFile('${compilerOutput.outputFilename}.metadata');
- modules = webAssetServer.write(codeFile, manifestFile, sourcemapFile, metadataFile);
+ final Directory parentDirectory =
+ globals.fs.directory(outputDirectoryPath);
+ codeFile =
+ parentDirectory.childFile('${compilerOutput.outputFilename}.sources');
+ manifestFile =
+ parentDirectory.childFile('${compilerOutput.outputFilename}.json');
+ sourcemapFile =
+ parentDirectory.childFile('${compilerOutput.outputFilename}.map');
+ metadataFile = parentDirectory
+ .childFile('${compilerOutput.outputFilename}.metadata');
+ modules = webAssetServer.write(
+ codeFile, manifestFile, sourcemapFile, metadataFile);
} on FileSystemException catch (err) {
throwToolExit('Failed to load recompiled sources:\n$err');
}
@@ -939,17 +945,19 @@
}
class ReleaseAssetServer {
- ReleaseAssetServer(this.entrypoint, {
+ ReleaseAssetServer(
+ this.entrypoint, {
@required FileSystem fileSystem,
@required String webBuildDirectory,
@required String flutterRoot,
@required Platform platform,
this.basePath = '',
- }) : _fileSystem = fileSystem,
- _platform = platform,
- _flutterRoot = flutterRoot,
- _webBuildDirectory = webBuildDirectory,
- _fileSystemUtils = FileSystemUtils(fileSystem: fileSystem, platform: platform);
+ }) : _fileSystem = fileSystem,
+ _platform = platform,
+ _flutterRoot = flutterRoot,
+ _webBuildDirectory = webBuildDirectory,
+ _fileSystemUtils =
+ FileSystemUtils(fileSystem: fileSystem, platform: platform);
final Uri entrypoint;
final String _flutterRoot;
@@ -959,6 +967,7 @@
final Platform _platform;
@visibleForTesting
+
/// The base path to serve from.
///
/// It should have no leading or trailing slashes.
@@ -966,12 +975,12 @@
// Locations where source files, assets, or source maps may be located.
List<Uri> _searchPaths() => <Uri>[
- _fileSystem.directory(_webBuildDirectory).uri,
- _fileSystem.directory(_flutterRoot).uri,
- _fileSystem.directory(_flutterRoot).parent.uri,
- _fileSystem.currentDirectory.uri,
- _fileSystem.directory(_fileSystemUtils.homeDirPath).uri,
- ];
+ _fileSystem.directory(_webBuildDirectory).uri,
+ _fileSystem.directory(_flutterRoot).uri,
+ _fileSystem.directory(_flutterRoot).parent.uri,
+ _fileSystem.currentDirectory.uri,
+ _fileSystem.directory(_fileSystemUtils.homeDirPath).uri,
+ ];
Future<shelf.Response> handle(shelf.Request request) async {
if (request.method != 'GET') {
@@ -991,8 +1000,9 @@
} else {
for (final Uri uri in _searchPaths()) {
final Uri potential = uri.resolve(requestPath);
- if (potential == null || !_fileSystem.isFileSync(
- potential.toFilePath(windows: _platform.isWindows))) {
+ if (potential == null ||
+ !_fileSystem.isFileSync(
+ potential.toFilePath(windows: _platform.isWindows))) {
continue;
}
fileUri = potential;
@@ -1004,24 +1014,28 @@
final Uint8List bytes = file.readAsBytesSync();
// Fallback to "application/octet-stream" on null which
// makes no claims as to the structure of the data.
- final String mimeType = mime.lookupMimeType(file.path, headerBytes: bytes)
- ?? 'application/octet-stream';
+ final String mimeType =
+ mime.lookupMimeType(file.path, headerBytes: bytes) ??
+ 'application/octet-stream';
return shelf.Response.ok(bytes, headers: <String, String>{
'Content-Type': mimeType,
});
}
- final File file = _fileSystem.file(_fileSystem.path.join(_webBuildDirectory, 'index.html'));
+ final File file = _fileSystem
+ .file(_fileSystem.path.join(_webBuildDirectory, 'index.html'));
return shelf.Response.ok(file.readAsBytesSync(), headers: <String, String>{
'Content-Type': 'text/html',
});
}
}
-Future<Directory> _loadDwdsDirectory(FileSystem fileSystem, Logger logger) async {
- final String toolPackagePath = fileSystem.path.join(
- Cache.flutterRoot, 'packages', 'flutter_tools');
- final String packageFilePath = fileSystem.path.join(toolPackagePath, kPackagesFileName);
+Future<Directory> _loadDwdsDirectory(
+ FileSystem fileSystem, Logger logger) async {
+ final String toolPackagePath =
+ fileSystem.path.join(Cache.flutterRoot, 'packages', 'flutter_tools');
+ final String packageFilePath =
+ fileSystem.path.join(toolPackagePath, kPackagesFileName);
final PackageConfig packageConfig = await loadPackageConfigWithLogging(
fileSystem.file(packageFilePath),
logger: logger,
@@ -1055,13 +1069,13 @@
}
String _parseBasePathFromIndexHtml(File indexHtml) {
- final String htmlContent = indexHtml.existsSync()
- ? indexHtml.readAsStringSync()
- : _kDefaultIndex;
+ final String htmlContent =
+ indexHtml.existsSync() ? indexHtml.readAsStringSync() : _kDefaultIndex;
final Document document = parse(htmlContent);
final Element baseElement = document.querySelector('base');
- String baseHref = baseElement?.attributes == null ? null : baseElement.attributes['href'];
+ String baseHref =
+ baseElement?.attributes == null ? null : baseElement.attributes['href'];
if (baseHref == null) {
baseHref = '';
diff --git a/packages/flutter_tools/pubspec.yaml b/packages/flutter_tools/pubspec.yaml
index 3f05405..d121da8 100644
--- a/packages/flutter_tools/pubspec.yaml
+++ b/packages/flutter_tools/pubspec.yaml
@@ -49,7 +49,7 @@
mime: 0.9.7
logging: 0.11.4
http_multi_server: 2.2.0
- devtools_server: 0.8.0+3
+ devtools_server: 0.9.3+4
convert: 2.1.1
async: 2.5.0-nullsafety.1
@@ -59,7 +59,7 @@
test_api: 0.2.19-nullsafety.2
test_core: 0.3.12-nullsafety.5
- vm_service: 4.2.0
+ vm_service: 5.2.0
_fe_analyzer_shared: 7.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
analyzer: 0.39.17 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -71,8 +71,8 @@
cli_util: 0.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
clock: 1.1.0-nullsafety.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
csslib: 0.16.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
- devtools: 0.8.0+3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
- devtools_shared: 0.8.0+3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
+ devtools: 0.9.3+4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
+ devtools_shared: 0.9.3+4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
fixnum: 0.10.11 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
glob: 1.2.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
http_parser: 3.1.4 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
@@ -113,4 +113,8 @@
# Exclude this package from the hosted API docs.
nodoc: true
-# PUBSPEC CHECKSUM: 138b
+# PUBSPEC CHECKSUM: 9d86
+
+dependency_overrides:
+ dwds:
+ path: /Users/annagrin/source/webdev/dwds