@next/swc-wasm-web 15.3.1 → 15.4.0-canary.0

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/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@next/swc-wasm-web",
3
- "type": "module",
4
- "version": "15.3.1",
3
+ "version": "15.4.0-canary.0",
5
4
  "files": [
6
5
  "wasm_bg.wasm",
7
6
  "wasm.js",
8
7
  "wasm.d.ts"
9
8
  ],
10
- "main": "wasm.js",
9
+ "module": "wasm.js",
11
10
  "types": "wasm.d.ts",
12
11
  "sideEffects": [
13
12
  "./snippets/*"
package/wasm.d.ts CHANGED
@@ -1,6 +1,18 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
+ * @param {string} value
5
+ * @param {any} opts
6
+ * @returns {any}
7
+ */
8
+ export function mdxCompileSync(value: string, opts: any): any;
9
+ /**
10
+ * @param {string} value
11
+ * @param {any} opts
12
+ * @returns {Promise<any>}
13
+ */
14
+ export function mdxCompile(value: string, opts: any): Promise<any>;
15
+ /**
4
16
  * @param {string} s
5
17
  * @param {any} opts
6
18
  * @returns {any}
@@ -36,38 +48,26 @@ export function parseSync(s: string, opts: any): any;
36
48
  * @returns {Promise<any>}
37
49
  */
38
50
  export function parse(s: string, opts: any): Promise<any>;
39
- /**
40
- * @param {string} value
41
- * @param {any} opts
42
- * @returns {any}
43
- */
44
- export function mdxCompileSync(value: string, opts: any): any;
45
- /**
46
- * @param {string} value
47
- * @param {any} opts
48
- * @returns {Promise<any>}
49
- */
50
- export function mdxCompile(value: string, opts: any): Promise<any>;
51
51
 
52
52
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
53
53
 
54
54
  export interface InitOutput {
55
55
  readonly memory: WebAssembly.Memory;
56
+ readonly mdxCompileSync: (a: number, b: number, c: number) => void;
57
+ readonly mdxCompile: (a: number, b: number) => number;
56
58
  readonly minifySync: (a: number, b: number, c: number) => void;
57
59
  readonly minify: (a: number, b: number) => number;
58
60
  readonly transformSync: (a: number, b: number, c: number) => void;
59
61
  readonly transform: (a: number, b: number) => number;
60
62
  readonly parseSync: (a: number, b: number, c: number) => void;
61
63
  readonly parse: (a: number, b: number) => number;
62
- readonly mdxCompileSync: (a: number, b: number, c: number) => void;
63
- readonly mdxCompile: (a: number, b: number) => number;
64
64
  readonly __wbindgen_malloc: (a: number, b: number) => number;
65
65
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
66
66
  readonly __wbindgen_export_2: WebAssembly.Table;
67
- readonly _dyn_core_1179c76b4fb746ac___ops__function__FnMut_______Output______as_wasm_bindgen_89e0906eab2faa98___closure__WasmClosure___describe__invoke___wasm_bindgen_89e0906eab2faa98___JsValue_____: (a: number, b: number, c: number) => void;
67
+ readonly _dyn_core_d740453d92c4907d___ops__function__FnMut_______Output______as_wasm_bindgen_b3e6b9209ca1af04___closure__WasmClosure___describe__invoke___wasm_bindgen_b3e6b9209ca1af04___JsValue_____: (a: number, b: number, c: number) => void;
68
68
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
69
69
  readonly __wbindgen_exn_store: (a: number) => void;
70
- readonly wasm_bindgen_89e0906eab2faa98___convert__closures__invoke2_mut___wasm_bindgen_89e0906eab2faa98___JsValue__wasm_bindgen_89e0906eab2faa98___JsValue_____: (a: number, b: number, c: number, d: number) => void;
70
+ readonly wasm_bindgen_b3e6b9209ca1af04___convert__closures__invoke2_mut___wasm_bindgen_b3e6b9209ca1af04___JsValue__wasm_bindgen_b3e6b9209ca1af04___JsValue_____: (a: number, b: number, c: number, d: number) => void;
71
71
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
72
72
  }
73
73
 
package/wasm.js CHANGED
@@ -47,6 +47,28 @@ function getStringFromWasm0(ptr, len) {
47
47
  return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
48
48
  }
49
49
 
50
+ function isLikeNone(x) {
51
+ return x === undefined || x === null;
52
+ }
53
+
54
+ let cachedFloat64Memory0 = null;
55
+
56
+ function getFloat64Memory0() {
57
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
58
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
59
+ }
60
+ return cachedFloat64Memory0;
61
+ }
62
+
63
+ let cachedInt32Memory0 = null;
64
+
65
+ function getInt32Memory0() {
66
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
67
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
68
+ }
69
+ return cachedInt32Memory0;
70
+ }
71
+
50
72
  let WASM_VECTOR_LEN = 0;
51
73
 
52
74
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
@@ -103,28 +125,6 @@ function passStringToWasm0(arg, malloc, realloc) {
103
125
  return ptr;
104
126
  }
105
127
 
