简体   繁体   English

React Native 使用 master 上的最新提交作为依赖项

[英]React native use latest commit on master for a dependency

I want this fix for react-native-art/art crashing on (void)setShadow:(ARTShadow)shadow .我想要修复react-native-art/art(void)setShadow:(ARTShadow)shadow上崩溃的问题。 But there has been no public release after v1.2.0 to include this fix.但是在v1.2.0之后没有公开发布包含此修复程序。 I have confirmed the fix works by manually adding the diff.我已经通过手动添加差异来确认修复工作。 But this is not a long-term solution.但这不是一个长期的解决方案。 Does react-native support defining dependencies via branch and commit instead of version tags? react-native是否支持通过分支和提交而不是版本标签来定义依赖关系?

Currently, the dependency is defined like this:目前,依赖是这样定义的:

{
...
"dependencies": {
    ...
    "@react-native-community/art": "1.2.0",
    ...
}
...
}

It's not really related to react-native , but to how npm dependencies get installed.它与react-native没有真正的关系,而是与npm依赖项的安装方式有关。

Using git URLs is supported so you can point dependencies to any repo, and if necessary to specific branches or even specific commits.支持使用git URL,因此您可以将依赖项指向任何存储库,如有必要,还可以指向特定分支甚至特定提交。

If you want to get whatever's on master you can set your dependency like so:如果你想获得 master 上的任何东西,你可以像这样设置你的依赖:

"@react-native-community/art": "git+https://github.com/react-native-art/art.git"

You can see the full npm documentation regarding Github URLs here .您可以在此处查看有关 Github URL 的完整npm文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM