all the rust plugin stage should be changed to f64
currently rust plugin stage use i32 which cause it can't accept Infinity and float points in js side, which is not compatible with webpack, so the stage should be changed to f64 to be compatible with webpack
Can I jump on it? Rspack looks so promising :)
thanks in advance,go try it
@pawel-twardziak are you still working on it or met any problems?
@hardfist was busy, couldn't even kick it off :( Today and tomorrow I am on my sick leave so I could finally give it a shot. Any rush? I might need some help. But if you need it sooner feel free to haned it over to someone else.
Hi, @hardfist I've just raised the job - is that all that should get done?
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
bump
in Rust side, we can't change the stage type to f64.
if i32 changed to f64
in proc macro define_hook , it generates code like
fn stage(&self) -> f64 {
0.0
}
f64 doesn't meet the 'Eq' and 'Hash' trait in HashSet
|
|
\/
fn used_stages(&self) -> rspack_hook::__macro_helper::FxHashSet<f64> {
rspack_hook::__macro_helper::FxHashSet::from_iter(
self.taps.iter().map(|h| h.stage()),
)
}
and ( either the 'ord ' trait in sort_by_key )
let mut all_taps = std::vec::Vec::new();
all_taps.extend(&self.taps);
all_taps.extend(&additional_taps);
all_taps.sort_by_key(|hook| hook.stage());
maybe we need to find other ways to support float stage number.
@hardfist let's try a newType
rust plugin is no needs to change stage into float, the internal usage i32 is enough.