Skip to content

Non-blocking stylesheet resolving #246

Open
@Stranger6667

Description

@Stranger6667

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions