{"id":15594203,"url":"https://github.com/orta/cocoapods-fix-react-native","last_synced_at":"2025-05-16T15:04:23.969Z","repository":{"id":55527803,"uuid":"127639261","full_name":"orta/cocoapods-fix-react-native","owner":"orta","description":"A CocoaPods plugin for hot-patching React Native per-version","archived":false,"fork":false,"pushed_at":"2023-12-17T15:04:59.000Z","size":85,"stargazers_count":244,"open_issues_count":0,"forks_count":25,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-12T12:54:45.561Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-01T14:58:51.000Z","updated_at":"2025-02-06T06:20:51.000Z","dependencies_parsed_at":"2024-06-19T00:16:53.361Z","dependency_job_id":"bb56769f-5146-435a-8b79-f46a89a70df2","html_url":"https://github.com/orta/cocoapods-fix-react-native","commit_stats":{"total_commits":71,"total_committers":17,"mean_commits":4.176470588235294,"dds":0.7464788732394366,"last_synced_commit":"284d3b9bbb7eb1cd639a7c51fbfbc6c3d7266a6a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fcocoapods-fix-react-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fcocoapods-fix-react-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fcocoapods-fix-react-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orta%2Fcocoapods-fix-react-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orta","download_url":"https://codeload.github.com/orta/cocoapods-fix-react-native/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254063982,"owners_count":22008475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T00:34:45.011Z","updated_at":"2025-05-16T15:04:23.917Z","avatar_url":"https://github.com/orta.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hi there! This a CocoaPods plugin that **we, the community**, can use to plug\nthe holes in React Native's CocoaPods support.\n\nCocoaPods allows you to add code to run before and at the end of the Podfile via\ninstallation hooks. You probably already have some custom code in there. This\nplugin allows all that code to be centralized and reasoned about in a single\nplace per React Native version.\n\n## Why Does This Need To Exist?\n\nReact Native is a pragmatic project, it's great Facebook open sources it, but if\nyou want to work with a flow they don't use - the onus is on you to make sure it\ncontinues to work. Facebook have a big mono-repo, and so they don't need to use\nCocoaPods, and they also use static compilation because they don't use Swift.\nMeaning if you want to use CocoaPods and Swift, you're pretty far from their\nworkflow.\n\nIn order to get it working for just your app you scour, like, a million issues\non React Native (or go look at [artsy/eigen][eigen]) to get it compiling on your\nsetup. Again, not optimal.\n\nThis plugin _tries_ to fix this by centralizing the code needed to modify React\nNative. This means makes it easy to update your versions of React Native,\nbecause you can update the gem at the same time.\n\n## Installation\n\nLazy way (bad, but ok if 1 engineer):\n\n    $ gem install cocoapods-fix-react-native\n\nCorrect way, edit\n[`your Gemfile`](http://www.mokacoding.com/blog/ruby-for-ios-developers-bundler/)\nto be:\n\n    gem \"cocoapods\"\n    gem \"cocoapods-fix-react-native\"\n\nThen remove any React Native related `pre_install` and `post_install` code, and\nadd this to the top level of your `Podfile`:\n\n    plugin 'cocoapods-fix-react-native'\n\nFor the first time you do this, I'd recommend running `rm -rf Pods; bundle exec\npod install`. After that you can `bundle exec pod install` like normal.\n\n## How do I Update This?\n\n    bundle update cocoapods-fix-react-native\n\nThis project is auto-deployed after every merged PR, so it's should always be\nup-to-date.\n\n## How Does This Work?\n\nA CocoaPods plugin can register hooks before and after installation, just like\nyou can in your `Podfile`. This hook will first look at what version of React\nNative is installed, and will then run a corresponding scripts to make changes\nto the environment.\n\n## Custom React Native Root Directory\n\nTo set a custom React Native root directory for dev an environment variable `COCOAPODS_FIX_REACT_NATIVE_DEV_ROOT` may be set.  Example:\n\n    # Some shell script that sets up environment variables\n    export COCOAPODS_FIX_REACT_NATIVE_DEV_ROOT=\"../my_react_project_directory/node_modules/react-native\"\n\n## Contributing Back\n\nYou'll note that this repo has issues disabled, I'm not going to make the time\nto support questions and requests for fixes to this. I have a lot of projects,\nand only so much time. However, I'm happy to handle the mainainance and upkeep\nfrom code people submit. If you want a change, you'll need to do so yourself, so\nlet's cover how you do that:\n\nThis project is very specific about what versions of React Native it supports,\nyou can see them in the folder\n[`lib/cocoapods-fix-react-native/versions/`][versions]:\n\n```\n~/dev/projects/react-native/cocoapods-fix-react-native master*\n❯ tree lib/cocoapods-fix-react-native/versions/\nlib/cocoapods-fix-react-native/versions/\n└── 0_54_4-post.rb\n```\n\nThere's likely more than just one by the time you read this, but if you want to\nuse a version that isn't supported yet, then you're going to want to copy the\nmost recent into a new file. The files are named by converting dots to\nunderscores. E.g. `0.54.4` -\u003e `0_54_4-pre.rb`/`0_54_4-post.rb`.\n\nThe scripts itself should be entirely self contained, so that it's easy to\nunderstand without learning the project.\n\nThe biggest change you'd need to make from the sort of code you can find inside\nthe issues is that it needs to support many different potential roots. So\ninstead of just `Pods/React/*` - this plugin will also handle\n`node_modules/react-native/*` and `../node_modules/react-native/*`. Basically,\nyour dev repo, and your prod app.\n\nThis can be done by removing `'Pods/React'` from the path and wrapping it with a\n`File.join($root, 'Path/InReactLib.js')`. You'll see this in the current\nscripts.\n\n### Getting Setup To Improve\n\nClone this repo:\n\n```\ngit clone https://github.com/orta/cocoapods-fix-react-native\ncd cocoapods-fix-react-native\nbundle install\n```\n\nYou want to use a `:path` based gem in your project's Gemfile to point to the\ncloned repo. Make you to your App's `Gemfile` something like this:\n\n```ruby\ngem 'cocoapods', '~\u003e 1.4.0'\ngem 'cocoapods-fix-react-native', path: \"../../../../react-native/cocoapods-fix-react-native\"\n```\n\nThen when you run `bundle exec pod install` in that project, it will use the the\ncode from your cloned copy.\n\nAs `use_frameworks!` is more strict than static libraries, I'd recommend working\non this project using a repo that has frameworks.\n\n[eigen]: https://github.com/artsy/eigen/\n[versions]: https://github.com/orta/cocoapods-fix-react-native/tree/master/lib/cocoapods-fix-react-native/versions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forta%2Fcocoapods-fix-react-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forta%2Fcocoapods-fix-react-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forta%2Fcocoapods-fix-react-native/lists"}