oxc-parser 0.57.0 → 0.58.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/README.md CHANGED
@@ -4,12 +4,15 @@
4
4
 
5
5
  ### ESTree
6
6
 
7
- The returned JavaScript AST follows the [ESTree](https://github.com/estree/estree) specification.
7
+ When parsing `.js` or `.jsx` files, the AST returned is fully conformant with the
8
+ [ESTree standard](https://github.com/estree/estree).
8
9
 
9
10
  It is fully aligned with Acorn's AST, and any deviation would be considered a bug.
10
11
 
11
12
  The returned TypeScript AST will conform to [@typescript-eslint/typescript-estree](https://www.npmjs.com/package/@typescript-eslint/typescript-estree) in the near future.
12
13
 
14
+ If you need all ASTs in the same with-TS-properties format, use the `astType: 'ts'` option.
15
+
13
16
  ### AST Types
14
17
 
15
18
  [@oxc-project/types](https://www.npmjs.com/package/@oxc-project/types) can be used. For example:
@@ -41,17 +44,6 @@ Fast mode is best suited for parser plugins, where other parts of your build pip
41
44
 
42
45
  Please note that turning off fast mode ​incurs​ a small performance overhead.
43
46
 
44
- ### ESTree compatibility
45
-
46
- When parsing JS or JSX files, the AST returned is fully conformant with the
47
- [ESTree standard](https://github.com/estree/estree).
48
-
49
- When parsing TS or TSX files, the AST has additional properties related to TypeScript syntax.
50
- These extra properties are broadly (but not entirely) in line with
51
- [TypeScript ESLint](https://typescript-eslint.io/packages/parser/)'s AST.
52
-
53
- If you need all ASTs in the same with-TS-properties format, use the `astType: 'ts'` option.
54
-
55
47
  ### Returns ESM information.
56
48
 
57
49
  It is likely that you are writing a parser plugin that requires ESM information.
package/deserialize-js.js CHANGED
@@ -894,13 +894,13 @@ function deserializeAccessorProperty(pos) {
894
894
  }
895
895
 
896
896
  function deserializeImportExpression(pos) {
897
- const args = deserializeVecExpression(pos + 24);
897
+ const options = deserializeVecExpression(pos + 24);
898
898
  return {
899
899
  type: 'ImportExpression',
900
900
  start: deserializeU32(pos),
901
901
  end: deserializeU32(pos + 4),
902
902
  source: deserializeExpression(pos + 8),
903
- options: args.length === 0 ? null : args[0],
903
+ options: options.length === 0 ? null : options[0],
904
904
  };
905
905
  }
906
906
 
@@ -1254,6 +1254,7 @@ function deserializeJSXText(pos) {
1254
1254
  start: deserializeU32(pos),
1255
1255
  end: deserializeU32(pos + 4),
1256
1256
  value: deserializeStr(pos + 8),
1257
+ raw: deserializeOptionStr(pos + 24),
1257
1258
  };
1258
1259
  }
1259
1260
 
package/deserialize-ts.js CHANGED
@@ -941,13 +941,13 @@ function deserializeAccessorProperty(pos) {
941
941
  }
942
942
 
943
943
  function deserializeImportExpression(pos) {
944
- const args = deserializeVecExpression(pos + 24);
944
+ const options = deserializeVecExpression(pos + 24);
945
945
  return {
946
946
  type: 'ImportExpression',
947
947
  start: deserializeU32(pos),
948
948
  end: deserializeU32(pos + 4),
949
949
  source: deserializeExpression(pos + 8),
950
- options: args.length === 0 ? null : args[0],
950
+ options: options.length === 0 ? null : options[0],
951
951
  };
952
952
  }
953
953
 
@@ -1307,6 +1307,7 @@ function deserializeJSXText(pos) {
1307
1307
  start: deserializeU32(pos),
1308
1308
  end: deserializeU32(pos + 4),
1309
1309
  value: deserializeStr(pos + 8),
1310
+ raw: deserializeOptionStr(pos + 24),
1310
1311
  };
1311
1312
  }
1312
1313
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxc-parser",
3
- "version": "0.57.0",
3
+ "version": "0.58.0",
4
4
  "main": "index.js",
5
5
  "browser": "browser.js",
6
6
  "engines": {
@@ -36,7 +36,7 @@
36
36
  "access": "public"
37
37
  },
38
38
  "dependencies": {
39
- "@oxc-project/types": "^0.57.0"
39
+ "@oxc-project/types": "^0.58.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@codspeed/vitest-plugin": "^4.0.0",
@@ -65,16 +65,16 @@
65
65
  "dtsHeaderFile": "header.js"
66
66
  },
67
67
  "optionalDependencies": {
68
- "@oxc-parser/binding-win32-x64-msvc": "0.57.0",
69
- "@oxc-parser/binding-win32-arm64-msvc": "0.57.0",
70
- "@oxc-parser/binding-linux-x64-gnu": "0.57.0",
71
- "@oxc-parser/binding-linux-x64-musl": "0.57.0",
72
- "@oxc-parser/binding-linux-arm64-gnu": "0.57.0",
73
- "@oxc-parser/binding-linux-arm64-musl": "0.57.0",
74
- "@oxc-parser/binding-linux-arm-gnueabihf": "0.57.0",
75
- "@oxc-parser/binding-darwin-x64": "0.57.0",
76
- "@oxc-parser/binding-darwin-arm64": "0.57.0",
77
- "@oxc-parser/binding-wasm32-wasi": "0.57.0"
68
+ "@oxc-parser/binding-win32-x64-msvc": "0.58.0",
69
+ "@oxc-parser/binding-win32-arm64-msvc": "0.58.0",
70
+ "@oxc-parser/binding-linux-x64-gnu": "0.58.0",
71
+ "@oxc-parser/binding-linux-x64-musl": "0.58.0",
72
+ "@oxc-parser/binding-linux-arm64-gnu": "0.58.0",
73
+ "@oxc-parser/binding-linux-arm64-musl": "0.58.0",
74
+ "@oxc-parser/binding-linux-arm-gnueabihf": "0.58.0",
75
+ "@oxc-parser/binding-darwin-x64": "0.58.0",
76
+ "@oxc-parser/binding-darwin-arm64": "0.58.0",
77
+ "@oxc-parser/binding-wasm32-wasi": "0.58.0"
78
78
  },
79
79
  "scripts": {
80
80
  "build-dev": "napi build --no-dts-cache --platform --js bindings.js",