likes
comments
collection
share

前端周热点113:react source code, SOLID, Remix, Docusaurus, FP, Remotion, Rapier

作者站长头像
站长
· 阅读数 20

React

Reading Source Code: React

Alex阅读了React的源代码,并对几个部分进行了评论,以React应用程序的安装为切入点。关于原型的使用、JJSX以及(不可知的)调和器与DOM渲染器的交互,都是有趣的细节。

Can We All Just Admit React Hooks Were a Bad Idea?

Amy认为,React hooks 不尊重SOLID架构原则。我不太同意,但我承认,在网上找到的大多数例子都是简化的,不一定能突出一个好的架构。

Applying SOLID principles in React

几乎是对上述文章的直接回答,即使SOLID的应用在这里被更广泛地覆盖(components + hooks)。注意:不要犹豫,使用React上下文进行依赖注入。

拓展阅读

  • 📜 Avoid anonymous components with displayName: sometimes React can't infer a good name for your components, which complicates the use of devtools (Context, memo, forwardRef, HOC) 有时React不能为你的组件推断出一个好的名字,这使得devtools的使用变得复杂(Context, memo, forwardRef, HOC)。
  • 📜 Why Remix is not a React framework but a full stack web framework: a well-written overview of the differences between Remix and other frameworks. Remix is full-stack and framework-agnostic. 这篇文章很好地概述了Remix与其他框架之间的区别。Remix是全栈式的,与框架无关。
  • 📜 Functional programming is finally going mainstream: GitHub highlights the popularization of functional programming, in part thanks to React, Redux and hooks. I personally switched career from Scala to React after reading David Nolen's famous post. Didn't even like JS before 2014 😅 GitHub强调了函数式编程的普及,部分归功于React、Redux和hooks。我个人在读了David Nolen的名帖后,从Scala转行到React。2014年之前甚至不喜欢JS 😅。
  • 📜 Why Docusaurus is a powerful documentation framework: 1Password explains why Docusaurus is a good solution for their developer documentation portal. Touch various advanced topics, including site customizations, remark plugins to extend MDX/Markdown... 1Password解释了为什么Docusaurus是他们开发者文档门户的一个很好的解决方案。触摸各种高级主题,包括网站定制,评论插件来扩展MDX/Markdown...
  • 📜 Store data in a cookie with sessions and Remix: creation of a visit counter cookie
  • 📖 Remix Deferred: new API under development that gives fine control over data loading tradeoffs on initial page load. Optimize for Time-to-first-byte or Cumulative Layout Shift. 正在开发的新的API,可以在初始页面加载时对数据加载的权衡进行精细控制。优化第一个字节的时间或累计布局转移。
  • 📖 Next.js accessibility doc improvements
  • 🐦 New Preact VDOM state model
  • 🐦 Remix + React 18 startTransition + time-sliced hydration: Ryan Florence sharing a controversial tip. Starts interesting discussions about hydration (Ryan Carniato, Andrew Clark...)
  • 📦 pmndrs/react-three-rapier: integrates react-three-fiber with Rapier (physics engine)
  • 📦 Remotion 3.1: many new features! Gifs, Tailwind CSS, springs with duration, OffthreadVideo...
  • 📦 Remix 1.6.5: loader + useLoaderData TypeScript inference👌
  • 📦 Framer Motion 6.5: scroll animations
  • 📦 Zustand 4.0.0-rc.2: ready for production
  • 📦 Redwood 2.1

React-Native

Hermes as the Default

JS Hermes引擎是JSC/V8的一个替代品。它可以通过字节码的预编译来帮助你的应用程序更快地启动。在React-Native 0.70(现在是 候选版本)中,Hermes被默认启用。Michael分享了来自开源应用Mattermost的各种基准数据。Hermes的发布模式已经改变,以避免ABI不兼容的问题。在iOS上增加了缺失的Intl APIs。即将推出对BigInt和WeakRef的支持。

What working at Airbnb during its React Native era taught me about web3

Devin回顾了React-Native在Airbnb的历史,以及对其逐渐落幕的非常微妙的决定。 他与web3做了有趣的比较。 从长远来看,技术潜力胜过早期采用者的痛苦。

拓展阅读


Other

Vite 3

Vite很快成为了前端生态系统中的一个参考。今天,它是Create-React-App的一个很好的替代品,DX速度更快,一些React元框架也在使用它(Storybook,Hydrogen...)。V3有很多变化,新的文档,各种框架(包括React)的启动程序,全局导入的改进,新的文档... 也请看10月份的[ViteConf](viteconf.org/?utm_会议。

拓展阅读


前端周热点113:react source code, SOLID, Remix, Docusaurus, FP, Remotion, Rapier

订阅原文: