class: convert to string in the optimizer #330
wmertens
started this conversation in
Proposals For Qwik
Replies: 1 comment 2 replies
-
|
Or simpler solution is we deprecate the object form 🤪 And explain people that it has runtime overhead for no clear gains. FWIW it's what they did in twMerge dcastil/tailwind-merge#137 (comment). |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What is it about?
minimize runtime work for the class attribute
What's the motivation for this proposal?
Problems you are trying to solve:
class={{[styles.foo]: condition}}is nice to write but it has runtime overheadGoals you are trying to achieve:
Proposed Solution / Feature
What do you propose?
the optimizer should:
{[styles.foo]: condition} => [condition && styles.foo]arrays['meep', condition && styles.foo, 'bar'] => ['meep bar', condition && styles.foo]Links / References
No response
Beta Was this translation helpful? Give feedback.
All reactions