diff --git a/Cargo.lock b/Cargo.lock index 8329dde..fd94eba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,6 +87,15 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "better_scoped_tls" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73e8ecdec39e98aa3b19e8cd0b8ed8f77ccb86a6b0b2dc7cd86d105438a2123" +dependencies = [ + "scoped-tls", +] + [[package]] name = "bitflags" version = "1.2.1" @@ -278,9 +287,9 @@ dependencies = [ [[package]] name = "deno_ast" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd88c9bfcb036294da03e7bf8b5d7f1276b0ad522b0b057ca2b839ee9325a33" +checksum = "87226a2fc1270fe8037e1d0c9048d6605c2ed938abceda2570fe047aa70608db" dependencies = [ "anyhow", "base64 0.13.0", @@ -346,9 +355,9 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3108bfa75e0f439f83ac8540d8e494b7d3c8a782db805d126e3a3125d84a38b" +checksum = "d5930dfda71f3a9d066520e5b5f3905d6d27b1247fc46a9037dd2ad1c0dbe193" dependencies = [ "anyhow", "cfg-if 1.0.0", @@ -420,7 +429,7 @@ dependencies = [ [[package]] name = "eszip" -version = "0.16.1" +version = "0.17.0" dependencies = [ "anyhow", "base64 0.13.0", @@ -443,7 +452,7 @@ dependencies = [ [[package]] name = "eszip_wasm" -version = "0.16.1" +version = "0.17.0" dependencies = [ "anyhow", "console_error_panic_hook", @@ -1794,9 +1803,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.89.4" +version = "0.90.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3dda60113af30e9d9da0b15753850b8e794ee15d9cfe8aadfe05651fb692bf8" +checksum = "7cf4da57030370c49c343e536d3c7ab66dca3bd8da000b6040884fc6ac689241" dependencies = [ "bitflags", "memchr", @@ -1826,9 +1835,9 @@ dependencies = [ [[package]] name = "swc_ecma_dep_graph" -version = "0.58.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf46c8d3c4b34072e2e958b259781d9a94a00f23806c402eba40b8e9865f9dda" +checksum = "c8ccd6ffe5f3c66da6713d97225561dd85c49d275343b787fc603193ec691955" dependencies = [ "swc_atoms", "swc_common", @@ -1838,9 +1847,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.87.1" +version = "0.88.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f032c57793a287a8b374e92a2b606e5eb890539285e4723fe6acb9be1fadcec6" +checksum = "bfd30c93f08afdf29226b5695e45aadcc6ce452470cc63ea87a7eb53d29bb02b" dependencies = [ "either", "enum_kind", @@ -1858,9 +1867,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.114.6" +version = "0.117.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01f4bdd4e2a199e4a30f274c99f8f08607da5419191d89f321a7edcf21ea44f" +checksum = "b1fa132c1a736c2c61736958f1102249348a4cc911c7f60e3a6255aa49c1c03e" dependencies = [ "swc_atoms", "swc_common", @@ -1877,13 +1886,13 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.57.1" +version = "0.58.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df852cb3c04bfde542f2fe4493ff0262a053a94a8da068fcb3ab2f6f40bffe8f" +checksum = "9476fc0cd42cfc262764a21033a4b2cf5ee9b67d207007e0515af14f9e2aa253" dependencies = [ + "better_scoped_tls", "once_cell", "phf", - "scoped-tls", "serde", "smallvec", "swc_atoms", @@ -1897,9 +1906,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.44.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1b841535a8a97698a556c50fd5993a351e76b8bfd1e770ffc1b5425c1814b98" +checksum = "ac8983235c6902879b65dcb1003d4084adf094408c96d94d62d3f33f44c3fa8e" dependencies = [ "swc_atoms", "swc_common", @@ -1924,9 +1933,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.75.1" +version = "0.77.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2d08a837960a7547435ccb94e860d81b3c3d67c52f7296c8753520cfba45b31" +checksum = "048ac8ea82e02fa9a54b9aa448dc5d15a8e994304364fcd8c4e2f650572c9141" dependencies = [ "either", "serde", @@ -1944,9 +1953,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.77.0" +version = "0.80.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501833c2b1be774dcafcf999cf9256c4c33478778da46d125c525505d3542972" +checksum = "9fb5b7c98597bf41d1503ca4039be5445fd02e7aa381ae520d1c78a8a370f7f5" dependencies = [ "ahash", "base64 0.13.0", @@ -1969,9 +1978,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.79.0" +version = "0.82.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbdfd5d240c6b32e84f89c66e7b259c6a0f2cde4630ac9e0ce1243807056c349" +checksum = "f7859a18a33f751d488fbc1b7a0073fb08c69d794ad1f8daa2da47bfda2d9242" dependencies = [ "serde", "swc_atoms", @@ -1986,9 +1995,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.64.0" +version = "0.65.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8105c87f59b54e49b95164efbdf346b710e0a77390e89869527ee20f68687b91" +checksum = "b462ac7dd5340544e7a12965bb7fbbbf9db8b26c1b32159b43c4b2430fed3fc8" dependencies = [ "indexmap", "once_cell", @@ -2015,9 +2024,9 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "0.111.14" +version = "0.114.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4f14fc36deb60d385359dca5446ad2a6dc9550cb422c62d154d4bb1bab31b" +checksum = "988f15eb7dcd2a9e4c93e11d27dbcdfbf9e350776af36f51310e3d2ee91635ad" dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", diff --git a/Cargo.toml b/Cargo.toml index 235da12..7e34501 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eszip" -version = "0.16.1" +version = "0.17.0" authors = ["the Deno authors"] edition = "2021" repository = "https://github.com/denoland/eszip" @@ -35,8 +35,8 @@ path = "src/examples/load.rs" [dependencies] anyhow = "1" base64 = "0.13.0" -deno_ast = { version = "0.11.0", features = ["transpiling"] } -deno_graph = "0.23.0" +deno_ast = { version = "0.12.0", features = ["transpiling"] } +deno_graph = "0.24.0" futures = "0.3.19" serde = "1" serde_json = "1" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index c1ad302..a3ba860 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eszip_wasm" -version = "0.16.1" +version = "0.17.0" authors = ["the Deno authors"] edition = "2021" description = "A utility that can download JavaScript and TypeScript module graphs and store them locally in a special zip file" @@ -14,8 +14,8 @@ crate-type = ["cdylib"] [dependencies] js-sys = { version = "0.3.55" } web-sys = { version = "0.3.56", features = ["ReadableStreamByobReader"] } -deno_graph = { version = "0.23.0" } -eszip = { path = "../", version = "0.16.0" } +deno_graph = { version = "0.24.0" } +eszip = { path = "../" } wasm-bindgen = { version = "0.2.79", features = ["serde-serialize"] } wasm-bindgen-futures = { version = "0.4.28" } tokio = { version = "1.16", features = ["io-std", "io-util"] } diff --git a/lib/eszip_wasm.generated.js b/lib/eszip_wasm.generated.js index e60c1d9..4c75cda 100644 --- a/lib/eszip_wasm.generated.js +++ b/lib/eszip_wasm.generated.js @@ -10,29 +10,6 @@ function getObject(idx) { return heap[idx]; } -let heap_next = heap.length; - -function dropObject(idx) { - if (idx < 36) return; - heap[idx] = heap_next; - heap_next = idx; -} - -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} - -function addHeapObject(obj) { - if (heap_next === heap.length) heap.push(heap.length + 1); - const idx = heap_next; - heap_next = heap[idx]; - - heap[idx] = obj; - return idx; -} - let WASM_VECTOR_LEN = 0; let cachegetUint8Memory0 = null; @@ -104,6 +81,20 @@ function getInt32Memory0() { return cachegetInt32Memory0; } +let heap_next = heap.length; + +function dropObject(idx) { + if (idx < 36) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true, @@ -115,6 +106,15 @@ function getStringFromWasm0(ptr, len) { return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); } +function addHeapObject(obj) { + if (heap_next === heap.length) heap.push(heap.length + 1); + const idx = heap_next; + heap_next = heap[idx]; + + heap[idx] = obj; + return idx; +} + function debugString(val) { // primitive types const type = typeof val; @@ -210,7 +210,7 @@ function makeMutClosure(arg0, arg1, dtor, f) { } function __wbg_adapter_24(arg0, arg1, arg2) { wasm - ._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5cfa7553a99973a2( + ._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hcea7d4b8be454f74( arg0, arg1, addHeapObject(arg2), @@ -242,7 +242,7 @@ function handleError(f, args) { } } function __wbg_adapter_62(arg0, arg1, arg2, arg3) { - wasm.wasm_bindgen__convert__closures__invoke2_mut__h7fbd29c1fe4dda8a( + wasm.wasm_bindgen__convert__closures__invoke2_mut__hf427754c00c64aa5( arg0, arg1, addHeapObject(arg2), @@ -340,9 +340,75 @@ export class Parser { const imports = { __wbindgen_placeholder__: { + __wbindgen_string_get: function (arg0, arg1) { + const obj = getObject(arg1); + var ret = typeof (obj) === "string" ? obj : undefined; + var ptr0 = isLikeNone(ret) + ? 0 + : passStringToWasm0( + ret, + wasm.__wbindgen_malloc, + wasm.__wbindgen_realloc, + ); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }, __wbindgen_object_drop_ref: function (arg0) { takeObject(arg0); }, + __wbindgen_string_new: function (arg0, arg1) { + var ret = getStringFromWasm0(arg0, arg1); + return addHeapObject(ret); + }, + __wbg_new_16f24b0728c5e67b: function () { + var ret = new Array(); + return addHeapObject(ret); + }, + __wbg_push_a72df856079e6930: function (arg0, arg1) { + var ret = getObject(arg0).push(getObject(arg1)); + return ret; + }, + __wbg_resolve_4f8f547f26b30b27: function (arg0) { + var ret = Promise.resolve(getObject(arg0)); + return addHeapObject(ret); + }, + __wbindgen_json_serialize: function (arg0, arg1) { + const obj = getObject(arg1); + var ret = JSON.stringify(obj === undefined ? null : obj); + var ptr0 = passStringToWasm0( + ret, + wasm.__wbindgen_malloc, + wasm.__wbindgen_realloc, + ); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }, + __wbg_new_55259b13834a484c: function (arg0, arg1) { + var ret = new Error(getStringFromWasm0(arg0, arg1)); + return addHeapObject(ret); + }, + __wbindgen_memory: function () { + var ret = wasm.memory; + return addHeapObject(ret); + }, + __wbg_buffer_5e74a88a1424a2e0: function (arg0) { + var ret = getObject(arg0).buffer; + return addHeapObject(ret); + }, + __wbg_newwithbyteoffsetandlength_278ec7532799393a: function ( + arg0, + arg1, + arg2, + ) { + var ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); + return addHeapObject(ret); + }, + __wbg_new_e3b800e570795b3c: function (arg0) { + var ret = new Uint8Array(getObject(arg0)); + return addHeapObject(ret); + }, __wbg_newwithlength_5f4ce114a24dfe1e: function (arg0) { var ret = new Uint8Array(arg0 >>> 0); return addHeapObject(ret); @@ -351,7 +417,7 @@ const imports = { var ret = getObject(arg0).read(getObject(arg1)); return addHeapObject(ret); }, - __wbg_done_bf4e7bf04e1a2ebd: function (arg0) { + __wbg_done_74d1aafec84d2537: function (arg0) { var ret = getObject(arg0).done; return ret; }, @@ -364,7 +430,7 @@ const imports = { var ret = getObject(arg0).toString(); return addHeapObject(ret); }, - __wbg_value_f6f2ef297faa6b4a: function (arg0) { + __wbg_value_b4ff0f7fb5da6f6e: function (arg0) { var ret = getObject(arg0).value; return isLikeNone(ret) ? 0 : addHeapObject(ret); }, @@ -376,18 +442,6 @@ const imports = { var ret = getObject(arg0).length; return ret; }, - __wbindgen_memory: function () { - var ret = wasm.memory; - return addHeapObject(ret); - }, - __wbg_buffer_5e74a88a1424a2e0: function (arg0) { - var ret = getObject(arg0).buffer; - return addHeapObject(ret); - }, - __wbg_new_e3b800e570795b3c: function (arg0) { - var ret = new Uint8Array(getObject(arg0)); - return addHeapObject(ret); - }, __wbg_set_5b8081e9d002f0df: function (arg0, arg1, arg2) { getObject(arg0).set(getObject(arg1), arg2 >>> 0); }, @@ -419,60 +473,6 @@ const imports = { state0.a = state0.b = 0; } }, - __wbindgen_string_get: function (arg0, arg1) { - const obj = getObject(arg1); - var ret = typeof (obj) === "string" ? obj : undefined; - var ptr0 = isLikeNone(ret) - ? 0 - : passStringToWasm0( - ret, - wasm.__wbindgen_malloc, - wasm.__wbindgen_realloc, - ); - var len0 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len0; - getInt32Memory0()[arg0 / 4 + 0] = ptr0; - }, - __wbindgen_string_new: function (arg0, arg1) { - var ret = getStringFromWasm0(arg0, arg1); - return addHeapObject(ret); - }, - __wbindgen_json_serialize: function (arg0, arg1) { - const obj = getObject(arg1); - var ret = JSON.stringify(obj === undefined ? null : obj); - var ptr0 = passStringToWasm0( - ret, - wasm.__wbindgen_malloc, - wasm.__wbindgen_realloc, - ); - var len0 = WASM_VECTOR_LEN; - getInt32Memory0()[arg0 / 4 + 1] = len0; - getInt32Memory0()[arg0 / 4 + 0] = ptr0; - }, - __wbg_new_55259b13834a484c: function (arg0, arg1) { - var ret = new Error(getStringFromWasm0(arg0, arg1)); - return addHeapObject(ret); - }, - __wbg_newwithbyteoffsetandlength_278ec7532799393a: function ( - arg0, - arg1, - arg2, - ) { - var ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0); - return addHeapObject(ret); - }, - __wbg_new_16f24b0728c5e67b: function () { - var ret = new Array(); - return addHeapObject(ret); - }, - __wbg_push_a72df856079e6930: function (arg0, arg1) { - var ret = getObject(arg0).push(getObject(arg1)); - return ret; - }, - __wbg_resolve_4f8f547f26b30b27: function (arg0) { - var ret = Promise.resolve(getObject(arg0)); - return addHeapObject(ret); - }, __wbg_new_693216e109162396: function () { var ret = new Error(); return addHeapObject(ret); @@ -567,10 +567,6 @@ const imports = { __wbindgen_throw: function (arg0, arg1) { throw new Error(getStringFromWasm0(arg0, arg1)); }, - __wbg_then_58a04e42527f52c6: function (arg0, arg1, arg2) { - var ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); - return addHeapObject(ret); - }, __wbindgen_cb_drop: function (arg0) { const obj = takeObject(arg0).original; if (obj.cnt-- == 1) { @@ -580,12 +576,16 @@ const imports = { var ret = false; return ret; }, + __wbg_then_58a04e42527f52c6: function (arg0, arg1, arg2) { + var ret = getObject(arg0).then(getObject(arg1), getObject(arg2)); + return addHeapObject(ret); + }, __wbg_then_a6860c82b90816ca: function (arg0, arg1) { var ret = getObject(arg0).then(getObject(arg1)); return addHeapObject(ret); }, - __wbindgen_closure_wrapper8569: function (arg0, arg1, arg2) { - var ret = makeMutClosure(arg0, arg1, 135, __wbg_adapter_24); + __wbindgen_closure_wrapper8886: function (arg0, arg1, arg2) { + var ret = makeMutClosure(arg0, arg1, 130, __wbg_adapter_24); return addHeapObject(ret); }, }, diff --git a/lib/eszip_wasm_bg.wasm b/lib/eszip_wasm_bg.wasm index 40d5348..cc4b20a 100644 Binary files a/lib/eszip_wasm_bg.wasm and b/lib/eszip_wasm_bg.wasm differ