refactor: snapshotting (#3753)

This commit is contained in:
Bartek Iwańczuk 2020-01-22 23:58:13 +01:00 committed by GitHub
parent bd9561f4de
commit 63293a90e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 155 additions and 143 deletions

View file

@ -3,7 +3,7 @@
import { ASSETS, Host } from "./compiler_host.ts";
import { core } from "./core.ts";
import * as dispatch from "./dispatch.ts";
import { sendSync } from "./dispatch_json.ts";
import { getAsset } from "./compiler_util.ts";
// This registers ops that are available during the snapshotting process.
const ops = core.ops();
@ -26,9 +26,9 @@ export const oldProgram = ts.createProgram({
host
});
/** A module loader which is concatenated into bundle files. We read all static
* assets during the snapshotting process, which is why this is located in
* compiler_bootstrap. */
export const bundleLoader = sendSync(dispatch.OP_FETCH_ASSET, {
name: "bundle_loader.js"
});
/** A module loader which is concatenated into bundle files.
*
* We read all static assets during the snapshotting process, which is
* why this is located in compiler_bootstrap.
**/
export const bundleLoader = getAsset("bundle_loader.js");