Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 09c37d7

Browse files
committed
Boom!
1 parent b7bc705 commit 09c37d7

26 files changed

+150
-130
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
rust-version: stable
3030

3131
- name: Deno test
32-
run: deno test -A --location=http://localhost --import-map=import_map.json
32+
run: deno test -A --unstable --location=http://localhost
3333

3434
- name: Deno lint
3535
run: deno lint

.vscode/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@
1414
"editor.formatOnSave": true,
1515
},
1616
"deno.enable": true,
17-
"deno.unstable": true,
17+
"deno.unstable": false,
1818
"deno.lint": true,
19-
"deno.config": "./deno.json",
20-
"deno.importMap": "./import_map.json",
19+
"deno.config": "./deno.dom.json",
2120
"deno.suggest.imports.hosts": {
2221
"https://deno.land": true,
2322
"https://esm.sh": false

cli.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { bold } from "https://deno.land/std@0.128.0/fmt/colors.ts";
2-
import { readLines } from "https://deno.land/std@0.128.0/io/mod.ts";
3-
import { writeAll } from "https://deno.land/std@0.128.0/streams/conversion.ts";
4-
import { basename, resolve } from "https://deno.land/std@0.128.0/path/mod.ts";
1+
import { bold } from "https://deno.land/std@0.134.0/fmt/colors.ts";
2+
import { readLines } from "https://deno.land/std@0.134.0/io/mod.ts";
3+
import { writeAll } from "https://deno.land/std@0.134.0/streams/conversion.ts";
4+
import { basename, resolve } from "https://deno.land/std@0.134.0/path/mod.ts";
55
import { readImportMap } from "./server/config.ts";
66
import { parse } from "./lib/flags.ts";
77
import { existsDir, findFile } from "./lib/fs.ts";

commands/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { basename, resolve } from "https://deno.land/std@0.128.0/path/mod.ts";
1+
import { basename, resolve } from "https://deno.land/std@0.134.0/path/mod.ts";
22
import { getFlag, parse } from "../lib/flags.ts";
33
import { existsDir, findFile } from "../lib/fs.ts";
44
import { builtinModuleExts } from "../lib/helpers.ts";

commands/dev.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { basename, relative, resolve } from "https://deno.land/std@0.128.0/path/mod.ts";
2-
import { serve as stdServe, serveTls } from "https://deno.land/std@0.128.0/http/server.ts";
1+
import { basename, relative, resolve } from "https://deno.land/std@0.134.0/path/mod.ts";
2+
import { serve as stdServe, serveTls } from "https://deno.land/std@0.134.0/http/server.ts";
33
import mitt, { Emitter } from "https://esm.sh/[email protected]";
44
import { getFlag, parse, parsePortNumber } from "../lib/flags.ts";
55
import { existsDir, findFile, watchFs } from "../lib/fs.ts";

commands/init.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Untar } from "https://deno.land/std@0.128.0/archive/tar.ts";
2-
import { Buffer } from "https://deno.land/std@0.128.0/io/buffer.ts";
3-
import { copy, readAll } from "https://deno.land/std@0.128.0/streams/conversion.ts";
4-
import { blue, cyan, dim, green, red } from "https://deno.land/std@0.128.0/fmt/colors.ts";
5-
import { ensureDir } from "https://deno.land/std@0.128.0/fs/ensure_dir.ts";
6-
import { basename, join } from "https://deno.land/std@0.128.0/path/mod.ts";
1+
import { Untar } from "https://deno.land/std@0.134.0/archive/tar.ts";
2+
import { Buffer } from "https://deno.land/std@0.134.0/io/buffer.ts";
3+
import { copy, readAll } from "https://deno.land/std@0.134.0/streams/conversion.ts";
4+
import { blue, cyan, dim, green, red } from "https://deno.land/std@0.134.0/fmt/colors.ts";
5+
import { ensureDir } from "https://deno.land/std@0.134.0/fs/ensure_dir.ts";
6+
import { basename, join } from "https://deno.land/std@0.134.0/path/mod.ts";
77
import { gunzip } from "https://deno.land/x/[email protected]/mod.ts";
88
import { existsDir } from "../lib/fs.ts";
99
import log from "../lib/log.ts";

commands/start.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { basename, resolve } from "https://deno.land/std@0.128.0/path/mod.ts";
2-
import { serve as stdServe, serveTls } from "https://deno.land/std@0.128.0/http/server.ts";
1+
import { basename, resolve } from "https://deno.land/std@0.134.0/path/mod.ts";
2+
import { serve as stdServe, serveTls } from "https://deno.land/std@0.134.0/http/server.ts";
33
import { getFlag, parse, parsePortNumber } from "../lib/flags.ts";
44
import { existsDir, findFile } from "../lib/fs.ts";
55
import { builtinModuleExts } from "../lib/helpers.ts";

compiler/build.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { dim } from "https://deno.land/std@0.128.0/fmt/colors.ts";
2-
import { encode } from "https://deno.land/std@0.128.0/encoding/base64.ts";
3-
import { ensureDir } from "https://deno.land/std@0.128.0/fs/ensure_dir.ts";
4-
import { dirname } from "https://deno.land/std@0.128.0/path/mod.ts";
5-
import { compress } from "https://deno.land/x/brotli@v0.1.4/mod.ts";
1+
import { dim } from "https://deno.land/std@0.134.0/fmt/colors.ts";
2+
import { encode } from "https://deno.land/std@0.134.0/encoding/base64.ts";
3+
import { ensureDir } from "https://deno.land/std@0.134.0/fs/ensure_dir.ts";
4+
import { dirname } from "https://deno.land/std@0.134.0/path/mod.ts";
5+
import { compress } from "https://deno.land/x/lz4@v0.1.2/mod.ts";
66

77
async function run(cmd: string[]) {
88
const p = Deno.run({
@@ -31,13 +31,13 @@ if (import.meta.main) {
3131
await ensureDir("./dist");
3232
await Deno.writeTextFile(
3333
"./dist/wasm.js",
34-
`import { decompress } from "https://deno.land/x/brotli@v0.1.4/mod.ts";\nexport default () => decompress(Uint8Array.from(atob("${
34+
`import { decompress } from "https://deno.land/x/lz4@v0.1.2/mod.ts";\nexport default () => decompress(Uint8Array.from(atob("${
3535
encode(compress(wasmData))
3636
}"), c => c.charCodeAt(0)));`,
3737
);
3838
await Deno.writeTextFile(
3939
"./dist/compiler.js",
40-
"import { red } from 'https://deno.land/std@0.128.0/fmt/colors.ts';" +
40+
"import { red } from 'https://deno.land/std@0.134.0/fmt/colors.ts';" +
4141
jsCode
4242
.replace(`import * as __wbg_star0 from 'env';`, "")
4343
.replace(`imports['env'] = __wbg_star0;`, `imports['env'] = { now: () => Date.now() };`)

compiler/dist/compiler.js

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { red } from "https://deno.land/std@0.128.0/fmt/colors.ts";
1+
import { red } from "https://deno.land/std@0.134.0/fmt/colors.ts";
22
let wasm;
33

44
const heap = new Array(32).fill(undefined);
@@ -9,23 +9,7 @@ function getObject(idx) {
99
return heap[idx];
1010
}
1111

12-
let heap_next = heap.length;
13-
14-
function dropObject(idx) {
15-
if (idx < 36) return;
16-
heap[idx] = heap_next;
17-
heap_next = idx;
18-
}
19-
20-
function takeObject(idx) {
21-
const ret = getObject(idx);
22-
dropObject(idx);
23-
return ret;
24-
}
25-
26-
let cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
27-
28-
cachedTextDecoder.decode();
12+
let WASM_VECTOR_LEN = 0;
2913

3014
let cachegetUint8Memory0 = null;
3115
function getUint8Memory0() {
@@ -35,22 +19,7 @@ function getUint8Memory0() {
3519
return cachegetUint8Memory0;
3620
}
3721

38-
function getStringFromWasm0(ptr, len) {
39-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
40-
}
41-
42-
function addHeapObject(obj) {
43-
if (heap_next === heap.length) heap.push(heap.length + 1);
44-
const idx = heap_next;
45-
heap_next = heap[idx];
46-
47-
heap[idx] = obj;
48-
return idx;
49-
}
50-
51-
let WASM_VECTOR_LEN = 0;
52-
53-
let cachedTextEncoder = new TextEncoder("utf-8");
22+
const cachedTextEncoder = new TextEncoder("utf-8");
5423

5524
const encodeString = (typeof cachedTextEncoder.encodeInto === "function"
5625
? function (arg, view) {
@@ -109,6 +78,37 @@ function getInt32Memory0() {
10978
}
11079
return cachegetInt32Memory0;
11180
}
81+
82+
let heap_next = heap.length;
83+
84+
function dropObject(idx) {
85+
if (idx < 36) return;
86+
heap[idx] = heap_next;
87+
heap_next = idx;
88+
}
89+
90+
function takeObject(idx) {
91+
const ret = getObject(idx);
92+
dropObject(idx);
93+
return ret;
94+
}
95+
96+
const cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
97+
98+
cachedTextDecoder.decode();
99+
100+
function getStringFromWasm0(ptr, len) {
101+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
102+
}
103+
104+
function addHeapObject(obj) {
105+
if (heap_next === heap.length) heap.push(heap.length + 1);
106+
const idx = heap_next;
107+
heap_next = heap[idx];
108+
109+
heap[idx] = obj;
110+
return idx;
111+
}
112112
/**
113113
* @param {string} specifier
114114
* @param {string} code
@@ -118,10 +118,10 @@ function getInt32Memory0() {
118118
export function fastTransform(specifier, code, options) {
119119
try {
120120
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
121-
var ptr0 = passStringToWasm0(specifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
122-
var len0 = WASM_VECTOR_LEN;
123-
var ptr1 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
124-
var len1 = WASM_VECTOR_LEN;
121+
const ptr0 = passStringToWasm0(specifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
122+
const len0 = WASM_VECTOR_LEN;
123+
const ptr1 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
124+
const len1 = WASM_VECTOR_LEN;
125125
wasm.fastTransform(retptr, ptr0, len0, ptr1, len1, addHeapObject(options));
126126
var r0 = getInt32Memory0()[retptr / 4 + 0];
127127
var r1 = getInt32Memory0()[retptr / 4 + 1];
@@ -143,10 +143,10 @@ export function fastTransform(specifier, code, options) {
143143
export function parseExportNames(specifier, code) {
144144
try {
145145
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
146-
var ptr0 = passStringToWasm0(specifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
147-
var len0 = WASM_VECTOR_LEN;
148-
var ptr1 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
149-
var len1 = WASM_VECTOR_LEN;
146+
const ptr0 = passStringToWasm0(specifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
147+
const len0 = WASM_VECTOR_LEN;
148+
const ptr1 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
149+
const len1 = WASM_VECTOR_LEN;
150150
wasm.parseExportNames(retptr, ptr0, len0, ptr1, len1);
151151
var r0 = getInt32Memory0()[retptr / 4 + 0];
152152
var r1 = getInt32Memory0()[retptr / 4 + 1];
@@ -169,10 +169,10 @@ export function parseExportNames(specifier, code) {
169169
export function transform(specifier, code, options) {
170170
try {
171171
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
172-
var ptr0 = passStringToWasm0(specifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
173-
var len0 = WASM_VECTOR_LEN;
174-
var ptr1 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
175-
var len1 = WASM_VECTOR_LEN;
172+
const ptr0 = passStringToWasm0(specifier, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
173+
const len0 = WASM_VECTOR_LEN;
174+
const ptr1 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
175+
const len1 = WASM_VECTOR_LEN;
176176
wasm.transform(retptr, ptr0, len0, ptr1, len1, addHeapObject(options));
177177
var r0 = getInt32Memory0()[retptr / 4 + 0];
178178
var r1 = getInt32Memory0()[retptr / 4 + 1];
@@ -195,10 +195,10 @@ export function transform(specifier, code, options) {
195195
export function transformCSS(filename, code, config_val) {
196196
try {
197197
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
198-
var ptr0 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
199-
var len0 = WASM_VECTOR_LEN;
200-
var ptr1 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
201-
var len1 = WASM_VECTOR_LEN;
198+
const ptr0 = passStringToWasm0(filename, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
199+
const len0 = WASM_VECTOR_LEN;
200+
const ptr1 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
201+
const len1 = WASM_VECTOR_LEN;
202202
wasm.transformCSS(retptr, ptr0, len0, ptr1, len1, addHeapObject(config_val));
203203
var r0 = getInt32Memory0()[retptr / 4 + 0];
204204
var r1 = getInt32Memory0()[retptr / 4 + 1];
@@ -248,29 +248,29 @@ async function init(input) {
248248
}
249249
const imports = {};
250250
imports.wbg = {};
251+
imports.wbg.__wbindgen_json_serialize = function (arg0, arg1) {
252+
const obj = getObject(arg1);
253+
const ret = JSON.stringify(obj === undefined ? null : obj);
254+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
255+
const len0 = WASM_VECTOR_LEN;
256+
getInt32Memory0()[arg0 / 4 + 1] = len0;
257+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
258+
};
251259
imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
252260
takeObject(arg0);
253261
};
254262
imports.wbg.__wbindgen_json_parse = function (arg0, arg1) {
255-
var ret = JSON.parse(getStringFromWasm0(arg0, arg1));
263+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
256264
return addHeapObject(ret);
257265
};
258-
imports.wbg.__wbindgen_json_serialize = function (arg0, arg1) {
259-
const obj = getObject(arg1);
260-
var ret = JSON.stringify(obj === undefined ? null : obj);
261-
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
262-
var len0 = WASM_VECTOR_LEN;
263-
getInt32Memory0()[arg0 / 4 + 1] = len0;
264-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
265-
};
266266
imports.wbg.__wbg_new_693216e109162396 = function () {
267-
var ret = new Error();
267+
const ret = new Error();
268268
return addHeapObject(ret);
269269
};
270270
imports.wbg.__wbg_stack_0ddaca5d1abfb52f = function (arg0, arg1) {
271-
var ret = getObject(arg1).stack;
272-
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
273-
var len0 = WASM_VECTOR_LEN;
271+
const ret = getObject(arg1).stack;
272+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
273+
const len0 = WASM_VECTOR_LEN;
274274
getInt32Memory0()[arg0 / 4 + 1] = len0;
275275
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
276276
};
@@ -287,8 +287,8 @@ async function init(input) {
287287
wasm.__wbindgen_free(arg0, arg1);
288288
}
289289
};
290-
imports.wbg.__wbg_new_55259b13834a484c = function (arg0, arg1) {
291-
var ret = new Error(getStringFromWasm0(arg0, arg1));
290+
imports.wbg.__wbg_new_3047bf4b4f02b802 = function (arg0, arg1) {
291+
const ret = new Error(getStringFromWasm0(arg0, arg1));
292292
return addHeapObject(ret);
293293
};
294294
imports.wbg.__wbindgen_throw = function (arg0, arg1) {

compiler/dist/wasm.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)