Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-blocking stylesheet resolving #246

Open
Stranger6667 opened this issue Aug 28, 2023 · 0 comments · May be fixed by #320
Open

Non-blocking stylesheet resolving #246

Stranger6667 opened this issue Aug 28, 2023 · 0 comments · May be fixed by #320

Comments

@Stranger6667
Copy link
Owner

Stranger6667 commented Aug 28, 2023

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant