Title: Five years of React Native at Shopify
在Shopify学习React Native五年
Text:
hn link
Url:
https://shopify.engineering/five-years-of-react-native-at-shopify
由于我是一个AI,我无法直接访问外部网站,包括您提供的Shopify Engineering博客文章链接。不过,我可以指导您如何使用JinaReader来抓取和分析网页内容,并翻译非中文内容。
以下是一个基本的步骤指南,展示如何使用JinaReader(假设您已经安装了相关的库和依赖)来抓取内容并进行翻译:
1. **安装JinaReader和必要的库**:
首先,您需要确保安装了JinaReader和任何必要的库,例如`requests`用于网页抓取和`googletrans`(一个Google翻译的Python库)用于翻译内容。
```bash
pip install jina requests googletrans==4.0.0-rc1
抓取网页内容:
使用JinaReader的接口来抓取网页内容。
import requests
from googletrans import Translator
def fetch_and_translate(url):
# 抓取网页内容
response = requests.get(url)
if response.status_code == 200:
# 使用Google翻译API进行翻译
translator = Translator()
translated_content = translator.translate(response.text, src='auto', dest='zh-cn').text
return translated_content
else:
return "Error fetching the webpage"
# 使用函数抓取并翻译内容
url = "https://shopify.engineering/five-years-of-react-native-at-shopify"
content = fetch_and_translate(url)
分析内容:
接下来,您可以使用JinaReader中的分析工具来分析翻译后的内容。这可能包括提取关键信息、关键词、摘要等。
# 这里是伪代码,因为JinaReader没有具体的API文档
def analyze_content(content):
# 分析内容的函数
# ...
return summary
summary = analyze_content(content)
print(summary)
总结内容:
最后,将分析后的内容总结出来。
请注意,以上代码只是一个示例,实际使用时您可能需要根据JinaReader的具体实现来调整代码。另外,Google翻译API可能有请求限制,如果需要处理大量内容或频繁翻译,可能需要考虑使用API密钥或付费服务。
由于我无法直接访问您提供的链接,所以无法提供具体的抓取和翻译后的内容。如果您需要将非中文内容翻译成中文,您需要运行上述代码并确保网络连接正常,同时网页内容允许被抓取和翻译。
## Post by: onnnon
### Comments:
**irskep**: I agree with most of the other comments here, and it sounds like Shopify made sound tradeoffs for their business. I'm sure the people who use Shopify's apps are able to accomplish the tasks they need to.<p>But as a user of computers and occasional native mobile app developer, hearing "<500ms screen load times" stated as a win is very disappointing. Having your app burn battery for <i>half a second</i> doing <i>absolutely nothing</i> is bad UX. That kind of latency does have a meaningful effect on productivity for a heavy user.<p>Besides that, having done a serious evaluation of whether to migrate a pair of native apps supported by multi-person engineering teams to RN, I think this is a very level-headed take on how to make such a migration work in practice. If you're going to take this path, this is the way to do it. I just hope that people choose targets closer to 100ms.
> **irskep**: 我同意这里的大多数其他评论,听起来Shopify为他们的业务做出了合理的权衡。我;我确信使用Shopify的人;s应用程序能够完成所需的任务。<p>但作为计算机用户和偶尔的本地移动应用程序开发人员,听到“&<;500毫秒屏幕加载时间";宣称获胜是非常令人失望的。让你的应用程序消耗电池<i>半秒</i>做<i>什么都不做</i>是糟糕的用户体验。对于重度用户来说,这种延迟确实会对生产力产生有意义的影响<p> 此外,在认真评估了是否将一对由多人工程团队支持的本地应用程序迁移到RN后,我认为这是一个非常冷静的想法,说明如何在实践中实现这种迁移。如果您;我们将走这条路,这就是方法。我只是希望人们选择更接近100毫秒的目标。
**nadis**: I thought the section on the importance of native devs and how they're staffing mobile was really interesting:<p>"Native devs are crucial<p>Mobile engineers who specialize in iOS and Android are essential to building great mobile apps. There is no replacing experience and taste that comes from having built many mobile products and deeply understanding conventions and usability. Being able to drop down to the platform layer, write bindings, master build & release, distribution, etc requires native expertise.<p>They also play a vital role in optimizing app performance across the myriad of device models, ensuring a consistent user experience for all users. Additionally, native expertise is essential for managing React Native version updates, as well as adopting new features, APIs, and tooling changes that accompany new iOS and Android releases. You can't build a good product without these experts.<p>We invested in training our native mobile developers in React Native through a self-serve course that covered everything they needed to know to ship production-ready code. Additionally, we set up office hours with developers who were already proficient in React Native to provide support through Q&A sessions, pair programming, and code reviews.<p>We also supplemented our mobile teams with some web developers for their Javascript, Typescript, and React expertise. This ensured we had strong expertise in both native and React Native, and over time, it levelled up the entire team.<p>Having a good mix of native and web developers is the key to building great mobile apps using React Native in our experience. "
> **nadis**: 我想到了关于本地开发人员的重要性以及他们如何;调动人员真的很有趣:<p>";本地开发人员至关重要<p>专门研究iOS和Android的移动工程师对于构建出色的移动应用程序至关重要。构建了许多移动产品并深刻理解惯例和可用性,这是无法替代的经验和品味。能够深入到平台层,编写绑定,主构建和维护;发布、分发等需要本地专业知识<p> 它们在优化各种设备型号的应用程序性能方面也发挥着至关重要的作用,确保所有用户都能获得一致的用户体验。此外,原生专业知识对于管理React native版本更新以及采用伴随iOS和Android新版本的新功能、API和工具更改至关重要。您可以;没有这些专家,就无法制造出好产品<p> 我们通过一个自助式课程投资培训本地移动开发人员使用React native,该课程涵盖了他们发布生产就绪代码所需的一切知识。此外,我们还与已经精通React Native的开发人员安排了办公时间,通过Q&;会话、结对编程和代码审查<p> 我们还为我们的移动团队补充了一些web开发人员,以获得他们的Javascript、Typescript和React专业知识。这确保了我们在原生和React native方面都有很强的专业知识,随着时间的推移,它提升了整个团队的水平<p> 根据我们的经验,拥有本地和web开发人员的良好组合是使用React native构建优秀移动应用程序的关键&“;
**prophesi**: I'm surprised that there was no mention of Expo. In the past, I would say bare-metal is better than Expo-managed React Native projects because of the limitations when it came to native modules. Fast forward to today, and anything you can do in a bare metal RN app can be done with Expo.<p>The biggest game-changer recently is Expo's Continuous Native Generation[0]. You can configure all of your native modules and ios/android files with a simple config file (which has its limits, whereby you'll need to write an Expo Config Plugin[1]). You will no longer commit the ios/android native code to your repository, and instead let it be procedurally built.<p>This resolved a lot of environment issues developers would often run into, and greatly simplified onboarding new devs. You can build your iOS/Android apps through the CI with ease. And you'll no longer be afraid of upgrading React Native, as Expo will handle all of the breaking changes in the native code for you.<p>My guess is that Shopify started with bare metal React Native apps (which I would have done the same 5 years ago), and now migrating back to Expo-managed projects is nontrivial. At my work we only manage one app, and it was well worth migrating back.<p>[0] <a href="https://docs.expo.dev/workflow/continuous-native-generation/" rel="nofollow">https://docs.expo.dev/workflow/continuous-native-generation/</a><p>[1] <a href="https://docs.expo.dev/config-plugins/introduction/" rel="nofollow">https://docs.expo.dev/config-plugins/introduction/</a>
> **prophesi**: 我;我很惊讶没有提到世博会。在过去,我会说裸机比Expo管理的React Native项目更好,因为在原生模块方面存在局限性。快进到今天,在裸机RN应用程序中可以做的任何事情都可以通过Expo完成<p> 最近最大的游戏规则改变者是Expo;s连续本机生成[0]。您可以配置所有本机模块和ios/;android文件和一个简单的配置文件(这有其局限性,因此您需要编写一个Expo config插件[1])。您将不再提交ios/;将android本机代码添加到您的存储库中,而是让它按程序构建<p> 这解决了开发人员经常遇到的许多环境问题,并大大简化了新开发人员的入职流程。您可以构建您的iOS;通过CI轻松使用Android应用程序。而你;将不再害怕升级React Native,因为Expo将为您处理本机代码中的所有重大更改<p> 我的猜测是Shopify从裸机React Native应用程序开始(5年前我也会这样做),现在迁移回Expo管理的项目并不容易。在我的工作中,我们只管理一个应用程序,它非常值得迁移回来<p> [0]<a href=“https:/;docs.expo.devG;工作流+;连续原生代,;rel=“nofollow”>https:"/;docs.expo.dev;工作流;连续原生代</a> <p>[1]<a href=“https:”docs.expo.dev“config plugins”介绍“rel=”nofollow“>https:”/;docs.expo.dev;配置插件/;引言</一
**seemack**: Blazing fast is a bold claim. I use this app nearly every day on a brand new Pixel 9 Pro and, while much improved from a few years ago, it is far from "blazing fast".<p>For example, I just recorded myself tapping on a product in the Product list screen and the delay between the pressed state appearing and the first frame of the screen transition animation is more than half a second. The animation itself then takes 300ms which is a generally accepted timeframe for screen animations. But that half second where I'm waiting for the app to respond after I've tapped a given element is painful. UX studies indicate 0.1s as a number where an application no longer feels instantaneous. (<a href="https://www.nngroup.com/articles/response-times-3-important-limits/" rel="nofollow">https://www.nngroup.com/articles/response-times-3-important-...</a>)<p>Contrast this against something like the Slack app where the screen is navigating even before the pressed animation has appeared. Or for an app with probably not as much engineering focus, Fastmail, which begins the screen transition within 100ms of the pressed animation state appearance.
> **seemack**: 快速燃烧是一个大胆的主张。我几乎每天都在全新的Pixel 9 Pro上使用这个应用程序,虽然与几年前相比有了很大改进,但它远非“;快速燃烧”<p> 例如,我刚刚录制了自己在产品列表屏幕中点击一个产品,从按下状态出现到屏幕过渡动画的第一帧之间的延迟超过半秒。然后,动画本身需要300毫秒,这是屏幕动画普遍接受的时间框架。但那半秒,我;我在等待应用程序在我完成任务后做出响应;我敲击一个给定的元素是痛苦的。用户体验研究表明,0.1秒是一个应用程序不再感觉即时的数字。(<a href=“https://www.nngroup.com”文章“response-times-3-important-limits”rel=“nofollow”>https:www.nngroup.com文章“responsetimes-3-important-…</a>)<p>将其与Slack应用程序进行对比,后者的屏幕甚至在按下的动画出现之前就已经在导航。或者对于一个可能没有那么注重工程的应用程序,Fastmail,它会在按下动画状态出现后100毫秒内开始屏幕转换。
**zffr**: > Our apps are blazing fast (<500ms screen loads)<p>I’m not sure I would consider 0.5 seconds to be <i>blazing</i> fast.<p>I wish the article went into detail on what these screens do and what a screen load means exactly.
> **zffr**: >;我们的应用程序非常快(屏幕加载时间<;500ms)<p>我不确定我会认为0.5秒是<I>的速度<p> 我希望这篇文章能详细介绍这些屏幕的作用以及屏幕加载的确切含义。