@@ -40,6 +40,22 @@ impl AfterResolvePluginCondition {
4040 }
4141}
4242
43+ #[ turbo_tasks:: value( transparent) ]
44+ pub struct OptionAfterResolvePluginCondition ( Option < ResolvedVc < AfterResolvePluginCondition > > ) ;
45+
46+ #[ turbo_tasks:: value_impl]
47+ impl OptionAfterResolvePluginCondition {
48+ #[ turbo_tasks:: function]
49+ pub fn none ( ) -> Vc < Self > {
50+ Vc :: cell ( None )
51+ }
52+
53+ #[ turbo_tasks:: function]
54+ pub fn some ( condition : ResolvedVc < AfterResolvePluginCondition > ) -> Vc < Self > {
55+ Vc :: cell ( Some ( condition) )
56+ }
57+ }
58+
4359/// A condition which determines if the hooks of a resolve plugin gets called.
4460#[ turbo_tasks:: value]
4561pub enum BeforeResolvePluginCondition {
@@ -80,10 +96,26 @@ impl BeforeResolvePluginCondition {
8096 }
8197}
8298
99+ #[ turbo_tasks:: value( transparent) ]
100+ pub struct OptionBeforeResolvePluginCondition ( Option < ResolvedVc < BeforeResolvePluginCondition > > ) ;
101+
102+ #[ turbo_tasks:: value_impl]
103+ impl OptionBeforeResolvePluginCondition {
104+ #[ turbo_tasks:: function]
105+ pub fn none ( ) -> Vc < Self > {
106+ Vc :: cell ( None )
107+ }
108+
109+ #[ turbo_tasks:: function]
110+ pub fn some ( condition : ResolvedVc < BeforeResolvePluginCondition > ) -> Vc < Self > {
111+ Vc :: cell ( Some ( condition) )
112+ }
113+ }
114+
83115#[ turbo_tasks:: value_trait]
84116pub trait BeforeResolvePlugin {
85117 #[ turbo_tasks:: function]
86- fn before_resolve_condition ( self : Vc < Self > ) -> Vc < BeforeResolvePluginCondition > ;
118+ fn before_resolve_condition ( self : Vc < Self > ) -> Vc < OptionBeforeResolvePluginCondition > ;
87119
88120 #[ turbo_tasks:: function]
89121 fn before_resolve (
@@ -98,7 +130,7 @@ pub trait BeforeResolvePlugin {
98130pub trait AfterResolvePlugin {
99131 /// A condition which determines if the hooks gets called.
100132 #[ turbo_tasks:: function]
101- fn after_resolve_condition ( self : Vc < Self > ) -> Vc < AfterResolvePluginCondition > ;
133+ fn after_resolve_condition ( self : Vc < Self > ) -> Vc < OptionAfterResolvePluginCondition > ;
102134
103135 /// This hook gets called when a full filepath has been resolved and the
104136 /// condition matches. If a value is returned it replaces the resolve
0 commit comments