Debug label carrier on the CSS.styles, not className - #594
Open
davesnx wants to merge 5 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[%styled.<tag>] (static and dynamic) passed the binding label to Css_file.push unconditionally, bypassing the minify gate that [%css] uses. In production the label suffix forked identical declarations into per-binding atoms (css-k008qs-Card vs css-k008qs) and broke cross-binding dedup in the extracted stylesheet.
- queryOrder/queryOrderReversed: same color atom under @media, @container and @supports, declared in both orders - linkFirst/nthFirst: a:link vs a:nth-child(odd) equal-specificity ties - build the demo with --minify so class names carry no label suffix Documents the findings and the deterministic-buckets proposal in documents/atomic-css-ordering.md.
…ples The styles carrier grows a third slot: (className, vars, label), with CSS.label to read it back. The label is the let-binding or module name the styles came from — dev-only metadata for debugging/tooling (e.g. a future data-label attribute). - Runtime (melange + native): styles is now a 3-tuple; CSS.label and CSS.make_labeled added; merge joins labels. make deliberately keeps no optional argument so production call sites stay byte-identical (melange saturates optionals with undefined). - PPX: dev mode emits CSS.make_labeled(label, ...); minify/production emits plain CSS.make with zero label bytes. Generated component code reads the carrier through CSS.className/CSS.styles. - The styles= JSX expansion is now owned by styled-ppx (Styles_prop.ml, ported from server-reason-react's styles-attribute) and emits accessor calls instead of fst/snd, so the carrier representation stays internal to the runtime. - Requires server-reason-react's styles-attribute to emit accessors too (its ~preprocess_impl runs before us on native); patched on the local pin, branch styles-attribute-accessors, to be upstreamed. - Runtime tests migrated to accessors + CSS.label coverage; snapshot churn promoted; docs updated (runtime.mdx, atomic-css-ordering.md).
davesnx
force-pushed
the
styles-label-carrier
branch
from
July 22, 2026 21:47
031d3b9 to
7760a1e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.