-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(html/codegen): Handle optional tags (#4986)
- Loading branch information
1 parent
d722ee2
commit 41dc0a7
Showing
7 changed files
with
203 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<menu> | ||
<li><button onclick="copy()"><img src="copy.svg" alt="Copy"></button></li> | ||
<li><button onclick="cut()"><img src="cut.svg" alt="Cut"></button></li> | ||
<li><button onclick="paste()"><img src="paste.svg" alt="Paste"></button></li> | ||
</menu> | ||
<menu><li><button onclick="copy()"><img src="copy.svg" alt="Copy"></button></li><li><button onclick="cut()"><img src="cut.svg" alt="Cut"></button></li><li><button onclick="paste()"><img src="paste.svg" alt="Paste"></button></li></menu> | ||
|
||
<p>test</p><unknown><li>test</li></unknown> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<menu> | ||
<li><button onclick="copy()"><img src="copy.svg" alt="Copy"></button></li> | ||
<li><button onclick="cut()"><img src="cut.svg" alt="Cut"></button></li> | ||
<li><button onclick="paste()"><img src="paste.svg" alt="Paste"></button></li> | ||
</menu> | ||
<menu><li><button onclick="copy()"><img src="copy.svg" alt="Copy"></button></li><li><button onclick="cut()"><img src="cut.svg" alt="Cut"></button></li><li><button onclick="paste()"><img src="paste.svg" alt="Paste"></button></li></menu> | ||
|
||
<p>test</p><unknown><li>test</li></unknown> | ||
|
||
|
||
</body></html> |
14 changes: 14 additions & 0 deletions
14
crates/swc_html_codegen/tests/fixture/menu/output.min.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html><html lang=en><head> | ||
<title>Document</title> | ||
</head> | ||
<body> | ||
<menu> | ||
<li><button onclick=copy()><img src=copy.svg alt=Copy></button></li> | ||
<li><button onclick=cut()><img src=cut.svg alt=Cut></button></li> | ||
<li><button onclick=paste()><img src=paste.svg alt=Paste></button></li> | ||
</menu> | ||
<menu><li><button onclick=copy()><img src=copy.svg alt=Copy></button><li><button onclick=cut()><img src=cut.svg alt=Cut></button><li><button onclick=paste()><img src=paste.svg alt=Paste></button></menu> | ||
|
||
<p>test</p><unknown><li>test</li></unknown> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41dc0a7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/minify/libraries/antd
1697303245
ns/iter (± 68660308
)1913756493
ns/iter (± 32222882
)0.89
es/full/minify/libraries/d3
414321976
ns/iter (± 12941243
)432659667
ns/iter (± 12983162
)0.96
es/full/minify/libraries/echarts
1637451361
ns/iter (± 29203576
)1932791912
ns/iter (± 36889865
)0.85
es/full/minify/libraries/jquery
95759382
ns/iter (± 4898003
)102641547
ns/iter (± 1863662
)0.93
es/full/minify/libraries/lodash
140256170
ns/iter (± 9420233
)139717114
ns/iter (± 1336052
)1.00
es/full/minify/libraries/moment
54907335
ns/iter (± 2065777
)62413668
ns/iter (± 2079298
)0.88
es/full/minify/libraries/react
17803192
ns/iter (± 397948
)21052119
ns/iter (± 484339
)0.85
es/full/minify/libraries/terser
641442206
ns/iter (± 20161950
)712001987
ns/iter (± 23749344
)0.90
es/full/minify/libraries/three
574637997
ns/iter (± 19749940
)586989030
ns/iter (± 30049785
)0.98
es/full/minify/libraries/typescript
3602930170
ns/iter (± 46482953
)4010379806
ns/iter (± 61830983
)0.90
es/full/minify/libraries/victory
762619488
ns/iter (± 10642337
)819381265
ns/iter (± 32606370
)0.93
es/full/minify/libraries/vue
153330603
ns/iter (± 2383886
)152153451
ns/iter (± 1667667
)1.01
es/full/codegen/es3
33488
ns/iter (± 2373
)37983
ns/iter (± 2104
)0.88
es/full/codegen/es5
33550
ns/iter (± 3514
)38193
ns/iter (± 672
)0.88
es/full/codegen/es2015
34318
ns/iter (± 2545
)38513
ns/iter (± 833
)0.89
es/full/codegen/es2016
33677
ns/iter (± 4111
)38191
ns/iter (± 946
)0.88
es/full/codegen/es2017
33000
ns/iter (± 3335
)39064
ns/iter (± 2309
)0.84
es/full/codegen/es2018
33445
ns/iter (± 2528
)38266
ns/iter (± 892
)0.87
es/full/codegen/es2019
33499
ns/iter (± 3155
)38386
ns/iter (± 1074
)0.87
es/full/codegen/es2020
34023
ns/iter (± 2645
)38529
ns/iter (± 1198
)0.88
es/full/all/es3
197159598
ns/iter (± 8935230
)223486143
ns/iter (± 4589446
)0.88
es/full/all/es5
182092447
ns/iter (± 7200398
)209708833
ns/iter (± 4283782
)0.87
es/full/all/es2015
146006772
ns/iter (± 5740629
)171219434
ns/iter (± 2923824
)0.85
es/full/all/es2016
146608106
ns/iter (± 5995390
)173485613
ns/iter (± 4670784
)0.85
es/full/all/es2017
147566397
ns/iter (± 6576103
)170286896
ns/iter (± 2231408
)0.87
es/full/all/es2018
140347083
ns/iter (± 5727911
)166385606
ns/iter (± 3107865
)0.84
es/full/all/es2019
138741820
ns/iter (± 5800474
)165544669
ns/iter (± 1770920
)0.84
es/full/all/es2020
134556057
ns/iter (± 6789073
)159331885
ns/iter (± 3063264
)0.84
es/full/parser
714874
ns/iter (± 47463
)847365
ns/iter (± 19842
)0.84
es/full/base/fixer
30047
ns/iter (± 2325
)34455
ns/iter (± 2497
)0.87
es/full/base/resolver_and_hygiene
88983
ns/iter (± 8073
)101256
ns/iter (± 4764
)0.88
serialization of ast node
220
ns/iter (± 22
)233
ns/iter (± 10
)0.94
serialization of serde
226
ns/iter (± 37
)242
ns/iter (± 11
)0.93
This comment was automatically generated by workflow using github-action-benchmark.