Skip to content

Commit

Permalink
fix(bindings/type): Update types of jsc.experimental (#7972)
Browse files Browse the repository at this point in the history
**Related issue:**

 - Closes #7951
  • Loading branch information
kdy1 authored Sep 19, 2023
1 parent 2dac393 commit e40fccb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
21 changes: 17 additions & 4 deletions packages/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export interface TerserMangleOptions {
reserved?: string[];
}

export interface TerserManglePropertiesOptions {}
export interface TerserManglePropertiesOptions { }

/**
* Programmatic options.
Expand Down Expand Up @@ -596,7 +596,20 @@ export interface JscConfig {
*/
experimental?: {
optimizeHygiene?: boolean;
keepImportAssertions?: boolean;

/**
* Preserve `with` in imports and exports.
*/
keepImportAttributes?: boolean;


/**
* Use `assert` instead of `with` for imports and exports.
* This option only works when `keepImportAttributes` is `true`.
*/
emitAssertForImportAttributes?: boolean;


/**
* Specify the location where SWC stores its intermediate cache files.
* Currently only transform plugin uses this. If not specified, SWC will
Expand Down Expand Up @@ -1074,7 +1087,7 @@ export interface Output {
map?: string;
}

export interface MatchPattern {}
export interface MatchPattern { }

// -------------------------------
// ---------- Ast nodes ----------
Expand Down Expand Up @@ -1306,7 +1319,7 @@ export type Expression =
| OptionalChainingExpression
| Invalid;

interface ExpressionBase extends Node, HasSpan {}
interface ExpressionBase extends Node, HasSpan { }

export interface Identifier extends ExpressionBase {
type: "Identifier";
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swc/types",
"version": "0.1.4",
"version": "0.1.5",
"description": "Typings for the swc project.",
"sideEffects": false,
"scripts": {
Expand Down

1 comment on commit e40fccb

@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: e40fccb Previous: f7b5e16 Ratio
es/full/bugs-1 294861 ns/iter (± 9165) 284743 ns/iter (± 7868) 1.04
es/full/minify/libraries/antd 1276729406 ns/iter (± 6433417) 1313235591 ns/iter (± 15345601) 0.97
es/full/minify/libraries/d3 272276297 ns/iter (± 2833951) 276298446 ns/iter (± 7585789) 0.99
es/full/minify/libraries/echarts 1024309245 ns/iter (± 3576884) 1061833949 ns/iter (± 10642084) 0.96
es/full/minify/libraries/jquery 83119981 ns/iter (± 130791) 84105130 ns/iter (± 465966) 0.99
es/full/minify/libraries/lodash 95894352 ns/iter (± 274397) 97085100 ns/iter (± 388218) 0.99
es/full/minify/libraries/moment 49178211 ns/iter (± 52541) 49667450 ns/iter (± 124838) 0.99
es/full/minify/libraries/react 17816917 ns/iter (± 36460) 17955915 ns/iter (± 47207) 0.99
es/full/minify/libraries/terser 213336424 ns/iter (± 976260) 217459782 ns/iter (± 1156951) 0.98
es/full/minify/libraries/three 379062294 ns/iter (± 1640820) 385390790 ns/iter (± 1916992) 0.98
es/full/minify/libraries/typescript 2583855773 ns/iter (± 9065923) 2650716874 ns/iter (± 10964539) 0.97
es/full/minify/libraries/victory 553200056 ns/iter (± 3491556) 572730867 ns/iter (± 7389882) 0.97
es/full/minify/libraries/vue 117926132 ns/iter (± 329741) 119277268 ns/iter (± 568642) 0.99
es/full/codegen/es3 34330 ns/iter (± 111) 34080 ns/iter (± 104) 1.01
es/full/codegen/es5 34300 ns/iter (± 192) 34092 ns/iter (± 87) 1.01
es/full/codegen/es2015 34350 ns/iter (± 146) 34080 ns/iter (± 64) 1.01
es/full/codegen/es2016 34317 ns/iter (± 147) 34014 ns/iter (± 53) 1.01
es/full/codegen/es2017 34314 ns/iter (± 148) 34085 ns/iter (± 61) 1.01
es/full/codegen/es2018 34240 ns/iter (± 114) 34078 ns/iter (± 64) 1.00
es/full/codegen/es2019 34193 ns/iter (± 163) 34146 ns/iter (± 89) 1.00
es/full/codegen/es2020 34229 ns/iter (± 261) 34096 ns/iter (± 96) 1.00
es/full/all/es3 166367449 ns/iter (± 1152490) 167257045 ns/iter (± 1355179) 0.99
es/full/all/es5 159051180 ns/iter (± 798895) 159442846 ns/iter (± 710608) 1.00
es/full/all/es2015 118748669 ns/iter (± 610255) 119648299 ns/iter (± 715897) 0.99
es/full/all/es2016 117773786 ns/iter (± 680979) 119104202 ns/iter (± 791731) 0.99
es/full/all/es2017 117092917 ns/iter (± 596829) 118385550 ns/iter (± 798100) 0.99
es/full/all/es2018 115214440 ns/iter (± 750024) 115925522 ns/iter (± 944352) 0.99
es/full/all/es2019 114551411 ns/iter (± 693667) 115835074 ns/iter (± 1071377) 0.99
es/full/all/es2020 110075088 ns/iter (± 597088) 111123700 ns/iter (± 985741) 0.99
es/full/parser 485703 ns/iter (± 4702) 493227 ns/iter (± 4955) 0.98
es/full/base/fixer 17637 ns/iter (± 80) 17578 ns/iter (± 92) 1.00
es/full/base/resolver_and_hygiene 78285 ns/iter (± 501) 81435 ns/iter (± 166) 0.96
serialization of serde 296 ns/iter (± 1) 300 ns/iter (± 0) 0.99
css/minify/libraries/bootstrap 28407070 ns/iter (± 56049) 28831828 ns/iter (± 86769) 0.99
css/visitor/compare/clone 1660482 ns/iter (± 6364) 1703525 ns/iter (± 7514) 0.97
css/visitor/compare/visit_mut_span 1784743 ns/iter (± 9225) 1789249 ns/iter (± 4497) 1.00
css/visitor/compare/visit_mut_span_panic 1830669 ns/iter (± 6619) 1892564 ns/iter (± 4742) 0.97
css/visitor/compare/fold_span 2561000 ns/iter (± 10057) 2596404 ns/iter (± 13685) 0.99
css/visitor/compare/fold_span_panic 2765193 ns/iter (± 11132) 2784111 ns/iter (± 7634) 0.99
css/lexer/bootstrap_5_1_3 4590623 ns/iter (± 4634) 4467949 ns/iter (± 9364) 1.03
css/lexer/foundation_6_7_4 3875618 ns/iter (± 2120) 3758477 ns/iter (± 4106) 1.03
css/lexer/tailwind_3_1_1 735101 ns/iter (± 1881) 714930 ns/iter (± 657) 1.03
css/parser/bootstrap_5_1_3 19379404 ns/iter (± 121540) 19157947 ns/iter (± 50638) 1.01
css/parser/foundation_6_7_4 15268986 ns/iter (± 82275) 15366125 ns/iter (± 20530) 0.99
css/parser/tailwind_3_1_1 2960867 ns/iter (± 18160) 2946291 ns/iter (± 2055) 1.00
es/codegen/colors 727632 ns/iter (± 395770) 727970 ns/iter (± 397243) 1.00
es/codegen/large 3139585 ns/iter (± 1657343) 3123801 ns/iter (± 1651723) 1.01
es/codegen/with-parser/colors 44842 ns/iter (± 311) 44654 ns/iter (± 483) 1.00
es/codegen/with-parser/large 489468 ns/iter (± 1639) 490026 ns/iter (± 606) 1.00
es/minify/libraries/antd 1114139376 ns/iter (± 8708410) 1150763630 ns/iter (± 11426710) 0.97
es/minify/libraries/d3 237334296 ns/iter (± 250182) 240021202 ns/iter (± 883551) 0.99
es/minify/libraries/echarts 885579997 ns/iter (± 4849284) 910842258 ns/iter (± 8736735) 0.97
es/minify/libraries/jquery 73140243 ns/iter (± 136805) 73236250 ns/iter (± 143091) 1.00
es/minify/libraries/lodash 86845966 ns/iter (± 150377) 87033183 ns/iter (± 184563) 1.00
es/minify/libraries/moment 43454350 ns/iter (± 68708) 43232130 ns/iter (± 54915) 1.01
es/minify/libraries/react 16020955 ns/iter (± 24628) 15967695 ns/iter (± 60598) 1.00
es/minify/libraries/terser 184473716 ns/iter (± 244642) 184900593 ns/iter (± 700055) 1.00
es/minify/libraries/three 317700061 ns/iter (± 772631) 321652536 ns/iter (± 3481787) 0.99
es/minify/libraries/typescript 2204186727 ns/iter (± 4921868) 2206397526 ns/iter (± 12141534) 1.00
es/minify/libraries/victory 464402458 ns/iter (± 969505) 468861923 ns/iter (± 3019218) 0.99
es/minify/libraries/vue 105819565 ns/iter (± 136981) 106012319 ns/iter (± 337809) 1.00
es/visitor/compare/clone 1929407 ns/iter (± 24061) 1948337 ns/iter (± 2933) 0.99
es/visitor/compare/visit_mut_span 2274793 ns/iter (± 7965) 2291581 ns/iter (± 3471) 0.99
es/visitor/compare/visit_mut_span_panic 2308889 ns/iter (± 11366) 2323406 ns/iter (± 3228) 0.99
es/visitor/compare/fold_span 3339712 ns/iter (± 5599) 3381186 ns/iter (± 6459) 0.99
es/visitor/compare/fold_span_panic 3498960 ns/iter (± 20230) 3489932 ns/iter (± 6005) 1.00
es/lexer/colors 12907 ns/iter (± 59) 13199 ns/iter (± 9) 0.98
es/lexer/angular 6015281 ns/iter (± 26324) 6131710 ns/iter (± 3423) 0.98
es/lexer/backbone 773723 ns/iter (± 3320) 801440 ns/iter (± 4019) 0.97
es/lexer/jquery 4421781 ns/iter (± 24425) 4541784 ns/iter (± 2919) 0.97
es/lexer/jquery mobile 6766376 ns/iter (± 64562) 6954808 ns/iter (± 18010) 0.97
es/lexer/mootools 3503038 ns/iter (± 21051) 3596741 ns/iter (± 10464) 0.97
es/lexer/underscore 645659 ns/iter (± 3394) 672096 ns/iter (± 1110) 0.96
es/lexer/three 21033433 ns/iter (± 175829) 21651715 ns/iter (± 75150) 0.97
es/lexer/yui 3781558 ns/iter (± 13076) 3881428 ns/iter (± 2392) 0.97
es/parser/colors 27022 ns/iter (± 128) 27856 ns/iter (± 46) 0.97
es/parser/angular 13417903 ns/iter (± 58020) 13599652 ns/iter (± 50307) 0.99
es/parser/backbone 1967509 ns/iter (± 9559) 2000218 ns/iter (± 7129) 0.98
es/parser/jquery 10767250 ns/iter (± 27093) 10926354 ns/iter (± 31659) 0.99
es/parser/jquery mobile 16419099 ns/iter (± 59950) 16654593 ns/iter (± 55219) 0.99
es/parser/mootools 8309593 ns/iter (± 19903) 8405927 ns/iter (± 32009) 0.99
es/parser/underscore 1691918 ns/iter (± 11829) 1714534 ns/iter (± 9623) 0.99
es/parser/three 46195637 ns/iter (± 195110) 47047077 ns/iter (± 206357) 0.98
es/parser/yui 8240327 ns/iter (± 59344) 8361038 ns/iter (± 29311) 0.99
es/preset-env/usage/builtin_type 135935 ns/iter (± 33012) 138068 ns/iter (± 32832) 0.98
es/preset-env/usage/property 16094 ns/iter (± 180) 16746 ns/iter (± 80) 0.96
es/resolver/typescript 87976309 ns/iter (± 943216) 90856322 ns/iter (± 1494330) 0.97
es/fixer/typescript 62473404 ns/iter (± 553066) 64366384 ns/iter (± 480036) 0.97
es/hygiene/typescript 127933552 ns/iter (± 522901) 134282950 ns/iter (± 956600) 0.95
es/resolver_with_hygiene/typescript 239395377 ns/iter (± 1654189) 245294317 ns/iter (± 1300411) 0.98
es/visitor/base-perf/module_clone 58736 ns/iter (± 577) 58215 ns/iter (± 311) 1.01
es/visitor/base-perf/fold_empty 62565 ns/iter (± 448) 62795 ns/iter (± 216) 1.00
es/visitor/base-perf/fold_noop_impl_all 62976 ns/iter (± 498) 62865 ns/iter (± 122) 1.00
es/visitor/base-perf/fold_noop_impl_vec 62803 ns/iter (± 535) 63075 ns/iter (± 812) 1.00
es/visitor/base-perf/boxing_boxed_clone 56 ns/iter (± 0) 57 ns/iter (± 0) 0.98
es/visitor/base-perf/boxing_unboxed_clone 40 ns/iter (± 0) 39 ns/iter (± 0) 1.03
es/visitor/base-perf/boxing_boxed 105 ns/iter (± 0) 108 ns/iter (± 0) 0.97
es/visitor/base-perf/boxing_unboxed 76 ns/iter (± 0) 78 ns/iter (± 0) 0.97
es/visitor/base-perf/visit_empty 0 ns/iter (± 0) 0 ns/iter (± 0) NaN
es/visitor/base-perf/visit_contains_this 2536 ns/iter (± 12) 2544 ns/iter (± 11) 1.00
es/base/parallel/resolver/typescript 4285647758 ns/iter (± 203741328) 4250136100 ns/iter (± 240919946) 1.01
es/base/parallel/hygiene/typescript 1441749326 ns/iter (± 10948960) 1475465122 ns/iter (± 21050100) 0.98
misc/visitors/time-complexity/time 5 149 ns/iter (± 0) 152 ns/iter (± 3) 0.98
misc/visitors/time-complexity/time 10 421 ns/iter (± 2) 454 ns/iter (± 15) 0.93
misc/visitors/time-complexity/time 15 789 ns/iter (± 1) 790 ns/iter (± 3) 1.00
misc/visitors/time-complexity/time 20 1432 ns/iter (± 0) 1309 ns/iter (± 2) 1.09
misc/visitors/time-complexity/time 40 4343 ns/iter (± 10) 4380 ns/iter (± 4) 0.99
misc/visitors/time-complexity/time 60 10586 ns/iter (± 70) 9049 ns/iter (± 8) 1.17
es/full-target/es2016 230569 ns/iter (± 758) 229636 ns/iter (± 1024) 1.00
es/full-target/es2017 218678 ns/iter (± 612) 218289 ns/iter (± 959) 1.00
es/full-target/es2018 207347 ns/iter (± 1730) 206824 ns/iter (± 931) 1.00
es2020_nullish_coalescing 69605 ns/iter (± 318) 69862 ns/iter (± 342) 1.00
es2020_optional_chaining 75773 ns/iter (± 246) 75957 ns/iter (± 191) 1.00
es2022_class_properties 115388 ns/iter (± 281) 115318 ns/iter (± 580) 1.00
es2018_object_rest_spread 73498 ns/iter (± 137) 74168 ns/iter (± 200) 0.99
es2019_optional_catch_binding 63409 ns/iter (± 263) 64433 ns/iter (± 266) 0.98
es2017_async_to_generator 62735 ns/iter (± 426) 63576 ns/iter (± 140) 0.99
es2016_exponentiation 67933 ns/iter (± 189) 67269 ns/iter (± 231) 1.01
es2015_arrow 70488 ns/iter (± 344) 70856 ns/iter (± 171) 0.99
es2015_block_scoped_fn 68100 ns/iter (± 214) 67913 ns/iter (± 213) 1.00
es2015_block_scoping 120231 ns/iter (± 408) 119210 ns/iter (± 607) 1.01

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

Please sign in to comment.