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

SX: implement styles rehydration #4039

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

mrtnzlml
Copy link
Member

@mrtnzlml mrtnzlml commented Mar 4, 2022

I have these changes sitting locally for a very long time, and it's time
to offload them. The idea behind the styles rehydration is very simple:
we collect all existing styles from <style data-adeira-sx /> (once)
and use this information later for deciding whether the styles should be
injected or not (this is what I call rehydration).

The difference from the current solution is that we do it only once and
we don't have to go through all the styles everytime there is something
to inject.

Motivation for this change is performance: this should significantly
improve the runtime style perf + be much easier to deal with (for
example, we are basically brute-forcing @at rules and pseudo rules now).

Note: this is just a partial solution, there are other changes coming
(custom styles printer and @at nodes/pseudo nodes optimization).

Related issue: #1579

@vercel vercel bot temporarily deployed to Preview – universe-sx-tailwind-website March 5, 2022 19:35 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-example-relay March 5, 2022 19:35 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-example-relay March 5, 2022 20:11 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-sx-tailwind-website March 5, 2022 20:11 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-sx-tailwind-website March 5, 2022 20:39 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-example-relay March 5, 2022 20:39 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-example-relay March 5, 2022 20:59 Inactive
@vercel vercel bot temporarily deployed to Preview – universe-sx-tailwind-website March 5, 2022 20:59 Inactive
@mrtnzlml mrtnzlml force-pushed the sx_rehydrate_styles branch 4 times, most recently from 712c4b6 to 0a79ab3 Compare April 3, 2022 20:12
@mrtnzlml mrtnzlml force-pushed the sx_rehydrate_styles branch 3 times, most recently from dcc910e to bfbd00b Compare April 16, 2022 22:56
@mrtnzlml mrtnzlml force-pushed the sx_rehydrate_styles branch 2 times, most recently from 2ba3514 to e449cb8 Compare May 11, 2022 00:27
@mrtnzlml mrtnzlml force-pushed the sx_rehydrate_styles branch 2 times, most recently from 96070ed to 52dc20e Compare June 23, 2022 21:00
I have these changes sitting locally for a very long time, and it's time
to offload them. The idea behind the styles rehydration is very simple:
we collect all existing styles from `<style data-adeira-sx />` (once)
and use this information later for deciding whether the styles should be
injected or not (this is what I call rehydration).

The difference from the current solution is that we do it only once and
we don't have to go through all the styles everytime there is something
to inject.

Motivation for this change is performance: this should significantly
improve the runtime style perf + be much easier to deal with (for
example, we are basically brute-forcing @at rules and pseudo rules now).

Note: this is just a partial solution, there are other changes coming
(custom styles printer and @at nodes/pseudo nodes optimization).

Related issue: #1579
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant