@astrojs/compiler 0.10.2 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @astrojs/compiler
2
2
 
3
+ ## 0.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 4039682: Fixes hoist script tracking when passed a variable
8
+
9
+ ## 0.11.0
10
+
11
+ ### Minor Changes
12
+
13
+ - f5d4006: Switch from TinyGo to Go's built-in WASM output. While this is an unfortunate size increase for our `.wasm` file, it should also be significantly more stable and cut down on hard-to-reproduce bugs.
14
+
15
+ Please see https://github.com/withastro/compiler/pull/291 for more details.
16
+
17
+ ## 0.11.0-next--wasm.0
18
+
19
+ ### Minor Changes
20
+
21
+ - 9212ccc: Switch from TinyGo to Go's built-in WASM output. While this is an unfortunate size increase for our `WASM` file, it should also be significantly more stable and cut down on hard-to-reproduce bugs.
22
+
23
+ Please see https://github.com/withastro/compiler/pull/291 for more details.
24
+
3
25
  ## 0.10.2
4
26
 
5
27
  ### Patch Changes
package/astro.wasm CHANGED
Binary file
package/browser/index.js CHANGED
@@ -43,13 +43,7 @@ const startRunningService = async (wasmURL) => {
43
43
  const go = new Go();
44
44
  const wasm = await instantiateWASM(wasmURL, go.importObject);
45
45
  go.run(wasm.instance);
46
- const apiKeys = new Set(['transform']);
47
- const service = Object.create(null);
48
- for (const key of apiKeys.values()) {
49
- const globalKey = `__astro_${key}`;
50
- service[key] = globalThis[globalKey];
51
- delete globalThis[globalKey];
52
- }
46
+ const service = globalThis['@astrojs/compiler'];
53
47
  longLivedService = {
54
48
  transform: (input, options) => new Promise((resolve) => resolve(service.transform(input, options || {}))),
55
49
  };
@@ -1,5 +1,33 @@
1
1
  export default class Go {
2
- importObject: Record<string, any>;
2
+ importObject: {
3
+ go: {
4
+ 'runtime.wasmExit': (sp: any) => void;
5
+ 'runtime.wasmWrite': (sp: any) => void;
6
+ 'runtime.resetMemoryDataView': (sp: any) => void;
7
+ 'runtime.nanotime1': (sp: any) => void;
8
+ 'runtime.walltime': (sp: any) => void;
9
+ 'runtime.scheduleTimeoutEvent': (sp: any) => void;
10
+ 'runtime.clearTimeoutEvent': (sp: any) => void;
11
+ 'runtime.getRandomData': (sp: any) => void;
12
+ 'syscall/js.finalizeRef': (sp: any) => void;
13
+ 'syscall/js.stringVal': (sp: any) => void;
14
+ 'syscall/js.valueGet': (sp: any) => void;
15
+ 'syscall/js.valueSet': (sp: any) => void;
16
+ 'syscall/js.valueDelete': (sp: any) => void;
17
+ 'syscall/js.valueIndex': (sp: any) => void;
18
+ 'syscall/js.valueSetIndex': (sp: any) => void;
19
+ 'syscall/js.valueCall': (sp: any) => void;
20
+ 'syscall/js.valueInvoke': (sp: any) => void;
21
+ 'syscall/js.valueNew': (sp: any) => void;
22
+ 'syscall/js.valueLength': (sp: any) => void;
23
+ 'syscall/js.valuePrepareString': (sp: any) => void;
24
+ 'syscall/js.valueLoadString': (sp: any) => void;
25
+ 'syscall/js.valueInstanceOf': (sp: any) => void;
26
+ 'syscall/js.copyBytesToGo': (sp: any) => void;
27
+ 'syscall/js.copyBytesToJS': (sp: any) => void;
28
+ debug: (value: any) => void;
29
+ };
30
+ };
3
31
  constructor();
4
32
  run(instance: any): Promise<void>;
5
33
  private _resume;