# Rory Cai > Personal site and tech blog of Rory Cai: frontend, React Native, iOS / Android and developer productivity. Rory Cai, Agent Engineer & Design Engineer. Agent engineer and design engineer at Parfit. Previously a frontend engineer at Tencent. Graduated from Harbin Institute of Technology (Shenzhen). Tech stack: TypeScript, Vue, Nuxt, React Native, Tailwind, Kotlin, Objective-C, Golang, Node.js, Python, MongoDB, Docker, Kubernetes, Prometheus, Grafana. GitHub: https://github.com/Coiggahou2002 X: https://x.com/royccc000 Every post is available in English (under /) and Chinese (under /zh/). ## For agents - Every page has a plain-Markdown twin: add `.md` to the URL without the trailing slash, e.g. https://coiggahou2002.github.io/blogs/nginx.md, https://coiggahou2002.github.io/blogs/app/learn-kotlin.md, https://coiggahou2002.github.io/zh/blogs/nginx.md - All English posts in one file: https://coiggahou2002.github.io/llms-full.txt (Chinese: https://coiggahou2002.github.io/zh/llms-full.txt) - Post index (JSON, both languages): https://coiggahou2002.github.io/api/posts.json - Résumé (JSON Resume): https://coiggahou2002.github.io/resume.json ## Posts (English) - [Prompts, Skills, and MCP Will All Disappear. People Only Pay for Outcomes](https://coiggahou2002.github.io/blogs/pay-for-outcomes/) (Sep 19, 2026): Prompts, skills, hooks, plugins — they're all a transitional phase of AI apps. What survives is a marketplace of agents that sell nothing but results. - [AI Won't Close the Gap Between People, and 7 Other Notes](https://coiggahou2002.github.io/blogs/recent-thoughts/) (Aug 9, 2026): AI won't narrow the gap between people. It does the opposite. It amplifies creativity and scales judgment, but it also amplifies stupidity and bias. - [A New Less Release Broke Tailwind's @apply, and Tailwind Took the Blame](https://coiggahou2002.github.io/blogs/tailwind-less-compatibility/) (Sep 14, 2025): One of our large projects uses a micro-frontend architecture. The stack is SSR + Vue 3 + NestJS + Webpack4, the style preprocessor is Less, and the project also integrates Tailwind, which most of us use day to day to write styles quickly.… - [How Long Is an Emoji, Really? A Deep Dive into Emoji Strings in UTF-16](https://coiggahou2002.github.io/blogs/deep-into-emoji/) (Jul 16, 2025): In day-to-day frontend work we deal with emoji all the time. If you're new to this, you've probably run into problems like these: You use split on a string that contains emoji, and it comes out broken You read .length on a string with… - [How to Speed Up Frontend Project Builds](https://coiggahou2002.github.io/blogs/how-to-reduce-nuxt-project-compile-time/) (Jun 8, 2025): Don't put the build steps in the Dockerfile The Dockerfile should only be responsible for building the runtime image Cache nodemodules instead of installing every time; reuse it when package.json hasn't changed Use npm prune --production… - [Objective-C Learning Notes](https://coiggahou2002.github.io/blogs/app/objectivec/) (May 17, 2025): Standard C data types work too Local variables are allocated on the stack, while objects are allocated on the heap Objective-C requires manual boxing/unboxing intValue is a method of the NSValue class Mutable / immutable Mutable /… - [Some Notes on Cookies](https://coiggahou2002.github.io/blogs/http-cookie/) (May 16, 2025): What attributes should a cookie have? When a cookie has the HttpOnly attribute, it can only be sent over HTTP (or HTTPS) and can't be accessed by client-side JavaScript. This is an effective defense against cross-site scripting (XSS),… - [Nginx Notes](https://coiggahou2002.github.io/blogs/nginx/) (May 15, 2025): Below are common examples from Nginx HTTP configuration, covering core features like static file serving, reverse proxying, load balancing, and caching: Use this command to check whether the config is valid: If the config is fine, reload… - [Batch-Generating WeChat Read's World Book Day Medals with Puppeteer](https://coiggahou2002.github.io/blogs/weread-medals-generator/) (Apr 25, 2025): As everyone knows, April 23 is World Book Day, and WeChat Read ran another campaign this year: generating a unique medal for every user. How unique? Each medal carries two numbers. The one in the top-left is how many years the user has… - [Piping Mobile WebView Console Logs into Native App Logs](https://coiggahou2002.github.io/blogs/hook-webview-console/) (Apr 8, 2025): In hybrid mobile development, we often embed RN or a WebView, and their JS runs in its own engine. For example: RN runs its JS in Hermes In iOS's WKWebView, JS runs on the JavaScriptCore engine In Android's WebView, JS runs in the V8… - [Fixing a Markdown Rendering Bug That Doubao Still Hasn't Fixed](https://coiggahou2002.github.io/blogs/markdown-emphasis-fix/) (Mar 11, 2025): In a recent project at work, we needed to parse Markdown generated by an LLM and render it in a WebView on mobile. Along the way we ran into a Markdown rendering problem: In the AI-generated Markdown, some bold text wasn't parsed… - [When a List Optimization Breaks Impression Tracking: The RN FlatList removeClippedSubviews Trap](https://coiggahou2002.github.io/blogs/rn-remove-clip-subview/) (Jan 22, 2025): In React Native, we often reach for the removeClippedSubviews prop on FlatList to squeeze more performance out of long lists. This innocent-looking optimization caused a data-tracking "disaster" on our team: list items that were nowhere… - [import vs. import type: A Deep Dive Into How TypeScript Imports Get Compiled](https://coiggahou2002.github.io/blogs/importtype-import/) (Jun 23, 2024): At work, one page of a Nuxt 3 app that had been running reliably for a long time suddenly started returning a 500 Server Error in production, so a colleague and I started debugging it in local dev mode. While tracking down the error… - [Make VS Code Snippets Shareable in Teams](https://coiggahou2002.github.io/blogs/share-vscode-snippets-among-team/) (Jun 20, 2024): Code snippets are templates that make it easier to enter repeating code patterns, such as loops or conditional-statements. VS Code allows users to define their own snippets in these levels: Global Snippets applies to every file regardless… - [Git](https://coiggahou2002.github.io/blogs/git/) (Oct 8, 2023): A branch is just a pointer to a snapshot node Snapshot nodes form a directed acyclic graph The HEAD pointer points to the snapshot node that matches the current state of the working directory Working Directory Staging Area Once a file that… - [Kotlin Learning Notes](https://coiggahou2002.github.io/blogs/app/learn-kotlin/): I've been wanting to dig into the React Native source code lately, and starting from the Android side felt easier since I already know Java. But the project I maintain mixes Java and Kotlin, so I picked up some Kotlin along the way. I… ## 文章(中文) - [Prompt、Skill、MCP 都会消失:人们只为结果付费](https://coiggahou2002.github.io/zh/blogs/pay-for-outcomes/) (2026-09-19): Prompt、Skill、Hook、Plugin,全都只是 AI 应用的过渡形态。留下来的,会是一个只交付结果的 Agent 市场。 - [AI 不会缩小人与人的差距,以及另外 7 条思考](https://coiggahou2002.github.io/zh/blogs/recent-thoughts/) (2026-08-09): AI 并不会让人与人之间的差距缩小,真实的情况恰恰相反。它放大人的创造力,scale 人的判断力,但也会放大人的愚蠢和偏见。 - [less 新版搞事情,tailwind 语法糖无奈躺枪](https://coiggahou2002.github.io/zh/blogs/tailwind-less-compatibility/) (2025-09-14): 我们业务某个大型项目是微前端架构,技术栈是 SSR + Vue 3 + NestJS + Webpack4,样式预处理器用的是 less,项目内也集成了 Tailwind,平时大家习惯用 Tailwind 来快速写样式。 Tailwind… - [emoji 的长度到底是多少?UTF-16 下 emoji 字符串原理探究](https://coiggahou2002.github.io/zh/blogs/deep-into-emoji/) (2025-07-16): 在日常前端开发过程中,我们经常会与 emoji 打交道。相信刚入门的新手们或多或少会遇到类似这样的问题: 使用split方法拆开含有 emoji 的字符串,拆坏了 使用.length获取含 emoji 字符串的长度,发现好像不太对劲… - [如何缩短前端项目构建时间](https://coiggahou2002.github.io/zh/blogs/how-to-reduce-nuxt-project-compile-time/) (2025-06-08): 构建的步骤不要放在 Dockerfile 里 Dockerfile 只负责构建运行时镜像 缓存 nodemodules, 不要每次都安装,当 package.json 没有发生变化时复用 使用 npm prune --production… - [Objective-C 学习笔记](https://coiggahou2002.github.io/zh/blogs/app/objectivec/) (2025-05-17): 标准 C 数据类型也是可以用的 局部变量在栈上分配,而对象在堆上分配 oc 需要手动装箱/拆箱 intValue 是 NSValue 类的方法 可变 / 不可变 可变 / 不可变 %@ 的行为类似 printf… - [关于 cookie 的一些总结](https://coiggahou2002.github.io/zh/blogs/http-cookie/) (2025-05-16): 一条 cookie 应该有什么属性? 当一个 Cookie 被设置为 HttpOnly 属性后,它只能通过 HTTP(或 HTTPS)协议传输,不能被客户端的 JavaScript… - [nginx 笔记](https://coiggahou2002.github.io/zh/blogs/nginx/) (2025-05-15): 下面是Nginx HTTP配置中常见的配置实例,涵盖了静态文件服务、反向代理、负载均衡、缓存设置等核心功能: 使用以下命令测试配置是否正确: 如果配置无误,Nginx 会重新加载配置: 在 Nginx 配置中,servername… - [使用 puppeteer 批量生成微信读书 423 活动勋章](https://coiggahou2002.github.io/zh/blogs/weread-medals-generator/) (2025-04-25): 众所周知,每年 4 月 23 日是世界读书日,微信读书这次又搞活动了,要给每个用户生成一个独特的勋章。… - [移动端 WebView 如何 hook 日志到客户端](https://coiggahou2002.github.io/zh/blogs/hook-webview-console/) (2025-04-08): 移动端混合开发中,我们可能会嵌入 RN 或者嵌入 WebView,他们的 JS 都是在自己的引擎里运行的。 例如: RN 的 js 在 Hermes 里运行 iOS 上的 WKWebView 中,js 在JavaScriptCore… - [解决了一个豆包还没解决的 Markdown 渲染问题](https://coiggahou2002.github.io/zh/blogs/markdown-emphasis-fix/) (2025-03-11): 在近期公司业务开发中,需要对大模型生成的 Markdown 文本进行解析并在移动端 WebView 上渲染,我们遇到了一个 Markdown 渲染问题: AI… - [列表性能优化居然会导致曝光错误?RN FlatList removeClippedSubviews 踩坑实录](https://coiggahou2002.github.io/zh/blogs/rn-remove-clip-subview/) (2025-01-22): 在 React Native 开发中,我们经常会使用 FlatList 的 removeClippedSubviews… - [从 import 与 import type 的区别引出的深入讨论](https://coiggahou2002.github.io/zh/blogs/importtype-import/) (2024-06-23): 工作中,一直稳定运行的 Nuxt 3 框架的其中一个页面突然在生产环境出现 500 Server Error,遂与同事用本地 dev 模式排查问题。 以本地开发模式排查报错的过程中,发现了项目抛出了一个错误 SyntaxError:… - [在团队中共享 VS Code 代码片段](https://coiggahou2002.github.io/zh/blogs/share-vscode-snippets-among-team/) (2024-06-20): 代码片段是可以更轻松地输入重复代码模式(例如循环或条件语句)的模板。 VS Code 允许用户在以下级别定义自己的代码片段: 全局片段适用于每个文件(语言无关) 语言级片段适用于特定语言,例如 javascript.json 配置仅适用于… - [Git](https://coiggahou2002.github.io/zh/blogs/git/) (2023-10-08): 分支只是指向 snapshot 节点的指针 snapshot 节点组成一幅有向无环图 HEAD 指针指向当前工作区状态对应的 snapshot 节点 工作区(Working Directory) 暂存区(Staging Area)… - [Kotlin 学习笔记](https://coiggahou2002.github.io/zh/blogs/app/learn-kotlin/): 最近想要深入一下 React Native 的源码,感觉从 Android 入手会相对好一点,因为本身就熟悉 Java,但是现在维护的项目是 Java 和 Kotlin 混合的,所以 Kotlin 也顺带看了一下。 主要和… ## Other pages - [Uses](https://coiggahou2002.github.io/menu/uses/): software and hardware I use - [Journal](https://coiggahou2002.github.io/menu/journal/): quotes I've collected - [中文首页](https://coiggahou2002.github.io/zh/)