File tree 7 files changed +16
-14
lines changed
packages/qwik/src/optimizer/core/src
7 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ members = [
6
6
" packages/qwik/src/optimizer/core" ,
7
7
]
8
8
exclude = [" packages/qwik/src/wasm" ]
9
+ resolver = " 2"
9
10
10
11
[profile .release ]
11
12
debug = 0
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ impl VisitMut for CleanMarker {
38
38
39
39
impl VisitMut for CleanSideEffects {
40
40
fn visit_mut_module ( & mut self , node : & mut ast:: Module ) {
41
- node. body . drain_filter ( |item| {
41
+ let it = node. body . extract_if ( |item| {
42
42
if item. span ( ) . has_mark ( self . mark ) {
43
43
return false ;
44
44
}
@@ -53,5 +53,7 @@ impl VisitMut for CleanSideEffects {
53
53
_ => false ,
54
54
}
55
55
} ) ;
56
+ // Consume the iterator to force the extraction.
57
+ for _ in it { }
56
58
}
57
59
}
Original file line number Diff line number Diff line change @@ -374,10 +374,10 @@ impl Visit for IdentCollector {
374
374
}
375
375
376
376
fn visit_ident ( & mut self , node : & ast:: Ident ) {
377
- if let Some ( ExprOrSkip :: Expr ) = self . expr_ctxt . last ( ) {
378
- if node. span . ctxt ( ) != SyntaxContext :: empty ( ) {
379
- self . local_idents . insert ( id ! ( node ) ) ;
380
- }
377
+ if matches ! ( self . expr_ctxt. last( ) , Some ( ExprOrSkip :: Expr ) )
378
+ && node. span . ctxt ( ) != SyntaxContext :: empty ( )
379
+ {
380
+ self . local_idents . insert ( id ! ( node ) ) ;
381
381
}
382
382
}
383
383
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ pub fn parse_entry_strategy(
183
183
manual_chunks : Option < HashMap < String , JsWord > > ,
184
184
) -> Box < dyn EntryPolicy > {
185
185
match strategy {
186
- EntryStrategy :: Inline | EntryStrategy :: Hoist => Box :: new ( InlineStrategy :: default ( ) ) ,
186
+ EntryStrategy :: Inline | EntryStrategy :: Hoist => Box :: < InlineStrategy > :: default ( ) ,
187
187
EntryStrategy :: Hook => Box :: new ( PerHookStrategy :: new ( manual_chunks) ) ,
188
188
EntryStrategy :: Single => Box :: new ( SingleStrategy :: new ( manual_chunks) ) ,
189
189
EntryStrategy :: Component => Box :: new ( PerComponentStrategy :: new ( manual_chunks) ) ,
Original file line number Diff line number Diff line change 5
5
#![ feature( box_patterns) ]
6
6
#![ allow( clippy:: option_if_let_else) ]
7
7
#![ allow( clippy:: iter_with_drain) ]
8
- #![ feature( drain_filter ) ]
8
+ #![ feature( extract_if ) ]
9
9
#[ cfg( test) ]
10
10
mod test;
11
11
Original file line number Diff line number Diff line change @@ -317,7 +317,8 @@ impl<'a> QwikTransform<'a> {
317
317
display_name += "s_" ;
318
318
}
319
319
display_name = escape_sym ( & display_name) ;
320
- if display_name. starts_with ( |c| matches ! ( c, '0' ..='9' ) ) {
320
+ let first_char = display_name. chars ( ) . next ( ) ;
321
+ if first_char. map_or ( false , |c| c. is_ascii_digit ( ) ) {
321
322
display_name = format ! ( "_{}" , display_name) ;
322
323
}
323
324
let index = match self . hooks_names . get_mut ( & display_name) {
@@ -1745,7 +1746,6 @@ impl<'a> Fold for QwikTransform<'a> {
1745
1746
{
1746
1747
self . hooks
1747
1748
. drain ( ..)
1748
- . into_iter ( )
1749
1749
. map ( |hook| {
1750
1750
let id = ( hook. name . clone ( ) , SyntaxContext :: from_u32 ( hook. hash as u32 ) ) ;
1751
1751
ast:: ModuleItem :: Stmt ( ast:: Stmt :: Decl ( ast:: Decl :: Var ( Box :: new (
@@ -2170,12 +2170,11 @@ impl<'a> Fold for QwikTransform<'a> {
2170
2170
} else {
2171
2171
let new_specifier =
2172
2172
convert_signal_word ( & ident. sym ) . expect ( "Specifier ends with $" ) ;
2173
- let new_local = global_collect
2173
+ global_collect
2174
2174
. exports
2175
2175
. keys ( )
2176
- . find ( |id| id. 0 == new_specifier) ;
2177
-
2178
- new_local. map_or_else (
2176
+ . find ( |id| id. 0 == new_specifier)
2177
+ . map_or_else (
2179
2178
|| {
2180
2179
HANDLER . with ( |handler| {
2181
2180
handler
Original file line number Diff line number Diff line change 1
- nightly-2022-09 -23
1
+ nightly-2023-06 -23
You can’t perform that action at this time.
0 commit comments