@@ -9,13 +9,13 @@ use swc_core::ecma::atoms::Atom;
9
9
10
10
use crate :: {
11
11
AsyncDependenciesBlock , AsyncDependenciesBlockIdentifier , Compilation , DependenciesBlock ,
12
- Dependency , ExportInfo , ExportName , ExportProvided , ExportsInfoGetter , ModuleGraphCacheArtifact ,
13
- PrefetchExportsInfoMode , PrefetchedExportsInfoWrapper , RuntimeSpec ,
12
+ Dependency , ExportInfo , ExportName , ModuleGraphCacheArtifact , RuntimeSpec ,
14
13
} ;
15
14
mod module;
16
15
pub use module:: * ;
17
16
mod connection;
18
17
pub use connection:: * ;
18
+ mod exports_info;
19
19
20
20
use crate :: {
21
21
BoxDependency , BoxModule , DependencyCondition , DependencyId , ExportsInfo , ExportsInfoData ,
@@ -1026,62 +1026,6 @@ impl<'a> ModuleGraph<'a> {
1026
1026
new_mgm. add_incoming_connection ( * dep_id) ;
1027
1027
}
1028
1028
1029
- pub fn get_exports_info ( & self , module_identifier : & ModuleIdentifier ) -> ExportsInfo {
1030
- self
1031
- . module_graph_module_by_identifier ( module_identifier)
1032
- . expect ( "should have mgm" )
1033
- . exports
1034
- }
1035
-
1036
- pub fn get_prefetched_exports_info_optional < ' b > (
1037
- & ' b self ,
1038
- module_identifier : & ModuleIdentifier ,
1039
- mode : PrefetchExportsInfoMode < ' b > ,
1040
- ) -> Option < PrefetchedExportsInfoWrapper < ' b > > {
1041
- self
1042
- . module_graph_module_by_identifier ( module_identifier)
1043
- . map ( move |mgm| ExportsInfoGetter :: prefetch ( & mgm. exports , self , mode) )
1044
- }
1045
-
1046
- pub fn get_prefetched_exports_info < ' b > (
1047
- & ' b self ,
1048
- module_identifier : & ModuleIdentifier ,
1049
- mode : PrefetchExportsInfoMode < ' b > ,
1050
- ) -> PrefetchedExportsInfoWrapper < ' b > {
1051
- let exports_info = self . get_exports_info ( module_identifier) ;
1052
- ExportsInfoGetter :: prefetch ( & exports_info, self , mode)
1053
- }
1054
-
1055
- pub fn get_exports_info_by_id ( & self , id : & ExportsInfo ) -> & ExportsInfoData {
1056
- self
1057
- . try_get_exports_info_by_id ( id)
1058
- . expect ( "should have exports info" )
1059
- }
1060
-
1061
- pub fn try_get_exports_info_by_id ( & self , id : & ExportsInfo ) -> Option < & ExportsInfoData > {
1062
- self . loop_partials ( |p| p. exports_info_map . get ( id) )
1063
- }
1064
-
1065
- pub fn get_exports_info_mut_by_id ( & mut self , id : & ExportsInfo ) -> & mut ExportsInfoData {
1066
- self
1067
- . loop_partials_mut (
1068
- |p| p. exports_info_map . contains_key ( id) ,
1069
- |p, search_result| {
1070
- p. exports_info_map . insert ( * id, search_result) ;
1071
- } ,
1072
- |p| p. exports_info_map . get ( id) . cloned ( ) ,
1073
- |p| p. exports_info_map . get_mut ( id) ,
1074
- )
1075
- . expect ( "should have exports info" )
1076
- }
1077
-
1078
- pub fn set_exports_info ( & mut self , id : ExportsInfo , info : ExportsInfoData ) {
1079
- let Some ( active_partial) = & mut self . active else {
1080
- panic ! ( "should have active partial" ) ;
1081
- } ;
1082
- active_partial. exports_info_map . insert ( id, info) ;
1083
- }
1084
-
1085
1029
pub fn get_optimization_bailout_mut ( & mut self , id : & ModuleIdentifier ) -> & mut Vec < String > {
1086
1030
let mgm = self
1087
1031
. module_graph_module_by_identifier_mut ( id)
@@ -1108,22 +1052,6 @@ impl<'a> ModuleGraph<'a> {
1108
1052
condition. get_connection_state ( connection, runtime, self , module_graph_cache)
1109
1053
}
1110
1054
1111
- // returns: Option<bool>
1112
- // - None: it's unknown
1113
- // - Some(true): provided
1114
- // - Some(false): not provided
1115
- pub fn is_export_provided (
1116
- & self ,
1117
- id : & ModuleIdentifier ,
1118
- names : & [ Atom ] ,
1119
- ) -> Option < ExportProvided > {
1120
- self . module_graph_module_by_identifier ( id) . and_then ( |mgm| {
1121
- let exports_info =
1122
- ExportsInfoGetter :: prefetch ( & mgm. exports , self , PrefetchExportsInfoMode :: Nested ( names) ) ;
1123
- exports_info. is_export_provided ( names)
1124
- } )
1125
- }
1126
-
1127
1055
// todo remove it after module_graph_partial remove all of dependency_id_to_*
1128
1056
pub fn cache_recovery_connection ( & mut self , connection : ModuleGraphConnection ) {
1129
1057
let condition = self
0 commit comments