@next/swc-wasm-web 14.1.2-canary.5 → 14.1.2-canary.7

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/swc-wasm-web",
3
- "version": "14.1.2-canary.5",
3
+ "version": "14.1.2-canary.7",
4
4
  "files": [
5
5
  "wasm_bg.wasm",
6
6
  "wasm.js",
package/wasm.d.ts CHANGED
@@ -37,21 +37,17 @@ export function transformSync(s: any, opts: any): any;
37
37
  */
38
38
  export function transform(s: any, opts: any): Promise<any>;
39
39
  /**
40
- * Detect if metadata routes is a dynamic route, which containing
41
- * generateImageMetadata or generateSitemaps as export
42
- * Unlike native bindings, caller should provide the contents of the pages
43
- * sine our wasm bindings does not have access to the file system
44
- * @param {string} page_file_path
45
- * @param {string} page_contents
46
- * @returns {Promise<any>}
40
+ * @param {string} s
41
+ * @param {any} opts
42
+ * @returns {any}
47
43
  */
48
- export function isDynamicMetadataRoute(page_file_path: string, page_contents: string): Promise<any>;
44
+ export function parseSync(s: string, opts: any): any;
49
45
  /**
50
- * @param {string} page_file_path
51
- * @param {string} page_contents
46
+ * @param {string} s
47
+ * @param {any} opts
52
48
  * @returns {Promise<any>}
53
49
  */
54
- export function getPageStaticInfo(page_file_path: string, page_contents: string): Promise<any>;
50
+ export function parse(s: string, opts: any): Promise<any>;
55
51
 
56
52
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
57
53
 
@@ -63,8 +59,8 @@ export interface InitOutput {
63
59
  readonly minify: (a: number, b: number) => number;
64
60
  readonly transformSync: (a: number, b: number, c: number) => void;
65
61
  readonly transform: (a: number, b: number) => number;
66
- readonly isDynamicMetadataRoute: (a: number, b: number, c: number, d: number) => number;
67
- readonly getPageStaticInfo: (a: number, b: number, c: number, d: number) => number;
62
+ readonly parseSync: (a: number, b: number, c: number) => void;
63
+ readonly parse: (a: number, b: number) => number;
68
64
  readonly __wbindgen_malloc: (a: number, b: number) => number;
69
65
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
70
66
  readonly __wbindgen_export_2: WebAssembly.Table;
package/wasm.js CHANGED
@@ -346,34 +346,33 @@ export function transform(s, opts) {
346
346
  }
347
347
 
348
348
  /**
349
- * Detect if metadata routes is a dynamic route, which containing
350
- * generateImageMetadata or generateSitemaps as export
351
- * Unlike native bindings, caller should provide the contents of the pages
352
- * sine our wasm bindings does not have access to the file system
353
- * @param {string} page_file_path
354
- * @param {string} page_contents
355
- * @returns {Promise<any>}
349
+ * @param {string} s
350
+ * @param {any} opts
351
+ * @returns {any}
356
352
  */
357
- export function isDynamicMetadataRoute(page_file_path, page_contents) {
358
- const ptr0 = passStringToWasm0(page_file_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
359
- const len0 = WASM_VECTOR_LEN;
360
- const ptr1 = passStringToWasm0(page_contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
361
- const len1 = WASM_VECTOR_LEN;
362
- const ret = wasm.isDynamicMetadataRoute(ptr0, len0, ptr1, len1);
363
- return takeObject(ret);
353
+ export function parseSync(s, opts) {
354
+ try {
355
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
356
+ wasm.parseSync(retptr, addHeapObject(s), addHeapObject(opts));
357
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
358
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
359
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
360
+ if (r2) {
361
+ throw takeObject(r1);
362
+ }
363
+ return takeObject(r0);
364
+ } finally {
365
+ wasm.__wbindgen_add_to_stack_pointer(16);
366
+ }
364
367
  }
365
368
 
366
369
  /**
367
- * @param {string} page_file_path
368
- * @param {string} page_contents
370
+ * @param {string} s
371
+ * @param {any} opts
369
372
  * @returns {Promise<any>}
370
373
  */
371
- export function getPageStaticInfo(page_file_path, page_contents) {
372
- const ptr0 = passStringToWasm0(page_file_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
373
- const len0 = WASM_VECTOR_LEN;
374
- const ptr1 = passStringToWasm0(page_contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
375
- const len1 = WASM_VECTOR_LEN;
376
- const ret = wasm.getPageStaticInfo(ptr0, len0, ptr1, len1);
374
+ export function parse(s, opts) {
375
+ const ret = wasm.parse(addHeapObject(s), addHeapObject(opts));
377
376
  return takeObject(ret);
378
377
  }
379
378
 
@@ -686,6 +685,20 @@ imports.wbg.__wbg_getwithrefkey_15c62c2b8546208d = function(arg0, arg1) {
686
685
  const ret = getObject(arg0)[getObject(arg1)];
687
686
  return addHeapObject(ret);
688
687
  };
688
+ imports.wbg.__wbg_new_632630b5cec17f21 = function() {
689
+ const ret = new Object();
690
+ return addHeapObject(ret);
691
+ };
692
+ imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
693
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
694
+ };
695
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
696
+ const ret = debugString(getObject(arg1));
697
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
698
+ const len1 = WASM_VECTOR_LEN;
699
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
700
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
701
+ };
689
702
  imports.wbg.__wbg_new_70828a4353259d4b = function(arg0, arg1) {
690
703
  try {
691
704
  var state0 = {a: arg0, b: arg1};
@@ -704,20 +717,6 @@ imports.wbg.__wbg_new_70828a4353259d4b = function(arg0, arg1) {
704
717
  state0.a = state0.b = 0;
705
718
  }
706
719
  };
707
- imports.wbg.__wbg_new_632630b5cec17f21 = function() {
708
- const ret = new Object();
709
- return addHeapObject(ret);
710
- };
711
- imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
712
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
713
- };
714
- imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
715
- const ret = debugString(getObject(arg1));
716
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
717
- const len1 = WASM_VECTOR_LEN;
718
- getInt32Memory0()[arg0 / 4 + 1] = len1;
719
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
720
- };
721
720
  imports.wbg.__wbindgen_throw = function(arg0, arg1) {
722
721
  throw new Error(getStringFromWasm0(arg0, arg1));
723
722
  };
@@ -745,8 +744,8 @@ imports.wbg.__wbindgen_cb_drop = function(arg0) {
745
744
  const ret = false;
746
745
  return ret;
747
746
  };
748
- imports.wbg.__wbindgen_closure_wrapper26368 = function(arg0, arg1, arg2) {
749
- const ret = makeMutClosure(arg0, arg1, 432, __wbg_adapter_48);
747
+ imports.wbg.__wbindgen_closure_wrapper26372 = function(arg0, arg1, arg2) {
748
+ const ret = makeMutClosure(arg0, arg1, 431, __wbg_adapter_48);
750
749
  return addHeapObject(ret);
751
750
  };
752
751
 
package/wasm_bg.wasm CHANGED
Binary file