话题框架与类库 › React

框架与类库:React

React开发的设计模式及原则

本文介绍了在React社区里出现过的一些设计模式,以及它们所遵循的设计原则。

Migrating our Largest Mobile App to React Native

In 2020, we announced that React Native is the future of mobile at Shopify and since then we’ve been migrating all our native mobile apps to React Native. Since each app is different, there is no single approach that works for all of them. So, we evaluated all the possible options for each app and chose the ones that best suit their needs.

Shopify Point of Sale, for instance, had come a long way since it was first built during an internal hackathon. It was originally designed and built to support small mom-and-pop stores or weekend warriors. However, it has surged in popularity and is being used by some of our biggest merchants and is processing transactions worth billions of dollars each year. The codebase had accumulated a lot of tech debt and the app’s UX was also not serving the needs of large merchants who have hundreds of locations and tens of thousands of products. After a thorough evaluation, it became clear that we couldn’t fix these issues with incremental changes. Hence, we decided to do a full rewrite, which has been a big hit with our merchants.

Shopify Mobile, our flagship mobile app, on the other hand is quite stable and meets our merchants’ needs. It is also our largest app at 300 screens per platform and took over six years to build. Rebuilding it from scratch would be a massive undertaking. Even if we assume that we’d be twice as productive with RN (which is not necessarily the case always), it would take us at least three years to rebuild. That’s a very long time. We would have to halt all new feature development during this time and in the end have the exact same app as we started with. A rewrite then, was clearly out of question.

React Native工程Monorepo改造实践

本文主要介绍对云音乐RN收银台进行monorepo改造的一些实践经验。

避免 React useState 错误用法

在本文中,将介绍一些关于 useState 的常见错误。useState 是我们使用最频繁的 React hook,在代码中随处可见,但是也经常会出现一些错误的用法。由于这些错误用法的存在,会让代码的可读性变差,提高了代码的维护成本。

深度解析 React 性能优化 API

组件到底什么时候会渲染?React.memo 到底要不要用?本文将以 React 更新流程为基础,层层递进,将性能优化相关的用法原理串联起来,帮助读者搞明白为什么以及如何进行性能优化。

React Streaming SSR 原理解析

React 18 提供了一种新的 SSR 渲染模式:Streaming SSR,实现了 Streaming HTML 和 Selective Hydration 的特性。本文将从原理和源码两个方面,对 Streaming SSR 进行解析。

React Server Component: 混合式渲染

Server Component 顾名思义是在服务端渲染的组件,它是如何进行渲染的?和 SSR 又有什么区别?让我们来一起探索它究竟是个什么?

Our Solution for Measuring React Native Rendering Times

Performance is crucial for Shopify. After we started using React Native, we had to find a way to confirm our mobile apps are fast. The solution is an open-source @shopify/react-native-performance library by Shopify, which measures rendering times in React Native apps. In this article, you’ll learn more about how the library works, how to get started, and why measuring performance is so important.

React 中的重新渲染

React 组件在组件的状态 state 或者组件的属性 props 改变的时候,会重新渲染,条件简单,但是实际上稍不注意,会引起灾难性的重新渲染......

React17 事件机制

React 基于性能、跨浏览器、开发体验等方面的考虑,实现了一套自己的事件机制。本文将从事件代理、合成事件、事件回调的收集和处理等方面讲解React事件机制的实现细节。

React Native瀑布流列表性能优化与实践

汽车之家主app前端开发广泛使用React Native技术,因为其具有跨平台可以动态更新功能。目前有类似自驾游业务线利用React Native技术在汽车之家app上实现无限瀑布流列表的功能。优化前自驾游瀑布流列表在安卓低端机上滑动多页后会出现明显卡顿现象,快速滑动屏幕整体会出现白页的情况。

React 最新提出了一个名为 use 的 Hook

React 最新提出了一个叫 use 的 Hook,用于在客户端消费 Promise,而 use 和其他 Hook 不同之处在于,它可以在条件语句、block 和循环里使用。

React PureComponent 与函数组件(使用 Hooks)之间的差异

搞清楚 PureComponent 和它所解决的问题,了解它是否可以在 Hook 和函数组件的世界中被替换,并介绍 React 重新渲染(re-render)一个有趣(但有点无用)的怪异行为。

Managing React Form State Using the React-Form Library

We’ll delve further into Shopify’s open source Quilt repo that contains 72 npm packages, one of which is the react-form library.

基于 React Native 的动态列表方案探索

针对动态列表问题我们使用RN进行了一下探索尝试, 利用我们已经相对完善的RN基建,结合客户端列表能力低成本的实现了一套的动态化能力,同时兼顾一定的性能体验。

React 可组合 API 的设计原则

在本文中,我们将深入探讨用于分解组件和设计可组合 API 的主要原则。并以 Tabs 组件为例,来说明我们需要解决的核心问题和做出的各种权衡。

首页 - Wiki
Copyright © 2011-2024 iteam. Current version is 2.139.0. UTC+08:00, 2024-12-22 20:04
浙ICP备14020137号-1 $访客地图$