框架与类库: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 组件为例,来说明我们需要解决的核心问题和做出的各种权衡。
一份详尽的 React re-render 指南
什么是 re-render(重新渲染)?哪些是必要的 re-render?哪些是非必要的 re-render?如果你对这些问题还不是很明白,那么可以在这篇文章中找到答案。本文是一篇比较详尽的 React re-render 指南,会着重介绍和解答以下问题:什么是 re-render、哪些是必要或非必要 的 re-render、什么条件能够触发 React 组件 re-render。除此之外,还会介绍一些避免 re-render 的重要开发模式,以及引起不必要 re-render 的反模式。并且针对每种模式和反模式都提供了示例图。
Mastering React’s Stable Values
In this post, Colin Gray, Principal Developer at Shopify, delivers a crash course in how to make sense of stable values in React and when they matter most.
React Native 中实现动态导入
React Native 虽然提供了拆包的能力,但只能拆为基础包和业务包;无法做精细化的代码分割,更无法提供灵活的按需加载能力。本文将介绍纯前端如何在 React Native 中实现的动态导入。
这⼀次彻底弄懂:React 服务端渲染
在前端项目需要首屏渲染速度优化或SEO的场景下,大家或多或少都听过到过服务端渲染( SSR ),但大多数人对服务端渲染具体实现和底层原理还是比较陌生的。本文基于公司官网开发时做了服务端渲染改造基础上,系统理解和梳理这套体系的模式和逻辑,并写了一些笔记和Demo(文后链接)便于深入理解。这次我们来以React为例,把服务端渲染彻底讲弄明白。
Notes on maintaining an internal React component library
A collection of my thoughts on maintaining a component library as part of an existing design system used by a large number of frontend applications.