106
- function isLikeNone(x) {
107
- return x === undefined || x === null;
108
- }
109
-
110
- let cachedInt32Memory0 = null;
111
-
112
- function getInt32Memory0() {
113
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
114
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
115
- }
116
- return cachedInt32Memory0;
117
- }
118
-
119
- let cachedFloat64Memory0 = null;
120
-
121
- function getFloat64Memory0() {
122
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
123
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
124
- }
125
- return cachedFloat64Memory0;
126
- }
127
-
128
128
  let cachedBigInt64Memory0 = null;
129
129
 
130
130
  function getBigInt64Memory0() {
@@ -230,7 +230,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
230
230
  return real;
231
231
  }
232
232
  function __wbg_adapter_48(arg0, arg1, arg2) {
233
- wasm._dyn_core_1179c76b4fb746ac___ops__function__FnMut_______Output______as_wasm_bindgen_89e0906eab2faa98___closure__WasmClosure___describe__invoke___wasm_bindgen_89e0906eab2faa98___JsValue_____(arg0, arg1, addHeapObject(arg2));
233
+ wasm._dyn_core_d740453d92c4907d___ops__function__FnMut_______Output______as_wasm_bindgen_b3e6b9209ca1af04___closure__WasmClosure___describe__invoke___wasm_bindgen_b3e6b9209ca1af04___JsValue_____(arg0, arg1, addHeapObject(arg2));
234
234
  }
235
235
 
236
236
  function getCachedStringFromWasm0(ptr, len) {
@@ -249,18 +249,18 @@ function handleError(f, args) {
249
249
  }
250
250
  }
