@next/swc-wasm-web 15.6.0-canary.9 → 16.0.0-beta.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,12 +1,13 @@
1
1
  {
2
2
  "name": "@next/swc-wasm-web",
3
- "version": "15.6.0-canary.9",
3
+ "type": "module",
4
+ "version": "16.0.0-beta.0",
4
5
  "files": [
5
6
  "wasm_bg.wasm",
6
7
  "wasm.js",
7
8
  "wasm.d.ts"
8
9
  ],
9
- "module": "wasm.js",
10
+ "main": "wasm.js",
10
11
  "types": "wasm.d.ts",
11
12
  "sideEffects": [
12
13
  "./snippets/*"
package/wasm.d.ts CHANGED
@@ -1,28 +1,28 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function mdxCompileSync(value: string, opts: any): any;
4
- export function mdxCompile(value: string, opts: any): Promise<any>;
3
+ export function parse(s: string, opts: any): Promise<any>;
4
+ export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
5
+ export function transform(s: any, opts: any): Promise<any>;
6
+ export function transformSync(s: any, opts: any): any;
5
7
  export function minifySync(s: string, opts: any): any;
6
8
  export function minify(s: string, opts: any): Promise<any>;
7
- export function transformSync(s: any, opts: any): any;
8
- export function transform(s: any, opts: any): Promise<any>;
9
9
  export function parseSync(s: string, opts: any): any;
10
- export function parse(s: string, opts: any): Promise<any>;
11
- export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
10
+ export function mdxCompileSync(value: string, opts: any): any;
11
+ export function mdxCompile(value: string, opts: any): Promise<any>;
12
12
 
13
13
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
14
14
 
15
15
  export interface InitOutput {
16
16
  readonly memory: WebAssembly.Memory;
17
- readonly mdxCompileSync: (a: any, b: any) => [number, number, number];
17
+ readonly expandNextJsTemplate: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any, i: any) => [number, number, number, number];
18
18
  readonly mdxCompile: (a: any, b: any) => any;
19
- readonly minifySync: (a: any, b: any) => [number, number, number];
19
+ readonly mdxCompileSync: (a: any, b: any) => [number, number, number];
20
20
  readonly minify: (a: any, b: any) => any;
21
- readonly transformSync: (a: any, b: any) => [number, number, number];
22
- readonly transform: (a: any, b: any) => any;
23
- readonly parseSync: (a: any, b: any) => [number, number, number];
21
+ readonly minifySync: (a: any, b: any) => [number, number, number];
24
22
  readonly parse: (a: any, b: any) => any;
25
- readonly expandNextJsTemplate: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any, i: any) => [number, number, number, number];
23
+ readonly parseSync: (a: any, b: any) => [number, number, number];
24
+ readonly transform: (a: any, b: any) => any;
25
+ readonly transformSync: (a: any, b: any) => [number, number, number];
26
26
  readonly __wbindgen_malloc: (a: number, b: number) => number;
27
27
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
28
28
  readonly __wbindgen_exn_store: (a: number) => void;
@@ -31,8 +31,8 @@ export interface InitOutput {
31
31
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
32
32
  readonly __wbindgen_export_6: WebAssembly.Table;
33
33
  readonly __externref_table_dealloc: (a: number) => void;
34
- readonly closure1132_externref_shim: (a: number, b: number, c: any) => void;
35
- readonly closure123_externref_shim: (a: number, b: number, c: any, d: any) => void;
34
+ readonly closure1154_externref_shim: (a: number, b: number, c: any) => void;
35
+ readonly closure122_externref_shim: (a: number, b: number, c: any, d: any) => void;
36
36
  readonly __wbindgen_start: () => void;
37
37
  }
38
38
 
package/wasm.js CHANGED
@@ -212,6 +212,22 @@ function debugString(val) {
212
212
  // TODO we could test for more things here, like `Set`s and `Map`s.
213
213
  return className;
214
214
  }
215
+ /**
216
+ * @param {string} s
217
+ * @param {any} opts
218
+ * @returns {Promise<any>}
219
+ */
220
+ export function parse(s, opts) {
221
+ const ret = wasm.parse(s, opts);
222
+ return ret;
223
+ }
224
+
225
+ function passArray8ToWasm0(arg, malloc) {
226
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
227
+ getUint8ArrayMemory0().set(arg, ptr / 1);
228
+ WASM_VECTOR_LEN = arg.length;
229
+ return ptr;
230
+ }
215
231
 
216
232
  function takeFromExternrefTable0(idx) {
217
233
  const value = wasm.__wbindgen_export_4.get(idx);
@@ -219,35 +235,47 @@ function takeFromExternrefTable0(idx) {
219
235
  return value;
220
236
  }
221
237
  /**
222
- * @param {string} value
223
- * @param {any} opts
224
- * @returns {any}
238
+ * @param {Uint8Array} content
239
+ * @param {string} template_path
240
+ * @param {string} next_package_dir_path
241
+ * @param {any} replacements
242
+ * @param {any} injections
243
+ * @param {any} imports
244
+ * @returns {string}
225
245
  */
226
- export function mdxCompileSync(value, opts) {
227
- const ret = wasm.mdxCompileSync(value, opts);
228
- if (ret[2]) {
229
- throw takeFromExternrefTable0(ret[1]);
246
+ export function expandNextJsTemplate(content, template_path, next_package_dir_path, replacements, injections, imports) {
247
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
248
+ const len0 = WASM_VECTOR_LEN;
249
+ const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
250
+ const len1 = WASM_VECTOR_LEN;
251
+ const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
252
+ const len2 = WASM_VECTOR_LEN;
253
+ const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
254
+ if (ret[3]) {
255
+ throw takeFromExternrefTable0(ret[2]);
230
256
  }
231
- return takeFromExternrefTable0(ret[0]);
257
+ var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
258
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
259
+ return v4;
232
260
  }
233
261
 
234
262
  /**
235
- * @param {string} value
263
+ * @param {any} s
236
264
  * @param {any} opts
237
265
  * @returns {Promise<any>}
238
266
  */
239
- export function mdxCompile(value, opts) {
240
- const ret = wasm.mdxCompile(value, opts);
267
+ export function transform(s, opts) {
268
+ const ret = wasm.transform(s, opts);
241
269
  return ret;
242
270
  }
243
271
 
244
272
  /**
245
- * @param {string} s
273
+ * @param {any} s
246
274
  * @param {any} opts
247
275
  * @returns {any}
248
276
  */
249
- export function minifySync(s, opts) {
250
- const ret = wasm.minifySync(s, opts);
277
+ export function transformSync(s, opts) {
278
+ const ret = wasm.transformSync(s, opts);
251
279
  if (ret[2]) {
252
280
  throw takeFromExternrefTable0(ret[1]);
253
281
  }
@@ -257,20 +285,10 @@ export function minifySync(s, opts) {
257
285
  /**
258
286
  * @param {string} s
259
287
  * @param {any} opts
260
- * @returns {Promise<any>}
261
- */
262
- export function minify(s, opts) {
263
- const ret = wasm.minify(s, opts);
264
- return ret;
265
- }
266
-
267
- /**
268
- * @param {any} s
269
- * @param {any} opts
270
288
  * @returns {any}
271
289
  */
272
- export function transformSync(s, opts) {
273
- const ret = wasm.transformSync(s, opts);
290
+ export function minifySync(s, opts) {
291
+ const ret = wasm.minifySync(s, opts);
274
292
  if (ret[2]) {
275
293
  throw takeFromExternrefTable0(ret[1]);
276
294
  }
@@ -278,12 +296,12 @@ export function transformSync(s, opts) {
278
296
  }
279
297
 
280
298
  /**
281
- * @param {any} s
299
+ * @param {string} s
282
300
  * @param {any} opts
283
301
  * @returns {Promise<any>}
284
302
  */
285
- export function transform(s, opts) {
286
- const ret = wasm.transform(s, opts);
303
+ export function minify(s, opts) {
304
+ const ret = wasm.minify(s, opts);
287
305
  return ret;
288
306
  }
289
307
 
@@ -301,52 +319,34 @@ export function parseSync(s, opts) {
301
319
  }
302
320
 
303
321
  /**
304
- * @param {string} s
322
+ * @param {string} value
305
323
  * @param {any} opts
306
- * @returns {Promise<any>}
324
+ * @returns {any}
307
325
  */
308
- export function parse(s, opts) {
309
- const ret = wasm.parse(s, opts);
310
- return ret;
326
+ export function mdxCompileSync(value, opts) {
327
+ const ret = wasm.mdxCompileSync(value, opts);
328
+ if (ret[2]) {
329
+ throw takeFromExternrefTable0(ret[1]);
330
+ }
331
+ return takeFromExternrefTable0(ret[0]);
311
332
  }
312
333
 
313
- function passArray8ToWasm0(arg, malloc) {
314
- const ptr = malloc(arg.length * 1, 1) >>> 0;
315
- getUint8ArrayMemory0().set(arg, ptr / 1);
316
- WASM_VECTOR_LEN = arg.length;
317
- return ptr;
318
- }
319
334
  /**
320
- * @param {Uint8Array} content
321
- * @param {string} template_path
322
- * @param {string} next_package_dir_path
323
- * @param {any} replacements
324
- * @param {any} injections
325
- * @param {any} imports
326
- * @returns {string}
335
+ * @param {string} value
336
+ * @param {any} opts
337
+ * @returns {Promise<any>}
327
338
  */
328
- export function expandNextJsTemplate(content, template_path, next_package_dir_path, replacements, injections, imports) {
329
- const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
330
- const len0 = WASM_VECTOR_LEN;
331
- const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
332
- const len1 = WASM_VECTOR_LEN;
333
- const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
334
- const len2 = WASM_VECTOR_LEN;
335
- const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
336
- if (ret[3]) {
337
- throw takeFromExternrefTable0(ret[2]);
338
- }
339
- var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
340
- if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
341
- return v4;
339
+ export function mdxCompile(value, opts) {
340
+ const ret = wasm.mdxCompile(value, opts);
341
+ return ret;
342
342
  }
343
343
 
344
344
  function __wbg_adapter_50(arg0, arg1, arg2) {
345
- wasm.closure1132_externref_shim(arg0, arg1, arg2);
345
+ wasm.closure1154_externref_shim(arg0, arg1, arg2);
346
346
  }
347
347
 
348
- function __wbg_adapter_101(arg0, arg1, arg2, arg3) {
349
- wasm.closure123_externref_shim(arg0, arg1, arg2, arg3);
348
+ function __wbg_adapter_81(arg0, arg1, arg2, arg3) {
349
+ wasm.closure122_externref_shim(arg0, arg1, arg2, arg3);
350
350
  }
351
351
 
352
352
  async function __wbg_load(module, imports) {
@@ -489,7 +489,7 @@ function __wbg_get_imports() {
489
489
  const a = state0.a;
490
490
  state0.a = 0;
491
491
  try {
492
- return __wbg_adapter_101(a, state0.b, arg0, arg1);
492
+ return __wbg_adapter_81(a, state0.b, arg0, arg1);
493
493
  } finally {
494
494
  state0.a = a;
495
495
  }
@@ -612,8 +612,8 @@ function __wbg_get_imports() {
612
612
  const ret = false;
613
613
  return ret;
614
614
  };
615
- imports.wbg.__wbindgen_closure_wrapper23807 = function(arg0, arg1, arg2) {
616
- const ret = makeMutClosure(arg0, arg1, 1133, __wbg_adapter_50);
615
+ imports.wbg.__wbindgen_closure_wrapper24026 = function(arg0, arg1, arg2) {
616
+ const ret = makeMutClosure(arg0, arg1, 1155, __wbg_adapter_50);
617
617
  return ret;
618
618
  };
619
619
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
package/wasm_bg.wasm CHANGED
Binary file