Skip to content

refactor(compiler): delete the unused selectors module and give toRNProperty one home - #491

Open
YevheniiKotyrlo wants to merge 1 commit into
nativewind:mainfrom
YevheniiKotyrlo:refactor/property-names
Open

YevheniiKotyrlo wants to merge 1 commit into
nativewind:mainfrom
YevheniiKotyrlo:refactor/property-names

Conversation

@YevheniiKotyrlo

@YevheniiKotyrlo YevheniiKotyrlo commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

src/compiler/selectors.ts is 505 lines whose getSelectors nothing imports: the compiler builds selectors in selector-builder.ts. The module stayed alive only through its toRNProperty, which atRules.ts and declarations.ts import, while selector-builder.ts and stylesheet.ts use a second copy in selector-builder.ts. The two copies have already drifted (x[1]! in one, x[1]?.toUpperCase() ?? "" in the other).

Solution

selectors.ts is deleted, and toRNProperty moves to src/utilities/property-names.ts, which every caller imports through ../utilities. No behaviour changes.

Tests

None added: nothing changes what the compiler does, and the existing suites cover every caller of toRNProperty.

Verification

On Ubuntu with the workflow's steps - build, lint, typecheck, yarn test, node --test node/__tests__/*.mjs, both library builds, the web export, the unstaged-changes checks and commitlint - everything passes.

Not run: the iOS and Android example builds.

Merge order

It shares lines with #389 (compiler/declarations.ts, utilities/index.ts), #391 (compiler/declarations.ts, utilities/index.ts), #411 (compiler/stylesheet.ts), #413 (compiler/declarations.ts), #417 (compiler/declarations.ts), #420 (compiler/declarations.ts, utilities/index.ts), #447 (compiler/selector-builder.ts), #448 (compiler/selector-builder.ts), #449 (compiler/selector-builder.ts), #459 (compiler/selector-builder.ts), #492 (compiler/declarations.ts, utilities/index.ts), #494 (compiler/declarations.ts, utilities/index.ts), #495 (compiler/declarations.ts, utilities/index.ts); whichever lands second rebases.

…roperty one home

src/compiler/selectors.ts's getSelectors is imported by nothing; the
compiler builds selectors in selector-builder.ts. The module stayed
alive only through its toRNProperty, which atRules.ts and
declarations.ts imported while selector-builder.ts and stylesheet.ts
used a second copy. toRNProperty moves to utilities/property-names.ts
and every caller imports it from there.

This branch has not been deployed

No deployments
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.

1 participant