feat: Proof of concept non-component-based css prop. #84
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a spike related to https://dev.to/srmagura/why-were-breaking-up-wiht-css-in-js-4g9b and specifically re "can we get rid of the wrapping
EmotionCssPropInternal
components" that currently are required anytime acss=
prop is used.See reactwg/react-18#110 but it would be great if React had a non-hook way of subscribing to
useInsertionEffect
events, likedocument.addEventElement('insertionEffect", () => ...)
.Misc ideas:
FelaComponent
, to see perf vs. emotionrenderer
directly inline in__jsxDEV
(noFelaComponent
) and 🤷 if the performance of "not usinguseInsertionEffect
really mattersstyle
s would be injected ~randomly after each render and not necessarily at "safe insertion points", which would cause more DOM/CSS recalcs per the React-18 linkinsertionEffect
event/hookstyle
attribute, and skip class names all together (recommended in the react-18 doc as what FB does, but technically only for dynamic styles)FelaComponent
, otherwise use the existing/injected classes directly onclassName
(noFelaComponent
)