{"id":19571677,"url":"https://github.com/yued-fe/ynative","last_synced_at":"2025-04-27T03:32:34.035Z","repository":{"id":71981829,"uuid":"92239819","full_name":"yued-fe/Ynative","owner":"yued-fe","description":"A native shell has both hybrid and react-native ability.","archived":false,"fork":false,"pushed_at":"2018-08-08T09:07:48.000Z","size":21541,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-04T20:51:18.593Z","etag":null,"topics":["android","hybrid","ios","javascript","react-native"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yued-fe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-05-24T02:12:15.000Z","updated_at":"2022-05-17T09:02:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"42e45477-2fcd-49ac-a783-ab1a3ca1eb06","html_url":"https://github.com/yued-fe/Ynative","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yued-fe%2FYnative","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yued-fe%2FYnative/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yued-fe%2FYnative/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yued-fe%2FYnative/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yued-fe","download_url":"https://codeload.github.com/yued-fe/Ynative/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251085145,"owners_count":21533821,"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":["android","hybrid","ios","javascript","react-native"],"created_at":"2024-11-11T06:19:44.738Z","updated_at":"2025-04-27T03:32:34.030Z","avatar_url":"https://github.com/yued-fe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ynative\n## 简介\nYnative是一个原生壳子，希望实现原生代码和RN、Hybrid的混合开发。\n## 如何运行\n\n1、[React-Native开发环境搭建](https://facebook.github.io/react-native/docs/getting-started.html)\n\n2、clone Ynative\n\n3、cd Ynative \u0026\u0026 cd IOS || Android \u0026\u0026 npm install\n\n4、run\n\n### debug模式\n在项目根目录(IOS或Android文件夹下)执行\n```\nnpm start\n```\n#### IOS\n两种运行方式：\n- 在根目录执行react-native run-ios\n- 或者使用Xcode来编译运行\n#### Android\n两种运行方式：\n- 打开模拟器，在根目录执行./gradlew installDebug\n- 或者使用Android Studio来编译运行\n\n### 离线模式\n#### IOS\n打包(如果bundle目录不存在，需要提前创建一个)\n```\nreact-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ios/bundle/index.ios.jsbundle --assets-dest ios/bundle\n```\n将 assets 和 index.ios.jsbundle 引入工程\n\u003e注意: assets 目录导入工程中时，要选择 Create folder references，因为这是图片素材(直接将bundle下的assert和index.ios.jsbundle拖入项目，会弹出选项)。\n\n修改AppDelegate中的代码\n```\nNSURL *jsCodeLocation;\njsCodeLocation = [NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@\"index.ios.jsbundle\" ofType:nil]];\nRCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation\n                                                    moduleName:@\"RNBundleDemo\"\n                                             initialProperties:nil\n                                                 launchOptions:launchOptions];\n```\n两种运行方式：\n- 在根目录执行react-native run-ios\n- 或者使用Xcode来编译运行\n#### Android\n打包(如果assets目录不存在，需要提前创建一个)\n```\nreact-native unbundle --platform android --dev false --entry-file index.android.js --bundle-output app/src/main/assets/index.android.bundle --assets-dest app/src/main/res/\n```\n两种运行方式：\n- 打开模拟器，在根目录执行./gradlew installDebug\n- 或者使用Android Studio来编译运行\n\n## RN目标能力\n- [x] React-Native开发环境搭建\n- [x] RN嵌入到现有Android原生应用\n- [x] RN嵌入到现有IOS原生应用\n- [x] RN调用Android原生应用方法\n- [x] RN调用IOS原生应用方法\n- [x] RN页面与Android原生页面互相跳转\n- [x] RN页面与IOS原生页面互相跳转\n- [x] RN热更新的实现(Android)\n- [ ] RN热更新的实现(IOS)\n- [x] RN bundle优化(Android使用Unbundle)\n- [ ] RN bundle优化(IOS使用prepack)\n- [ ] RN打包工具制作\n- [x] RN差量更新\n- [x] RN白屏优化(Android)\n- [x] RN白屏优化()\n- [ ] RN组件的扩展（UI、API）\n- [x] RN状态管理的优化（Redux）\n- [ ] RN布局的优化（ListView的优化）\n## Hybrid目标能力\n- [ ] 原生应用加入WebView支持\n- [ ] WebView开启支持JavaScript\n- [ ] JSSDK建设\n- [ ] Hybrid的热更新\n## 项目布局\n\n```\n.\n├── IOS                                          // 详细见目录内的README\n├── Android                                      // 详细见目录内的README\n├── ScreenShot                                   // 用于存放项目截图、MD文档图片\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyued-fe%2Fynative","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyued-fe%2Fynative","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyued-fe%2Fynative/lists"}