原博客(www.xio.kim)正迁至此处
  • 读 React 源码,找 Scripts 的 Bug

    React v19 开始支持 Async Scripts,可如果用了 onLoad,那么 Scripts 就会失效。真是奇怪,不是吗?半年里,我陷进去了 2 次,于是决定读源码找原因。

    Read now
    read now
  • 在 Base UI 看到一个有趣的 API 设计

    今天,Base UI 发布了 1.0 版本,然后,我看到了一个有趣的 API 设计 —— 组件即类型。可遗憾的是...

    Read now
    read now
  • How to Combine startTransition with @tanstack/react-query

    This is a follow-up to the previous post "Beware the 'async support' in React 19's startTransition", offering a code snippet to demonstrate how to integrate startTransition with @tanstack/react-query.

    Read now
    read now
  • Beware the "async support" in React 19's startTransition

    Starting with React 19, startTransition supports async functions, which sounds pretty good. But it has a hidden pitfall, and sometimes, it can be fatal.

    Read now
    read now
  • Rspack v1.5 Introduces lazyBarrel Feature

    Rspack v1.5 brings a new lazyBarrel feature, I compared it with Next.js and Vite, and briefly explained how it works.

    Read now
    read now
  • What Do I Think of the Barrel Pattern?

    起初,我为了美化导入语句而使用 Barrel Pattern,直到后来,我才意识到它真正的魅力——文件的访问控制。然而,它也有众所周知的问题,于是我开始构想一种新的方案。

    Read now
    read now
  • Avoid using TypeScript's Enums, use 'as const' instead

    尽管这已是常识,但再讲一遍也不过时。另外,TypeScript 5.8 推出了一个新的规则,来鼓励你禁用 Enums。

    Read now
    read now
  • 如何将 Antd 集成进 Tailwind CSS?

    我想在 Tailwind CSS@4 的类名中使用 Antd@5 的 Design Token,就像 <div class="colorPrimary"> 这样,这里就有一个方案。

    Read now
    read now
  • 使用 text-box 裁剪字符的行高

    有些字符天生就不垂直居中,哪怕有合理的行高。text-box 是解决方案,这里讲它,和它背后的「行高」。

    Read now
    read now
  • 使用 Next.js 构建博客

    使用 Markdown 来写作,使用 Next.js(SSG)来制作博客,使用 MDX 来添加可交互的组件,这个站点就是如此。

    Read now
    read now
  • Web 开发的设计模式

    设计模式是编程的公式,我将那些学到的东西写在这里,作为 Cheatsheet。

    Read now
    read now
  • 手写符合 Promises/A+ Spec 的 Promise

    我一直都想知道 Promise 是怎么工作的,于是我去阅读了 Promises/A+ Spec,并实现了一个通过测试的 Polyfill,这让我很受益。

    Read now
    read now