Unify CSS-to-RN compiler and runtime pipeline#5
Draft
cray0000 wants to merge 22 commits into
Draft
Conversation
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.
Summary
This PR unifies the CSS-to-React-Native style pipeline into a new
@cssxjs/css-to-rnworkspace package and wires CSSX, loaders, Babel output, and runtime entrypoints through it. The goal is to replace the separate forked CSS-to-RN transform libraries and the old CSSX runtime with one maintainable compiler/runtime package.Key changes:
packages/css-to-rn, a TypeScript ESM package owning CSS parsing, selector IR, value resolution, property transforms, style resolution, caching, and React runtime tracking.css/styltemplates, with interpolation values reusing one cache slot per compiled call shape.useCompiledCss(),useCssxLayer(), andcssx().var()resolution, partial shorthand substitution, dynamic dependency tracking, bounded cache behavior, deep inline-style hashing, media/dimension tracking, webmatchMediainvalidation, and React NativeDimensionsintegration.useSyncExternalStoretracking without Teamplay or@nx-js/observer-util, including Suspense/aborted-render cleanup tests.:hover/:activealiases,filter,background-image/gradient support, limitedbackgroundshorthand, animations/transitions/keyframes, and Reanimated v4-compatible animation style output.distoutput; package builds still emitdistfor published/default exports.runtime/*-teamplayimport paths as compatibility wrappers only.packages/runtimepackage from the active graph.architecture.md,AGENTS.md,plan.md, public docs, README credits, and CI smoke checks for the new architecture.Validation
cd packages/css-to-rn && npm testcd packages/css-to-rn && npm run buildnode -C cssx-tsCI=true yarn testyarn docs-buildgit diff --checkReview Focus
This is a large architectural PR. Please scrutinize:
matchMediasubscriptions, React Native dimensions, and listener cleanup.var(), shorthand fragments, gradients/backgrounds, transforms, animations, transitions, and invalid generated CSS.styleName,css,styl, and part workflows.