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 has inline & inline_to as async functions + top-level API could be something like in reqwest - css_inline::blocking::inline and css_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 to attohttpc we use now.
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
AsyncCssInliner, that hasinline&inline_toas async functions + top-level API could be something like inreqwest-css_inline::blocking::inlineandcss_inline::inlinebeing an async function.reqwestmight be a good alternative toattohttpcwe use now.