[flutter_tools] share bootstrap module between run and test#70903
[flutter_tools] share bootstrap module between run and test#70903jonahwilliams merged 2 commits intoflutter:masterfrom
Conversation
| '''; | ||
| } | ||
|
|
||
| String generatedActualMain(String bootstrapUrl, String mainUri) { |
There was a problem hiding this comment.
This is deleted and shared with run.
| CancelableOperation<dynamic> displayPause() => _manager._displayPause(); | ||
| } | ||
|
|
||
| String bootstrapFileContents(String mainUri, String requireUrl, String mapperUrl) { |
There was a problem hiding this comment.
This was moved to web/bootstrap.dart
| final String leadingPath = request.url.path.split('.browser_test.dart.js')[0]; | ||
| final String generatedFile = _fileSystem.path.split(leadingPath).join('_') + '.bootstrap.js'; | ||
| return shelf.Response.ok(bootstrapFileContents('/' + generatedFile, 'require.js', 'dart_stack_trace_mapper.js'), headers: <String, String>{ | ||
| return shelf.Response.ok(generateTestBootstrapFileContents('/' + generatedFile, 'require.js', 'dart_stack_trace_mapper.js'), headers: <String, String>{ |
There was a problem hiding this comment.
Flutter run and test can share the generated bootstrap module.
This looks like it's doing the same thing in the same spot. Will there be a follow up PR where you use the bootstrap code in a second place? Or am I missing it.
There was a problem hiding this comment.
generatedActualMain was deleted and replaced with the existing logic in web/bootstrap.dart. bootstrapFileContents was renamed to generateTestBootstrapFileContents and moved to bootstrap.dart but is otherwise unchanged
There was a problem hiding this comment.
Ah I missed that generateMainModule wasn't new.
Description
Flutter run and test can share the generated bootstrap module. Also wire up null-assertions for flutter test and move all of the fields together.