Skip to content

Commit

Permalink
fix(html/ast): Fix compilation (#6211)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Oct 19, 2022
1 parent 9de0b6e commit 1b0dad1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
5 changes: 0 additions & 5 deletions crates/swc_html_ast/src/base.rs
Expand Up @@ -63,7 +63,6 @@ pub struct DocumentType {
pub public_id: Option<JsWord>,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub system_id: Option<JsWord>,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub raw: Option<Atom>,
}

Expand Down Expand Up @@ -126,11 +125,9 @@ pub struct Attribute {
pub prefix: Option<JsWord>,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub name: JsWord,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub raw_name: Option<Atom>,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub value: Option<JsWord>,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub raw_value: Option<Atom>,
}

Expand All @@ -149,7 +146,6 @@ pub struct Text {
pub span: Span,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub data: JsWord,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub raw: Option<Atom>,
}

Expand All @@ -165,7 +161,6 @@ pub struct Comment {
pub span: Span,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub data: JsWord,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub raw: Option<Atom>,
}

Expand Down
7 changes: 0 additions & 7 deletions crates/swc_html_ast/src/token.rs
Expand Up @@ -14,11 +14,9 @@ pub struct AttributeToken {
pub span: Span,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub name: JsWord,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub raw_name: Option<Atom>,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub value: Option<JsWord>,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
pub raw_value: Option<Atom>,
}

Expand Down Expand Up @@ -66,35 +64,30 @@ pub enum Token {
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
// System identifier
system_id: Option<JsWord>,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
// Raw value
raw: Option<Atom>,
},
StartTag {
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
tag_name: JsWord,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
raw_tag_name: Option<Atom>,
is_self_closing: bool,
attributes: Vec<AttributeToken>,
},
EndTag {
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
tag_name: JsWord,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
raw_tag_name: Option<Atom>,
is_self_closing: bool,
attributes: Vec<AttributeToken>,
},
Comment {
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
data: JsWord,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
raw: Option<Atom>,
},
Character {
value: char,
#[cfg_attr(feature = "rkyv", with(swc_atoms::EncodeJsWord))]
raw: Option<Raw>,
},
Eof,
Expand Down

1 comment on commit 1b0dad1

@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: 1b0dad1 Previous: 8ab10f6 Ratio
es/full/bugs-1 341182 ns/iter (± 33524) 341171 ns/iter (± 17042) 1.00
es/full/minify/libraries/antd 1805592024 ns/iter (± 23178570) 1809645325 ns/iter (± 88702341) 1.00
es/full/minify/libraries/d3 385007305 ns/iter (± 7726408) 385610114 ns/iter (± 35950898) 1.00
es/full/minify/libraries/echarts 1521509326 ns/iter (± 32121559) 1560699469 ns/iter (± 24323277) 0.97
es/full/minify/libraries/jquery 101439439 ns/iter (± 4820874) 104302990 ns/iter (± 7635693) 0.97
es/full/minify/libraries/lodash 112006175 ns/iter (± 6841303) 116718624 ns/iter (± 6366904) 0.96
es/full/minify/libraries/moment 58118957 ns/iter (± 543713) 57493478 ns/iter (± 1089800) 1.01
es/full/minify/libraries/react 21027227 ns/iter (± 940693) 20405416 ns/iter (± 1138343) 1.03
es/full/minify/libraries/terser 304582403 ns/iter (± 14793283) 337805195 ns/iter (± 25566478) 0.90
es/full/minify/libraries/three 551495282 ns/iter (± 28176431) 590994527 ns/iter (± 40645916) 0.93
es/full/minify/libraries/typescript 3429272507 ns/iter (± 104250035) 3575808801 ns/iter (± 44759399) 0.96
es/full/minify/libraries/victory 822865187 ns/iter (± 13704796) 867190480 ns/iter (± 18611659) 0.95
es/full/minify/libraries/vue 153867437 ns/iter (± 8611442) 155936122 ns/iter (± 5487647) 0.99
es/full/codegen/es3 34215 ns/iter (± 963) 36502 ns/iter (± 1891) 0.94
es/full/codegen/es5 34395 ns/iter (± 1137) 34877 ns/iter (± 1847) 0.99
es/full/codegen/es2015 34448 ns/iter (± 1302) 35300 ns/iter (± 1154) 0.98
es/full/codegen/es2016 34316 ns/iter (± 1599) 35541 ns/iter (± 1806) 0.97
es/full/codegen/es2017 34217 ns/iter (± 1516) 35563 ns/iter (± 1665) 0.96
es/full/codegen/es2018 34283 ns/iter (± 1693) 35809 ns/iter (± 3968) 0.96
es/full/codegen/es2019 34285 ns/iter (± 699) 36158 ns/iter (± 3438) 0.95
es/full/codegen/es2020 34458 ns/iter (± 1474) 35351 ns/iter (± 1138) 0.97
es/full/all/es3 209533136 ns/iter (± 13014947) 198034216 ns/iter (± 12315413) 1.06
es/full/all/es5 190276806 ns/iter (± 10111348) 185119762 ns/iter (± 10873926) 1.03
es/full/all/es2015 150762636 ns/iter (± 4710106) 147845502 ns/iter (± 9074104) 1.02
es/full/all/es2016 158595974 ns/iter (± 12750011) 145359134 ns/iter (± 7042363) 1.09
es/full/all/es2017 169869646 ns/iter (± 29047393) 146567235 ns/iter (± 8816041) 1.16
es/full/all/es2018 166886979 ns/iter (± 14068534) 154737661 ns/iter (± 9381055) 1.08
es/full/all/es2019 148368909 ns/iter (± 6858116) 145419851 ns/iter (± 15115062) 1.02
es/full/all/es2020 143230552 ns/iter (± 10476460) 139719467 ns/iter (± 8672605) 1.03
es/full/parser 747540 ns/iter (± 25565) 731307 ns/iter (± 65949) 1.02
es/full/base/fixer 26603 ns/iter (± 1500) 25687 ns/iter (± 3022) 1.04
es/full/base/resolver_and_hygiene 92782 ns/iter (± 2254) 95177 ns/iter (± 14197) 0.97
serialization of ast node 215 ns/iter (± 1) 221 ns/iter (± 15) 0.97
serialization of serde 223 ns/iter (± 17) 227 ns/iter (± 8) 0.98

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

Please sign in to comment.