Skip to content

fix: withUniwind merge with inline#378

Merged
Brentlok merged 6 commits intomainfrom
fix/withUniwind-merge-inline
Feb 12, 2026
Merged

fix: withUniwind merge with inline#378
Brentlok merged 6 commits intomainfrom
fix/withUniwind-merge-inline

Conversation

@Brentlok
Copy link
Copy Markdown
Contributor

@Brentlok Brentlok commented Feb 12, 2026

fixes #336

Summary by CodeRabbit

  • Tests

    • Added comprehensive native and web test suites with platform-specific Jest setups and new test setup for web.
    • Introduced separate test commands for native and web: test:native and test:web for targeted runs.
    • Integrated testing-library and related tooling to improve component and HOC test coverage.
  • Chores

    • Updated development dependencies and reorganized testing-related dev tooling.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 12, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds platform-specific test infrastructure (native + web), adjusts many test import paths, introduces web Jest config and setup, updates turbo/task/test scripts, enhances withUniwind.native HOC to record dependencies earlier and merge class-derived styles with existing inline styles, and adds comprehensive tests for HOC behavior.

Changes

Cohort / File(s) Summary
Root tooling
package.json
Bump dev tools: dprint 0.50.2→0.51.1, turbo 2.7.6→2.8.7.
Turbo tasks
turbo.json
Replace test dependency with test:native and test:web; add both tasks (cache: false); update precommit dependencies.
Uniwind package.json
packages/uniwind/package.json
Replace generic test script with test:native/test:web; add multiple testing-related devDependencies (Jest, @testing-library/*, ts-jest, react-native-web, types).
Jest configs & setups
packages/uniwind/jest.config.native.js, packages/uniwind/jest.config.web.js, packages/uniwind/tests/setup.native.ts, packages/uniwind/tests/setup.web.ts
Add native config adjustments (displayName, testMatch, native setup file) and new web Jest config (jsdom, ts-jest, moduleNameMapper, CSS mock); add web setup that polyfills CSSOM and sets document theme.
HOC logic
packages/uniwind/src/hoc/withUniwind.native.tsx
Record UniwindStore.getStyles(...) dependencies earlier; when prop is non-style assign generated prop directly; when style prop and existing prop exists, preserve both by setting generated prop to [styles, existingStyle] (merge order adjusted).
Native tests — imports updated
packages/uniwind/tests/native/components/*.test.tsx, packages/uniwind/tests/native/styles-parsing/*.test.tsx, packages/uniwind/tests/native/utils.ts, packages/uniwind/tests/setup.native.ts
Adjusted many relative import paths (mostly ../../../../../ or similar) to reflect test file relocation.
Native HOC tests (added)
packages/uniwind/tests/native/hoc/withUniwind.test.tsx
Add extensive native HOC tests covering auto/manual mapping, style/color mapping, precedence and merging behaviors.
Web tests (added)
packages/uniwind/tests/web/components/view.test.tsx, packages/uniwind/tests/web/hoc/withUniwind.test.tsx
Add web tests for View rendering with className and web-specific withUniwind HOC behaviors validating DOM classes/styles and prop mapping.
Minor test import tweaks
packages/uniwind/tests/native/components/*.test.tsx (individual files)
Multiple individual test files updated to new relative import paths for components and consts.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Author as Author/Test
  participant HOC as withUniwind HOC
  participant Store as UniwindStore\n(getStyles)
  participant Wrapped as WrappedComponent

  Author->>HOC: render with props (className, style, colorClassName, manual config)
  HOC->>Store: getStyles(className or colorClassName)
  Store-->>HOC: { styles, dependencies }
  Note right of HOC: dependencies recorded early\n(acc.dependencies push ...)
  alt propName is non-style
    HOC-->>Wrapped: propName = styles
  else propName is style and existing prop present
    HOC-->>Wrapped: propName = [styles, existingStyle]
  else propName is style and no existing prop
    HOC-->>Wrapped: propName = styles
  end
  Wrapped-->>Author: rendered output / DOM / RN view
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 I hopped through configs, tests, and code,
Split paths for web and native road,
I stitched styles early, kept old ones near,
Now class and inline both appear—hip hop hooray! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: withUniwind merge with inline' directly addresses the main change: fixes merging of withUniwind HOC styles with inline styles. This is the primary modification evident across multiple test files and the HOC implementation itself.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/withUniwind-merge-inline

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Brentlok Brentlok merged commit 633a67d into main Feb 12, 2026
1 of 2 checks passed
@Brentlok Brentlok deleted the fix/withUniwind-merge-inline branch February 12, 2026 08:52
@coderabbitai coderabbitai bot mentioned this pull request Feb 20, 2026
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.

withUniwind: Custom mapping overrides default className and style merging

1 participant