Skip to content

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

Merged
danstepanov merged 1 commit into
nativewind:mainfrom
YevheniiKotyrlo:refactor/property-names
Dec 4, 2026
Merged

danstepanov merged 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.

@sammoore sammoore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will revisit selectors usage around the codebase... LGTM if CI passes.

…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.
@danstepanov
danstepanov force-pushed the refactor/property-names branch from 99dc762 to edbf1f3 Compare December 4, 2026 03:13
@danstepanov
danstepanov merged commit aba7f8c into nativewind:main Dec 4, 2026
6 checks passed
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.

3 participants