11use std:: {
22 cell:: RefCell ,
3- collections:: { hash_map , BTreeMap } ,
3+ collections:: { BTreeMap , hash_map } ,
44 convert:: { TryFrom , TryInto } ,
55 mem:: { replace, take} ,
66 path:: { Path , PathBuf } ,
@@ -16,23 +16,23 @@ use rustc_hash::{FxHashMap, FxHashSet};
1616use serde:: Deserialize ;
1717use sha1:: { Digest , Sha1 } ;
1818use swc_core:: {
19- atoms:: { atom , Atom } ,
19+ atoms:: { Atom , atom } ,
2020 common:: {
21+ BytePos , DUMMY_SP , FileName , Mark , SourceMap , Span , SyntaxContext ,
2122 comments:: { Comment , CommentKind , Comments , SingleThreadedComments } ,
2223 errors:: HANDLER ,
23- source_map:: { SourceMapGenConfig , PURE_SP } ,
24+ source_map:: { PURE_SP , SourceMapGenConfig } ,
2425 util:: take:: Take ,
25- BytePos , FileName , Mark , SourceMap , Span , SyntaxContext , DUMMY_SP ,
2626 } ,
2727 ecma:: {
2828 ast:: * ,
29- codegen:: { self , text_writer:: JsWriter , Emitter } ,
30- utils:: { private_ident , quote_ident , ExprFactory } ,
31- visit:: { noop_visit_mut_type , visit_mut_pass , VisitMut , VisitMutWith } ,
29+ codegen:: { self , Emitter , text_writer:: JsWriter } ,
30+ utils:: { ExprFactory , private_ident , quote_ident } ,
31+ visit:: { VisitMut , VisitMutWith , noop_visit_mut_type , visit_mut_pass } ,
3232 } ,
3333 quote,
3434} ;
35- use turbo_rcstr:: { rcstr , RcStr } ;
35+ use turbo_rcstr:: { RcStr , rcstr } ;
3636
3737use crate :: FxIndexMap ;
3838
@@ -249,7 +249,11 @@ struct ServerActions<C: Comments> {
249249 annotations : Vec < Stmt > ,
250250 extra_items : Vec < ModuleItem > ,
251251 hoisted_extra_items : Vec < ModuleItem > ,
252+
253+ // A map of all server references (inline + exported): export_name -> reference_id
252254 reference_ids_by_export_name : FxIndexMap < Atom , Atom > ,
255+
256+ // A list of server references for originally exported server functions only.
253257 server_reference_exports : Vec < ServerReferenceExport > ,
254258
255259 private_ctxt : SyntaxContext ,
0 commit comments