251
251
  function __wbg_adapter_113(arg0, arg1, arg2, arg3) {
252
- wasm.wasm_bindgen_89e0906eab2faa98___convert__closures__invoke2_mut___wasm_bindgen_89e0906eab2faa98___JsValue__wasm_bindgen_89e0906eab2faa98___JsValue_____(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
252
+ wasm.wasm_bindgen_b3e6b9209ca1af04___convert__closures__invoke2_mut___wasm_bindgen_b3e6b9209ca1af04___JsValue__wasm_bindgen_b3e6b9209ca1af04___JsValue_____(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
253
253
  }
254
254
 
255
255
  /**
256
- * @param {string} s
256
+ * @param {string} value
257
257
  * @param {any} opts
258
258
  * @returns {any}
259
259
  */
260
- export function minifySync(s, opts) {
260
+ export function mdxCompileSync(value, opts) {
261
261
  try {
262
262
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
263
- wasm.minifySync(retptr, addHeapObject(s), addHeapObject(opts));
263
+ wasm.mdxCompileSync(retptr, addHeapObject(value), addHeapObject(opts));
264
264
  var r0 = getInt32Memory0()[retptr / 4 + 0];
265
265
  var r1 = getInt32Memory0()[retptr / 4 + 1];
266
266
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -274,24 +274,24 @@ export function minifySync(s, opts) {
274
274
  }
275
275
 
276
276
  /**
277
- * @param {string} s
277
+ * @param {string} value
278
278
  * @param {any} opts
279
279
  * @returns {Promise<any>}
280
280
  */
281
- export function minify(s, opts) {
282
- const ret = wasm.minify(addHeapObject(s), addHeapObject(opts));
281
+ export function mdxCompile(value, opts) {
282
+ const ret = wasm.mdxCompile(addHeapObject(value), addHeapObject(opts));
283
283
  return takeObject(ret);
284
284
  }
285
285
 
286
286
  /**
287
- * @param {any} s
287
+ * @param {string} s
288
288
  * @param {any} opts
289
289
  * @returns {any}
290
290
  */
291
- export function transformSync(s, opts) {
291
+ export function minifySync(s, opts) {
292
292
  try {
293
293
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
294
- wasm.transformSync(retptr, addHeapObject(s), addHeapObject(opts));
294
+ wasm.minifySync(retptr, addHeapObject(s), addHeapObject(opts));
295
295
  var r0 = getInt32Memory0()[retptr / 4 + 0];
296
296
  var r1 = getInt32Memory0()[retptr / 4 + 1];
297
297
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -305,24 +305,24 @@ export function transformSync(s, opts) {
305
305
  }
306
306
 
307
307
  /**
308
- * @param {any} s
308
+ * @param {string} s
309
309
  * @param {any} opts
310
310
  * @returns {Promise<any>}
311
311
  */
312
- export function transform(s, opts) {
313
- const ret = wasm.transform(addHeapObject(s), addHeapObject(opts));
312
+ export function minify(s, opts) {
313
+ const ret = wasm.minify(addHeapObject(s), addHeapObject(opts));
314
314
  return takeObject(ret);
315
315
  }
316
316
 
317
317
  /**
318
- * @param {string} s
318
+ * @param {any} s
319
319
  * @param {any} opts
320
320
  * @returns {any}
321
321
  */
322
- export function parseSync(s, opts) {
322
+ export function transformSync(s, opts) {
323
323
  try {
324
324
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
325
- wasm.parseSync(retptr, addHeapObject(s), addHeapObject(opts));
325
+ wasm.transformSync(retptr, addHeapObject(s), addHeapObject(opts));
326
326
  var r0 = getInt32Memory0()[retptr / 4 + 0];
327
327
  var r1 = getInt32Memory0()[retptr / 4 + 1];
328
328
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -336,24 +336,24 @@ export function parseSync(s, opts) {
336
336
  }
337
337
 
338
338
  /**
339
- * @param {string} s
339
+ * @param {any} s
340
340
  * @param {any} opts
341
341
  * @returns {Promise<any>}
342
342
  */
343
- export function parse(s, opts) {
344
- const ret = wasm.parse(addHeapObject(s), addHeapObject(opts));
343
+ export function transform(s, opts) {
344
+ const ret = wasm.transform(addHeapObject(s), addHeapObject(opts));
345
345
  return takeObject(ret);
346
346
  }
347
347
 
348
348
  /**
349
- * @param {string} value
349
+ * @param {string} s
350
350
  * @param {any} opts
351
351
  * @returns {any}
352
352
  */
353
- export function mdxCompileSync(value, opts) {
353
+ export function parseSync(s, opts) {
354
354
  try {
355
355
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
356
- wasm.mdxCompileSync(retptr, addHeapObject(value), addHeapObject(opts));
356
+ wasm.parseSync(retptr, addHeapObject(s), addHeapObject(opts));
357
357
  var r0 = getInt32Memory0()[retptr / 4 + 0];
358
358
  var r1 = getInt32Memory0()[retptr / 4 + 1];
359
359
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -367,12 +367,12 @@ export function mdxCompileSync(value, opts) {
367
367
  }
368
368
 
369
369
  /**
370
- * @param {string} value
370
+ * @param {string} s
371
371
  * @param {any} opts
372
372
  * @returns {Promise<any>}
373
373
  */
374
- export function mdxCompile(value, opts) {
375
- const ret = wasm.mdxCompile(addHeapObject(value), addHeapObject(opts));
374
+ export function parse(s, opts) {
375
+ const ret = wasm.parse(addHeapObject(s), addHeapObject(opts));
376
376
  return takeObject(ret);
377
377
  }
378
378
 
@@ -413,10 +413,6 @@ function __wbg_get_imports() {
413
413
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
414
414
  takeObject(arg0);
415
415
  };
416
- imports.wbg.__wbg_new0_7a6141101f2206da = function() {
417
- const ret = new Date();
418
- return addHeapObject(ret);
419
- };
420
416
  imports.wbg.__wbindgen_number_new = function(arg0) {
421
417
  const ret = arg0;
422
418
  return addHeapObject(ret);
@@ -458,6 +454,10 @@ function __wbg_get_imports() {
458
454
  imports.wbg.__wbg_set_7d988c98e6ced92d = function(arg0, arg1, arg2) {
459
455
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
460
456
  };
457
+ imports.wbg.__wbg_new0_7a6141101f2206da = function() {
458
+ const ret = new Date();
459
+ return addHeapObject(ret);
460
+ };
461
461
  imports.wbg.__wbg_getTime_0e03c3f524be31ef = function(arg0) {
462
462
  const ret = getObject(arg0).getTime();
463
463
  return ret;
@@ -576,14 +576,6 @@ imports.wbg.__wbg_newnoargs_cfecb3965268594c = function(arg0, arg1) {
576
576
  const ret = new Function(v0);
577
577
  return addHeapObject(ret);
578
578
  };
579
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
580
- const obj = getObject(arg1);
581
- const ret = typeof(obj) === 'string' ? obj : undefined;
582
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
583
- var len1 = WASM_VECTOR_LEN;
584
- getInt32Memory0()[arg0 / 4 + 1] = len1;
585
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
586
- };
587
579
  imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
588
580
  const ret = new Error(getStringFromWasm0(arg0, arg1));
589
581
  return addHeapObject(ret);
@@ -603,6 +595,14 @@ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
603
595
  getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
604
596
  getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
605
597
  };
598
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
599
+ const obj = getObject(arg1);
600
+ const ret = typeof(obj) === 'string' ? obj : undefined;
601
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
602
+ var len1 = WASM_VECTOR_LEN;
603
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
604
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
605
+ };
606
606
  imports.wbg.__wbg_instanceof_Uint8Array_c299a4ee232e76ba = function(arg0) {
607
607
  let result;
608
608
  try {
@@ -751,8 +751,8 @@ imports.wbg.__wbindgen_cb_drop = function(arg0) {
751
751
  const ret = false;
752
752
  return ret;
753
753
  };
754
- imports.wbg.__wbindgen_closure_wrapper25104 = function(arg0, arg1, arg2) {
755
- const ret = makeMutClosure(arg0, arg1, 1277, __wbg_adapter_48);
754
+ imports.wbg.__wbindgen_closure_wrapper24128 = function(arg0, arg1, arg2) {
755
+ const ret = makeMutClosure(arg0, arg1, 1088, __wbg_adapter_48);
756
756
  return addHeapObject(ret);
757
757
  };
758
758
 
package/wasm_bg.wasm CHANGED
Binary file