Open
Description
Problem
Currently, our Rust crate resolves remote stylesheets in a sequential and blocking manner. This means that one has to wait for each stylesheet to be fully downloaded before moving on to the next one. This approach is inefficient, especially when handling multiple stylesheets, leading to longer wait times and a suboptimal user experience.
Why this is Important
The ability to resolve multiple stylesheets concurrently can significantly speed up the process, leading to faster loading times and a better user experience. Additionally, offering a blocking API can make the crate easier to use in certain scenarios where synchronous operations are preferred or required.
Things to be aware of
- The first step would be to factor out resolving code a bit
- It could be
AsyncCssInliner
, that hasinline
&inline_to
as async functions + top-level API could be something like inreqwest
-css_inline::blocking::inline
andcss_inline::inline
being an async function. - It is nice to have async support in bindings (Python at least), but not necessary in the same PR
reqwest
might be a good alternative toattohttpc
we use now.