Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web] Update felt to use generated JS runtime for Dart2Wasm. #38786

Merged
merged 1 commit into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions lib/web_ui/dev/steps/compile_tests_step.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class CompileTestsStep implements PipelineStep {
await environment.webUiBuildDir.create();
if (isWasm) {
await copyDart2WasmTestScript();
await copyDart2WasmRuntime();
}
await copyCanvasKitFiles(useLocalCanvasKit: useLocalCanvasKit);
await buildHostPage();
Expand Down Expand Up @@ -129,20 +128,6 @@ Future<void> copySkiaTestImages() async {
}
}

Future<void> copyDart2WasmRuntime() async {
final io.File sourceFile = io.File(pathlib.join(
environment.dartSdkDir.path,
'bin',
'dart2wasm_runtime.mjs',
));
final io.Directory targetDir = io.Directory(pathlib.join(
environment.webUiBuildDir.path,
'dart2wasm_runtime.mjs',
));

await sourceFile.copy(targetDir.path);
}

Future<void> copyDart2WasmTestScript() async {
final io.File sourceFile = io.File(pathlib.join(
environment.webUiDevDir.path,
Expand Down
5 changes: 3 additions & 2 deletions lib/web_ui/dev/test_dart2wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ window.onload = async function () {
let dart2wasm_runtime;
let moduleInstance;
try {
dart2wasm_runtime = await import('./dart2wasm_runtime.mjs');
const dartModulePromise = WebAssembly.compileStreaming(fetch(link.href + ".browser_test.dart.wasm"));
let baseName = link.href + '.browser_test.dart';
dart2wasm_runtime = await import(baseName + '.mjs');
const dartModulePromise = WebAssembly.compileStreaming(fetch(baseName + '.wasm'));
moduleInstance = await dart2wasm_runtime.instantiate(dartModulePromise, {});
} catch (exception) {
const message = `Failed to fetch and instantiate wasm module: ${exception}`;
Expand Down