Skip to content

feat: add support for frameworks :static in RN 0.80 #865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 16, 2025

Conversation

jpudysz
Copy link
Owner

@jpudysz jpudysz commented Jun 16, 2025

Summary

Fixes #860

Brings back support for static frameworks and React Native 0.78.

Summary by CodeRabbit

  • Chores
    • Updated project dependencies to use stable React Native 0.80.0 and related packages.
    • Improved iOS project configuration for better compatibility with dynamic frameworks and updated header search paths.
    • Enhanced dependency management to conditionally include certain React Native inspector modules based on the installed version.

Copy link

vercel bot commented Jun 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-unistyles-2.0 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 10:43am
react-native-unistyles-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 10:43am

Copy link

coderabbitai bot commented Jun 16, 2025

Warning

Rate limit exceeded

@jpudysz has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between ea0cab0 and 4496193.

📒 Files selected for processing (5)
  • README.md (1 hunks)
  • Unistyles.podspec (2 hunks)
  • docs/src/content/docs/v3/start/getting-started.mdx (1 hunks)
  • example/ios/example.xcodeproj/project.pbxproj (6 hunks)
  • rn_version.rb (1 hunks)

Walkthrough

The changes introduce dynamic detection of the React Native version in the podspec using a new Ruby helper, enabling conditional addition of iOS dependencies based on the detected version. The example project’s Xcode configuration is updated for framework usage, and dependencies in the example’s package.json are updated to stable React Native 0.80.0 versions.

Changes

Files / Grouped Files Change Summary
Unistyles.podspec, rn_version.rb Podspec now dynamically detects React Native version via a new Ruby helper; conditional iOS dependencies updated.
example/ios/example.xcodeproj/project.pbxproj Xcode project updated to use dynamic framework references and new header search paths for React Native frameworks.
example/package.json React Native and related package versions updated from 0.80.0-rc.4 to 0.80.0 (stable).

Assessment against linked issues

Objective Addressed Explanation
Fix build failure with React Native 0.80+ and static frameworks on iOS (#860)
Ensure correct conditional dependencies for RN 0.79 and 0.80+ in podspec (#860)
Update example project to support RN 0.80+ and framework-based builds (#860)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Possibly related PRs

  • jpudysz/react-native-unistyles#745: Adds support for React Native 0.79; this PR builds on that by adding dynamic version handling for 0.79 and 0.80+.
  • jpudysz/react-native-unistyles#757: Introduces conditional "React-jsinspectortracing" dependency; this PR extends that logic and adds further conditional dependencies for newer RN versions.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Commit Unit Tests in branch feature/static-framework
  • Post Copyable Unit Tests in Comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
rn_version.rb (2)

3-6: Avoid mutating the input argument; use a default value instead

Re-assigning rn_path when it is nil mutates the caller-supplied reference.
Prefer a default parameter or a local variable to preserve intent and avoid side-effects.

-def get_rn_version(rn_path)
-    rn_path = rn_path || '../node_modules/react-native'
+def get_rn_version(rn_path = '../node_modules/react-native')

9-16: Simplify path selection and drop the redundant else branch

if/elsif/else … nil triggers RuboCop’s Style/EmptyElse.
A more idiomatic Ruby expression is:

-    rn_pkg_json =
-        if File.exist?(maybe_rn_pkg_json)
-            maybe_rn_pkg_json
-        elsif File.exist?(maybe_local_rn_pkg_json)
-            maybe_local_rn_pkg_json
-        else
-            nil
-        end
+    rn_pkg_json = [maybe_rn_pkg_json, maybe_local_rn_pkg_json].find { |p| File.exist?(p) }

This removes the empty else, shortens the code, and makes the intent clearer.

example/package.json (1)

12-13: Version bump looks good – double-check Metro cache after upgrading

Nothing to fix in code, but remember to clear the Metro cache (watchman watch-del-all && npm start -- --reset-cache) when moving from 0.80.0-rc.* to the stable tag to avoid hard-to-trace bundle issues.

Unistyles.podspec (1)

36-42: Minor-only comparison may mis-detect future major releases

The helper returns only the minor segment (80 for 0.80.0).
If React Native ever releases 1.0.0, rn_version would be 0, causing your ≥ 79 / ≥ 80 guards to fail. Consider comparing full semantic versions (e.g. with Gem::Version) or at least returning major * 100 + minor.

This aligns with the parsing fix suggested for rn_version.rb.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c14f25a and 25d378b.

⛔ Files ignored due to path filters (2)
  • example/ios/Podfile.lock is excluded by !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (4)
  • Unistyles.podspec (2 hunks)
  • example/ios/example.xcodeproj/project.pbxproj (6 hunks)
  • example/package.json (2 hunks)
  • rn_version.rb (1 hunks)
🧰 Additional context used
🪛 RuboCop (1.75.5)
rn_version.rb

[convention] 14-14: Redundant else-clause.

(Style/EmptyElse)


[convention] 25-25: Redundant assignment before returning detected.

(Style/RedundantAssignment)

🔇 Additional comments (1)
example/ios/example.xcodeproj/project.pbxproj (1)

55-59: Ensure Pods_example.framework is embedded correctly for App Store builds

The new dynamic framework is added to Frameworks, but verify that the “[CP] Embed Pods Frameworks” phase actually embeds Pods_example.framework; otherwise TestFlight / App Store uploads may fail with missing framework errors.

No code change required if the script list is auto-generated, but worth validating.

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.

RN 0.80 build failure with static frameworks
1 participant