<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Oxlint | 锤子前端</title><description>Now vibe coding, so learning hammer FE ?</description><link>https://channel.meo-ai.com</link><item><title>《Oxlint 原生集成 React Compiler：Lint 速度提升 3 倍，Rust 工具链再进一步》</title><link>https://channel.meo-ai.com/posts/700</link><guid isPermaLink="true">https://channel.meo-ai.com/posts/700</guid><pubDate>Fri, 28 Aug 2026 01:11:29 GMT</pubDate><content:encoded>&lt;span class=&quot;post-title-source&quot;&gt;《&lt;/span&gt;&lt;mark class=&quot;highlight&quot;&gt;&lt;span class=&quot;post-title-source&quot;&gt;Oxlint&lt;/span&gt;&lt;/mark&gt;&lt;span class=&quot;post-title-source&quot;&gt; 原生集成 React Compiler：Lint 速度提升 3 倍，Rust 工具链再进一步》&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;标签：&lt;br /&gt;&lt;a href=&quot;/search/result?q=%23%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91&quot; title=&quot;#前端开发&quot;&gt;#前端开发&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23React&quot; title=&quot;#React&quot;&gt;#React&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Rust&quot; title=&quot;#Rust&quot;&gt;#Rust&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23Oxlint&quot; title=&quot;#Oxlint&quot;&gt;#Oxlint&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96&quot; title=&quot;#性能优化&quot;&gt;#性能优化&lt;/a&gt; &lt;a href=&quot;/search/result?q=%23%E7%BC%96%E8%AF%91%E5%99%A8&quot; title=&quot;#编译器&quot;&gt;#编译器&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;总结：&lt;br /&gt;&lt;br /&gt;&lt;mark class=&quot;highlight&quot;&gt;Oxlint&lt;/mark&gt; 在 v1.79.0 中正式原生集成了 React Compiler 的 22 条 lint 规则，无需 Babel 管道即可在 Rust 层直接运行。这意味着开发者可以在 lint 阶段就捕获 React Compiler 的 bailout（回退）情况，而 lint 任务耗时从约 29.2 秒骤降至 9.1 秒（3.2 倍加速），若去掉其他 JS 插件甚至可达 11 倍。作者强调：使用 React Compiler 时，启用全部 lint 规则是&quot;不可争议的前提条件&quot;，因为一次 bailout 就可能导致性能严重退化（如作者主页动画卡顿）。同时，oxc 的 Rust 版 React Compiler 构建时转换也已接近可用，比原版快约 2 倍。&lt;br /&gt;&lt;br /&gt;文章要点：&lt;br /&gt;&lt;br /&gt;1. React Compiler 的 Rust 重写已成官方版本 — React 团队近期发布了 Rust 重写的 React Compiler，作为新的 canonical 版本。作者已在 AI 建站工具 Outlyne 中使用近一年，彻底告别手动 &lt;code&gt;useCallback&lt;/code&gt;/&lt;code&gt;useMemo&lt;/code&gt;。&lt;br /&gt;&lt;br /&gt;2. 作者已全面迁移到 oxc 生态 — Rollup → Rolldown、ESLint → &lt;mark class=&quot;highlight&quot;&gt;Oxlint&lt;/mark&gt;、Prettier → oxfmt、Jest → Vitest，整体工具链已 Rust 化，但 React Compiler 的 lint 插件一直是瓶颈。&lt;br /&gt;&lt;br /&gt;3. 旧方案的痛点：Babel 管道拖慢 lint 3 倍 — 此前通过 &lt;mark class=&quot;highlight&quot;&gt;Oxlint&lt;/mark&gt; 的 JS 插件支持运行 React Compiler linter，需要先跑 Babel 再跑 Compiler 核心构建 AST，导致 lint 任务耗时从 9 秒暴涨到 29 秒。&lt;br /&gt;&lt;br /&gt;4. &lt;mark class=&quot;highlight&quot;&gt;Oxlint&lt;/mark&gt; v1.70.0 起引入原生支持 — 新增 nursery 规则 &lt;code&gt;react/react-compiler&lt;/code&gt;，直接在 Rust 中运行 React Compiler，无需 Babel。v1.79.0 正式发布 22 条 Compiler 驱动的规则，覆盖 React 规则的验证。&lt;br /&gt;&lt;br /&gt;5. 推荐配置：correctness + 枚举剩余规则 — 启用 &lt;code&gt;correctness&lt;/code&gt; 类别可覆盖 12 条规则，再手动列出其余 10 条。若启用 &lt;code&gt;restriction&lt;/code&gt; 类别则自动再纳入 5 条，&lt;code&gt;suspicious&lt;/code&gt; 纳入 4 条，&lt;code&gt;perf&lt;/code&gt; 纳入 1 条。&lt;br /&gt;&lt;br /&gt;6. 速度实测：3.2 倍到 11 倍提升 — 原生规则下 lint 从 29.2s → 9.1s；若同时去掉无原生替代的 JS 插件（如 perfectionist），可进一步降至 2.6s，实现 11 倍加速。&lt;br /&gt;&lt;br /&gt;7. 构建时转换也在推进中 — oxc 已合并原生构建时 transform，但 Rolldown/Vite 曾因二进制体积增加 17% 而暂时回退。oxc-transform-react v0.0.1 已发布，比原版 Rust Compiler 快约 2 倍，source map 已修复，支持 fast refresh，作者已在生产环境测试。&lt;br /&gt;&lt;br /&gt;8. 迁移门槛极低 — 只需 lint 层面改动，不影响构建步骤。可用 &lt;code&gt;npx @oxlint/migrate&lt;/code&gt; 自动迁移 ESLint flat config，或让 LLM 帮忙。甚至可以先并行跑 &lt;mark class=&quot;highlight&quot;&gt;Oxlint&lt;/mark&gt; 和 ESLint，只替换 React Compiler 插件就能提速。&lt;br /&gt;&lt;br /&gt;9. 一个常见陷阱：props 重新赋值 — &lt;code&gt;function MyComponent({ value }) { value = value ?? fallback; }&lt;/code&gt; 这种写法会让整个组件被 Compiler 跳过（bailout），导致性能退化。建议用解构重命名解决，同时开启 &lt;code&gt;eslint/no-param-reassign&lt;/code&gt; 规则。&lt;br /&gt;&lt;br /&gt;10. 作者的底线原则 — &quot;React Compiler without linting all bailouts considered unsafe&quot;（不 lint 所有 bailout 的 React Compiler 视为不安全）。一次 bailout 曾导致其首页动画 placeholder 卡顿、视觉破碎。&lt;br /&gt;&lt;br /&gt;URL：&lt;br /&gt;&lt;a href=&quot;https://blog.master.dev/react-compiler-linting-just-got-a-rust-native-speedup-in-oxlint/&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;https://blog.master.dev/react-compiler-linting-just-got-a-rust-native-speedup-in-oxlint/&quot;&gt;https://blog.master.dev/react-compiler-linting-just-got-a-rust-native-speedup-in-oxlint/&lt;/a&gt;&lt;a class=&quot;tgme_widget_message_link_preview&quot; href=&quot;https://blog.master.dev/react-compiler-linting-just-got-a-rust-native-speedup-in-oxlint&quot; target=&quot;_blank&quot; rel=&quot;noopener&quot; title=&quot;Update! This is a re-written version of this recently-published post about linting code bound for the React Compiler with Oxlint. Oxlint just published a new guide to this, so this post reflects that new information. The React team made a big splash recently…&quot;&gt;
  
  &lt;div class=&quot;link_preview_site_name accent_color&quot;&gt;blog.master.dev&lt;/div&gt;
  &lt;img class=&quot;link_preview_image&quot; alt=&quot;React Compiler Linting Just Got a Rust-Native Speedup in Oxlint&quot; src=&quot;/static/https://cdn4.telesco.pe/file/OHlqH-nASgtGQNAV2eyB9xdd-CSmi98_4byEKKriABrv2zpIIbyCnHYoXbjAJPoWoargdinvYMvp-vq5rpoc1NQr0orSUr7Yc1sX8xbuhJhmzo9LDEPQzxqNROwphk_CLw6n3VphTOo39OCrNqk5FprnPOxxOl1ljsEWRj5d4WNQB2O91cJHMyRsZsDBh_M1gE7H3ejveCspwUdiohAyOUQ6mvC0AeDELacUgZtAYV43KcykJnONzH2Jh5bmt3WXPrqybry8haYf2FSeO4EQfNWYft-EQMgj4DoBhLntiihSLHh8xcXC5ViHruldAEqtMDPHIuIAKS2rPpSM1fzd-w.jpg&quot; width=&quot;1200&quot; height=&quot;630&quot; loading=&quot;eager&quot; /&gt;
  &lt;div class=&quot;link_preview_title&quot;&gt;React Compiler Linting Just Got a Rust-Native Speedup in &lt;mark class=&quot;highlight&quot;&gt;Oxlint&lt;/mark&gt;&lt;/div&gt;
  &lt;div class=&quot;link_preview_description&quot;&gt;Update! This is a re-written version of this recently-published post about linting code bound for the React Compiler with &lt;mark class=&quot;highlight&quot;&gt;Oxlint&lt;/mark&gt;. &lt;mark class=&quot;highlight&quot;&gt;Oxlint&lt;/mark&gt; just published a new guide to this, so this post reflects that new information. The React team made a big splash recently…&lt;/div&gt;
&lt;/a&gt;</content:encoded></item></channel></rss>