Skip to content

Commit

Permalink
chore(es/module): Remove serde(deny_unknown_fields) (#8163)
Browse files Browse the repository at this point in the history
**Related issue:**

 - Closes #7979
  • Loading branch information
kdy1 committed Oct 20, 2023
1 parent 6f9c642 commit 5be8e74
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 73 deletions.
62 changes: 21 additions & 41 deletions crates/swc_ecma_parser/tests/tsc/thisTypeInAccessors.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,37 +277,27 @@
"param": {
"type": "Identifier",
"span": {
"start": 204,
"end": 213,
"start": 215,
"end": 224,
"ctxt": 0
},
"value": "this",
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 208,
"end": 213,
"start": 216,
"end": 224,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"type": "TsKeywordType",
"span": {
"start": 210,
"end": 213,
"start": 218,
"end": 224,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 210,
"end": 213,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": null
"kind": "number"
}
}
},
Expand Down Expand Up @@ -759,37 +749,27 @@
"param": {
"type": "Identifier",
"span": {
"start": 441,
"end": 450,
"start": 452,
"end": 461,
"ctxt": 0
},
"value": "this",
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 445,
"end": 450,
"start": 453,
"end": 461,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"type": "TsKeywordType",
"span": {
"start": 447,
"end": 450,
"start": 455,
"end": 461,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 447,
"end": 450,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"typeParams": null
"kind": "number"
}
}
},
Expand Down Expand Up @@ -1005,11 +985,11 @@
"param": {
"type": "Identifier",
"span": {
"start": 580,
"end": 584,
"start": 586,
"end": 587,
"ctxt": 0
},
"value": "this",
"value": "n",
"optional": false,
"typeAnnotation": null
},
Expand Down
34 changes: 4 additions & 30 deletions crates/swc_ecma_parser/tests/tsc/thisTypeInAccessorsNegative.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,39 +406,13 @@
"param": {
"type": "Identifier",
"span": {
"start": 267,
"end": 276,
"start": 278,
"end": 279,
"ctxt": 0
},
"value": "this",
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 271,
"end": 276,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 273,
"end": 276,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 273,
"end": 276,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"typeParams": null
}
}
"typeAnnotation": null
},
"body": {
"type": "BlockStatement",
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_transforms_module/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mod top_level_this;
pub mod umd;

#[derive(Debug, Default, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields, rename_all = "camelCase")]
#[serde(rename_all = "camelCase")]
pub struct EsModuleConfig {
#[serde(default)]
pub resolve_fully: bool,
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_transforms_module/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ where
base_dir.is_absolute(),
"base_dir(`{}`) must be absolute. Please ensure that `jsc.baseUrl` is specified \
correctly. This cannot be deduced by SWC itself because SWC is a transpiler and \
it does not try to resolve project details. In other works, SWC does not know \
it does not try to resolve project details. In other words, SWC does not know \
which directory should be used as a base directory. It can be deduced if \
`.swcrc` is used, but if not, there are many candidates. e.g. the directory \
containing `package.json`, or the current working directory. Because of that, \
Expand Down

1 comment on commit 5be8e74

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: 5be8e74 Previous: 826386f Ratio
es/full/bugs-1 301071 ns/iter (± 7755) 304830 ns/iter (± 9876) 0.99
es/full/minify/libraries/antd 1468245436 ns/iter (± 21604648) 1422749110 ns/iter (± 13502159) 1.03
es/full/minify/libraries/d3 303923743 ns/iter (± 3801573) 295447889 ns/iter (± 2794977) 1.03
es/full/minify/libraries/echarts 1173700181 ns/iter (± 4420853) 1134399671 ns/iter (± 15541838) 1.03
es/full/minify/libraries/jquery 90380970 ns/iter (± 741540) 89299486 ns/iter (± 686945) 1.01
es/full/minify/libraries/lodash 105500737 ns/iter (± 269343) 104599023 ns/iter (± 499309) 1.01
es/full/minify/libraries/moment 53164180 ns/iter (± 533175) 52616711 ns/iter (± 96213) 1.01
es/full/minify/libraries/react 18849864 ns/iter (± 184339) 18804483 ns/iter (± 200302) 1.00
es/full/minify/libraries/terser 238732481 ns/iter (± 2343517) 232064702 ns/iter (± 1627447) 1.03
es/full/minify/libraries/three 428418744 ns/iter (± 2078878) 414733523 ns/iter (± 3843485) 1.03
es/full/minify/libraries/typescript 2907768647 ns/iter (± 18218083) 2819538857 ns/iter (± 20644391) 1.03
es/full/minify/libraries/victory 630673364 ns/iter (± 4302854) 604692365 ns/iter (± 5542451) 1.04
es/full/minify/libraries/vue 129014044 ns/iter (± 503039) 127430047 ns/iter (± 1164986) 1.01
es/full/codegen/es3 34134 ns/iter (± 222) 35289 ns/iter (± 86) 0.97
es/full/codegen/es5 34142 ns/iter (± 44) 35449 ns/iter (± 88) 0.96
es/full/codegen/es2015 34107 ns/iter (± 58) 35439 ns/iter (± 102) 0.96
es/full/codegen/es2016 34153 ns/iter (± 132) 35363 ns/iter (± 103) 0.97
es/full/codegen/es2017 34150 ns/iter (± 63) 35524 ns/iter (± 110) 0.96
es/full/codegen/es2018 34024 ns/iter (± 77) 35612 ns/iter (± 62) 0.96
es/full/codegen/es2019 34145 ns/iter (± 69) 35551 ns/iter (± 126) 0.96
es/full/codegen/es2020 34096 ns/iter (± 382) 35492 ns/iter (± 160) 0.96
es/full/all/es3 177793575 ns/iter (± 1234314) 180314286 ns/iter (± 1143878) 0.99
es/full/all/es5 169517063 ns/iter (± 1912281) 173373204 ns/iter (± 499839) 0.98
es/full/all/es2015 128661556 ns/iter (± 1276337) 131181547 ns/iter (± 1381884) 0.98
es/full/all/es2016 127686252 ns/iter (± 722223) 130819586 ns/iter (± 658128) 0.98
es/full/all/es2017 126620489 ns/iter (± 882941) 130236190 ns/iter (± 1053828) 0.97
es/full/all/es2018 124645684 ns/iter (± 654824) 127736698 ns/iter (± 1048424) 0.98
es/full/all/es2019 124466833 ns/iter (± 885733) 126901081 ns/iter (± 998552) 0.98
es/full/all/es2020 120233455 ns/iter (± 1259198) 122753530 ns/iter (± 797503) 0.98
es/full/parser 554528 ns/iter (± 3708) 572072 ns/iter (± 3154) 0.97
es/full/base/fixer 18309 ns/iter (± 84) 17924 ns/iter (± 31) 1.02
es/full/base/resolver_and_hygiene 83184 ns/iter (± 173) 83810 ns/iter (± 148) 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.