跳到正文
ViewBrand搜索账号
账号报告查看 X 主页

覆盖 200 条帖子 · 2023年1月2日 至 2026年11月26日(UTC)

粉丝数
—
互动率 —
每帖平均浏览量
80.1K
浏览量中位数 38.1K
每帖平均点赞数
525
点赞率 0.656%
每帖平均回复数
13.6
回复率 0.017%
每帖平均转发数
32.5
转发率 0.0406%
每帖平均收藏数
258
收藏率 0.322%
AI分析

React 与 Next.js 框架实践

平常的 8.3 倍

I wrote a blog post: Building Bulletproof React Components:

https://t.co/xWD215YaFi

帖子图片图片加载中…
110K1.94K301.98K
查看原帖
平常的 8.0 倍

Statically typed links are coming to @nextjs:

◆ Autocompletion ◆ Error on invalid routes ◆ Prevents 404 links during build ◆ Dynamic, catch-all, and optional catch-all routes ◆ Works with both `pages` and `app` ◆ No extra configuration needed! https://t.co/E04vzfTxA1

@nextjs
视频加载中…
279K1.88K46135
查看原帖
平常的 7.2 倍

With Next.js’ app directory and that new idea, it takes less than 150 lines of code to create this. ~4 lines are actually related to animation (wrapping the tree with <Satori>): https://t.co/ZHbZNXzYQY

视频加载中…
打开引用帖
634K1.69K251.02K
查看原帖
平常的 4.6 倍

If you’re wondering what UI SDK behaviors look like in real components, we’ve put together some examples you can try:

https://t.co/eenRpMex56 https://t.co/EsZxu1fNi4

视频加载中…
119K1.08K44989
查看原帖
平常的 3.8 倍

We migrated @v0’s codebase from ESLint + Prettier to Oxlint + Oxfmt by @oxcproject, CI is now 3x faster. Love the OSS ecosystem.

@v0@oxcproject
71.1K88918246
查看原帖
平常的 3.2 倍

In case you didn’t know, React didn’t invent RSC, SSR, or Hydration, conceptually:

SSR is Express: app.get('/', (req, res) => { res.render('index', { name: 'John' }) }) RSC is Pug: if name == "Bob" button(class="btn") Hello Bob else button(class="btn") My name is #{name} Hydration is jQuery: $('.btn').click(...) That’s why there’s no window in SSR, and you can’t set onClick in RSC, and you have hydration errors in jQuery too (such as a typo of .btn) but with a less fancy name.

83K75542254
查看原帖
平常的 2.8 倍

I’m redesigning my website on top of some exciting new things: Next.js App Router, Turbopack, CSS View Transitions, Tailwind CSS 4.0, MDX in RSC.

Will have it open sourced when it’s ready :) Interestingly Turbopack, Tailwind and MDX compilers are all backed by Rust now. https://t.co/5u9OhoeAYG

视频加载中…
68.8K65418354
查看原帖
平常的 2.5 倍

My React Server Components (RSC) mental model is basically:

They’re getServerSideProps / getStaticProps but more powerful. Things RSC / gSSP / gSP share in common: 🔸 You can’t pass things like normal functions from RSC / gSSP / gSP to the client, because they just can’t be serialized; 🔸 They must be executed before Client Components; 🔸 They don’t run in the browser; 🔸 They don’t have states, so no hooks; 🔸 They can both be executed and stored as static at build time (RSC / gSP), so they don’t require a server. Things that are more advanced in RSC compared to gSSP / gSP: 🔹 Server Components can pass elements and more to the client, instead of being limited to JSON values; 🔹 Server Components are able to define extra wrappers around Client Components, whereas gSSP / gSP can only affect components’ inner content; 🔹 You can have many Server Components and they will be more parallelized when executing, instead of only one giant gSSP / gSP blocking on the top; 🔹 Individual Server Component boundaries can be optimized as static if possible, instead of picking between fully dynamic (gSSP) and fully static (gSP) for all data; 🔹 Individual Server Component boundaries can be streamed to the browser and rendered earlier, unlike gSSP that must block the initial client rendering.

帖子图片图片加载中…
128K57412521
查看原帖
平常的 2.1 倍

Next.js 16.3 is really good.

42.4K5023917
查看原帖
平常的 2.1 倍

A trick I use a lot: when inlining scoped* JS code as source string, do `(${() => { … }})()`.

- Compiled and minified on prod - TS allowed - Syntax highlight, auto format, type check, lint all work https://t.co/GP67FLp4Cz

帖子图片图片加载中…
44.2K49913331
查看原帖
平常的 2.1 倍

One small detail of UI SDK that we’ve put a lot of effort into, to make it more accessible:

A `findable` option to make native search (Ctrl/Cmd+F) work with virtualized lists. Works in both Safari and Chrome. https://t.co/X8QqHotlce https://t.co/FvtY03cAeq

视频加载中…
37.5K49220172
查看原帖
平常的 1.9 倍

𝑎𝑠𝑦𝑛𝑐 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝐶𝑜𝑚𝑝({ 𝑖𝑑, 𝑐ℎ𝑖𝑙𝑑𝑟𝑒𝑛 }) { "𝑢𝑠𝑒 𝑐𝑎𝑐ℎ𝑒"

𝑐𝑜𝑛𝑠𝑡 𝑑𝑎𝑡𝑎 = 𝑎𝑤𝑎𝑖𝑡 𝑔𝑒𝑡𝑆𝑜𝑚𝑒𝐷𝑎𝑡𝑎(𝑖𝑑) 𝑟𝑒𝑡𝑢𝑟𝑛 <> <𝑑𝑖𝑣>{𝑑𝑎𝑡𝑎}</𝑑𝑖𝑣> {𝑐ℎ𝑖𝑙𝑑𝑟𝑒𝑛} </> } Changing children won’t break the cache.

154K44620123
查看原帖
平常的 1.8 倍

Tree shaking solved barrel files, but at a huge cost (like easily 2x or 3x the bundler work and compilation time).

We previously talked about that here: https://t.co/z9YDC0fnyp I also asked Gemini to give a nicer explanation (do not import your entire house):

帖子图片图片加载中…
打开引用帖
41.2K41015229
查看原帖
平常的 1.7 倍

UI behaviors → we’re here + Stateful coordination → element logic + React/Vue/Svelte/… → components + Tailwind/StyleX/… → design systems

Lower level, accessible, atomic units. Faster to build systems on top with focus on your design. The periodic table of UIs.

打开引用帖
19.8K40218164
查看原帖
平常的 1.3 倍

Trying to visualize that Server-Side Rendering (SSR) isn't just about SEO, it actually makes the site faster. And why PPR is the goat.

Main cost = 🟥 JS load & Hydration 🟡⇆🔵 Region Latency https://t.co/XHctfcEIyc

帖子图片图片加载中…
42.1K31311208
查看原帖
平常的 1.3 倍

There are many mind-blowing ideas in RSC’s design, but one that still sticks with me is this:

Dynamism starts at reading the data, not getting the data. Does it sound obvious? What does this exactly mean in RSC’s design? First of all, it’s natural to think that all dynamism is introduced by IO operations, and almost all IO is asynchronous. Let’s exclude things like Date and Math.random from this discussion. 1. If a page component is sync, we can safely say that it is static and the result can be cached, because there’s no way to read the data (no `await`). This is the reason that Next.js has `params`, `searchParams`, `headers()`, `cookies()`, etc. as async APIs. 2. Sync doesn’t mean one can’t load the data. If we start loading something as a Promise, the result can still be cached until the moment it’s read (`await`ed). This is why it’s recommended to preload data in RSC and pass it down as a Promise (then `use()` inside). It allows the framework to pre-build and stream a static shell:

帖子图片图片加载中…
23.6K3056183
查看原帖
平常的 1.2 倍

Sometimes optimizations are chained and can be destroyed by single point of deopts, which is worse than no optimization at all. That’s also why they should be made by compilers. https://t.co/ziFENK3Jxm

帖子图片图片加载中…
46.5K287741
查看原帖
平常的 1.1 倍

One of those invisible details: accessibility isn’t only screen readers. it’s also “can someone in Tokyo type into your search box without it picking the wrong thing.”

@uisdk handles Input Method Editor (IME) input so keystroke/Enter/Escape/arrows don’t fire mid-word. https://t.co/gQdyiuNgeQ

@uisdk
视频加载中…
打开引用帖
12.9K258899
查看原帖
平常的 1.1 倍

And I’ll try to draw some diagrams to show how I visualize Server Actions in my head and how they work, as I saw some confusion around. There’re two ways of using Server Actions:

1. Define Server Actions in Server Components and pass them to Client Components via props... https://t.co/Y0szUzMe0K

视频加载中…
95.2K2534123
查看原帖
平常的 1.1 倍

Poured my thoughts into an article about Barrel Optimization in Next.js. If you’re as fascinated by frameworks and bundlers, give it a read!

打开引用帖
68.6K2531456
查看原帖
平常的 0.9 倍

True but worth noting that the only thing I dislike about this pattern is that it takes 2 render passes to SSR, which breaks the assumption of “hooks are stateless/no-ops on the server”.

That assumption can be very useful. On a server bundle build, the compiler can optimize useState/useMemo/useCallback/useRef calls to just inline values, remove useEffect, etc. for almost all hooks. That essentially eliminates the “ordered internal states” of hooks. And that “server” definition can be broader, anything without actually hydrating the app interactivity can be that “server”. For example a Playwright runtime used to only screenshot the initial render, or tools like Satori to statically render React components into image, etc.

打开引用帖
68.7K2195152
查看原帖
平常的 0.9 倍

Big productivity boost with GitHub’s stacked PRs, thanks @jaredpalmer https://t.co/pvhU3kVemU

@jaredpalmer
帖子图片图片加载中…
17.5K210426
查看原帖
平常的 0.9 倍

Just in case you weren’t aware, enabling the `experimental.typedRoutes` feature in @nextjs automatically checks for invalid links, along with support for rewrites and redirects! https://t.co/ABD6pj15QG

@nextjs
帖子图片图片加载中…
58.9K208533
查看原帖
平常的 0.9 倍

Have been working on implementing Server Actions in Next.js with the team for the past 5 months (and yes, it still feels magical), couldn’t be happier to see it come to life. Thanks @sebmarkbage @feedthejim @acdlite @kdy1dev ❤️

@sebmarkbage@feedthejim@acdlite@kdy1dev
打开引用帖
38.4K20565
查看原帖
平常的 0.8 倍

Very excited about this new API. More elegant and performant than `dynamic(() => import(...), { ssr: false })`.

打开引用帖
25.8K198343
查看原帖
平常的 0.8 倍

👇 ...all the fields will be typed, with autocompletion and docs on typing and hover!

打开引用帖
28K17814
查看原帖
平常的 0.7 倍

Why does it have to be compiler magic? Think about this React component (pseudo):

function UserSignup(email) { const step1 = useMemo(() => queueStep('createUser', email)) const user = use(resolveIfStepDone(step1)) const step2 = useMemo(() => queueStep('sendWelcomeEmail', email)) use(resolveIfStepDone(step2)) const step3 = useMemo(() => queueStep('sleep', '7 days')) use(resolvedIfStepDone(step3)) const step4 = useMemo(() => queueStep('sendCheckInEmail', email)) use(resolvedIfStepDone(step4)) return { userId: https://t.co/maDf9NO77K, status: 'done' } } queueStep → tells an external executor to schedule, run, retry, monitor the task and return an ID; resolvedIfStepDone → abort and schedule a “re-render” of workflow, or resolve to the result if that step ID is finished. Unlike regular React, all memorized values and scheduler states are managed and persisted externally. So `await sleep('7 days')` doesn’t actually keep the server waiting, but stops it and restarts it in 7 days. In general, directives (use server/client/cache/workflow/step/dom/…) are ways to declare/hoist compute boundaries that are scoped to re-runnable units with serializable inputs/outputs.

打开引用帖
49.7K1751197
查看原帖
平常的 0.7 倍

Delivered some value last week! Next.js canary now automatically optimizes barrel file imports of popular libs (lucide-react, react-bootstrap, ant-design/icons, etc.).

A more advanced config is also available for your internal component system to use: https://t.co/1ytxyA5icz https://t.co/Bqj1VI6fXf

帖子图片图片加载中…
38.1K172710
查看原帖
平常的 0.7 倍

The Next.js TypeScript plugin is quite helpful. However, there is no way to enable a TS Language Server plugin by default in VS Code.

To avoid picking Workspace TS Version every time when opening a project, I made this extension to do it automatically: https://t.co/e1jKNcunlh

视频加载中…
打开引用帖
40.7K1617130
查看原帖
平常的 0.7 倍

𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝐶𝑜𝑚𝑝({ 𝑖𝑑 }) { 𝑎𝑠𝑦𝑛𝑐 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑔𝑒𝑡𝑈𝑠𝑒𝑟𝐼𝑡𝑒𝑚𝑠(𝑖𝑛𝑑𝑒𝑥, 𝑙𝑖𝑚𝑖𝑡) { "𝑢𝑠𝑒 𝑐𝑎𝑐ℎ𝑒" 𝑟𝑒𝑡𝑢𝑟𝑛 𝑎𝑤𝑎𝑖𝑡 𝑑𝑏𝐺𝑒𝑡𝑈𝑠𝑒𝑟𝐼𝑡𝑒𝑚𝑠(𝑖𝑑, 𝑖𝑛𝑑𝑒𝑥, 𝑙𝑖𝑚𝑖𝑡) }

𝑟𝑒𝑡𝑢𝑟𝑛 <𝑈𝑠𝑒𝑟 𝑔𝑒𝑡𝐼𝑡𝑒𝑚𝑠={𝑔𝑒𝑡𝑈𝑠𝑒𝑟𝐼𝑡𝑒𝑚𝑠}/> } Here `id` will automatically become part of the cache key, and changing `id` will invalidate the cache even with same parameters. This is also why it can not be cache(fn) and has to be a compiler feature and be statically analyzable.

打开引用帖
53.6K159861
查看原帖
平常的 0.6 倍

`require('./typescript.js')` takes 0.255s `require('./typescript.min.js')` takes 0.191s

That’s ~25% faster. Publish minified packages if you can. https://t.co/Etip5MISqW

帖子图片图片加载中…
42.5K138713
查看原帖
平常的 0.6 倍

RSC’s serialization protocol is what really shines, and it’s way beyond “component level data fetching”.

47.2K131934
查看原帖
平常的 0.5 倍

Working on the next big release for https://t.co/xQt8aPeeNJ with @B2o5T:

1. Remote MDX 2. Dynamic routes 3. ISR &amp; on-demand ISR Imagine /v2/[…slug].mdx + fallback=blocking + CMS-backed content. Fast, dynamic, scalable. Pick 3.

@B2o5T
22.5K124910
查看原帖
平常的 0.5 倍

“use client” != this is a client component “use client” == entering the boundary of client components

打开引用帖
55.6K119226
查看原帖
平常的 0.5 倍

Some folks have been curious about the additional inlined data in the rendered HTML when using Server Components (and getServerSideProps, too!).

Here's a simplified explanation I shared with a friend: https://t.co/chrn8CrpHL

帖子图片图片加载中…
12.8K113346
查看原帖
平常的 0.5 倍

I need an ESLint rule to sort my code alphabetically so I don’t ship bugs.

Looks so well-organized: https://t.co/WeVibHYxC5

帖子图片图片加载中…
13.1K111711
查看原帖
平常的 0.4 倍

Every time I’m on a flight, I’m grateful for GitHub streaming SSR their pages.

29.9K101312
查看原帖
平常的 0.4 倍

Progressive Enhancement for form states has landed on Next.js canary. Try it out!

Nice demo from @fredkisss:

@fredkisss
打开引用帖
24.1K97219
查看原帖
平常的 0.4 倍

The tech behind this is very cool, that 1) the personalized content is React server-rendered, 2) loaded via a HTML stream without any extra roundtrips or JavaScript, 3) from the Edge at the speed of a static site.

Is that the ultimate shape of content delivering?

打开引用帖
21.9K94417
查看原帖
平常的 0.4 倍

I tested this (highly experimental) optimization idea before in Next.js under a flag. Although my main goal was to drop useEffect/useLayoutEffect and then DCE and tree-shaking will get rid of dependencies only used inside them:

https://t.co/kPSdQ6F7hc

打开引用帖
16.5K93334
查看原帖
平常的 0.4 倍

Vercel Skew Protection, React Concurrent Rendering, CSS View Transitions,

Are same things: running multiple versions of your app at the same time. They’re on different levels, they’re all super useful, and they’re not that easy to build.

15.1K82219
查看原帖
平常的 0.3 倍

If you are interested in some of the most impactful improvements @timneutkens and I shipped last week: https://t.co/E44Ttdh0Ds

It’s not finished work and there’re more to come! Please do not hesitate to do a profiling (check the link) and ping us if you saw slowness.

@timneutkens
打开引用帖
19.5K8024
查看原帖
平常的 0.3 倍

The reason was, I saw this pattern of preloading resources:

let userPromise = loadUser() // other tasks.. try { let user = await userPromise // .. } catch { // handle user load failure } And this might be a footgun if the sync function throws before returning a promise: https://t.co/ZyK4SQFCKX

帖子图片图片加载中…
打开引用帖
21.7K74549
查看原帖
平常的 0.3 倍

Great article and visualization as always!

Recommended especially because it explains the problem that React Server Components try to solve.

打开引用帖
21.9K67213
查看原帖
平常的 0.3 倍

Is there any reliable way to tell if a `fetch` was aborted because of the device being turned into sleep mode?

All the hacks I know use setInterval which delay the detection a bit and are not elegant…

27.5K62830
查看原帖
平常的 0.2 倍

Adding it to Router APIs, `router.push()` etc.:

1. Works in both editors and `next build` 2. No plugin or config needed 3. It feels great https://t.co/nqj78NBqET

视频加载中…
打开引用帖
28.4K57014
查看原帖
平常的 0.2 倍

RSC payloads are flowing out like endless rain into a paper cup They slither wildly as they slip away across the universe

6.36K4844
查看原帖
平常的 0.2 倍

Let’s say `f()` returns a promise:

async function a() { return f() } async function b() { return await f() } function c() { return f() }

54.2K471655
查看原帖
平常的 0.1 倍

Need an “HTS” language compiler that turns:

type NoAny = &lt;X, Fallback&gt; =&gt; { if (X === any) return Fallback return X } Into: type NoAny&lt;X, Fallback&gt; = 0 extends (1 &amp; X) ? Fallback : X

9.44K2445
查看原帖
帖子
62
内容占比
31.0%
点赞中位数
178.5
最高表现
8.3×

前端开源库与工具发布

平常的 17.9 倍

COBE v2: reliably use any DOM elements as markers & arcs. CSS transition, animation, filter, interactivity, ...all just work.

High perf, zero deps, still ~5KB. Coming soon.

视频加载中…
226K4.19K753.36K
查看原帖
平常的 17.1 倍

I trained a small model to do syntax highlighting in the browser with GPU.

Meet gpu-lexer from Vercel Labs: Small (27.5KB), fast (runs on WebGPU), and language-agnostic (model guesses the syntax). https://t.co/adphvt2Lv4 It is experimental and built for learning!

视频加载中…
803K3.99K1432.87K
查看原帖
平常的 9.9 倍

COBE v2 is here: markers, arcs, attach any HTML elements, Infinite ideas.

https://t.co/JBRZeS4dKw

视频加载中…
149K2.31K561.85K
查看原帖
平常的 4.1 倍

Better Promise.all with automatic dependency optimization and full type inference:

https://t.co/b59k7xQnd6

帖子图片图片加载中…
84.5K95129555
查看原帖
平常的 4.0 倍

Made `bidc` — create bidirectional message channels between different JavaScript contexts (main document, worker, iframe, service worker, etc.):

https://t.co/L2Yyi6A8qT

149K93528543
查看原帖
平常的 3.7 倍

Made `nstr` — Stringify numbers in JavaScript with smart precision detection. No more ugly precision issues in your UI:

𝚌𝚘𝚗𝚜𝚝 𝚙𝚛𝚒𝚌𝚎 = 𝟷𝟿.𝟿, 𝚛𝚊𝚝𝚎 = 𝟷𝟶𝟶 𝚛𝚎𝚝𝚞𝚛𝚗 <𝚜𝚙𝚊𝚗>${𝚙𝚛𝚒𝚌𝚎 * 𝚛𝚊𝚝𝚎}</𝚜𝚙𝚊𝚗> Shows: $1989.9999999999998 instead of $1990 😱 https://t.co/LA9faf1e4r

159K87734458
查看原帖
平常的 3.3 倍

Next version of Satori:

grid/block/inline/inline-block, fixed/sticky, float/clear, list-style, counter, word-spacing, overflow, aspect-ratio, order, visibility, outline, mix-blend-mode, isolation, paint-order, z-index, 3D transform, conic gradient, calc(), min/max/clamp() https://t.co/rH2QtKv7wS

视频加载中…
28.7K77618418
查看原帖
平常的 3.0 倍

After one week, there are 5 more small models for specific tasks on the web:

1. gpu-time: natural language to JS date and time by @imarikchakma 2. gpu-query: natural language to structured filters by @cheatyyyy 3. neural-flexbox: model to centre a div (!) by @aaronvanston 4. gpu-cron: natural language to cron expressions by @ManuSchiller 5. tinysarf: arabic morphological analyzers by @Ahmedabdou1996

@imarikchakma@cheatyyyy@aaronvanston@ManuSchiller@Ahmedabdou1996
打开引用帖
54.7K69124619
查看原帖
平常的 2.9 倍

In the latest `swr@beta`, you can seamlessly move data fetching between client-side and server-side, or both, in an RSC framework like Next.js:

🔸Client only: useSWR(key, fetcher) 🔹Mixed: useSWR(key, fetcher) + RSC-provided data 🔸Server only: useSWR(key) + RSC-provided data https://t.co/UOqZ8XXEh2

@beta
视频加载中…
268K67416440
查看原帖
平常的 2.3 倍

Thanks to our contributors, next-view-transitions v0.3.2 is now released with several improvements: 🔸 New useRouter equivalent API: useTransitionRouter 🔸 Fix page stuck caused by hash changes 🔸 Fix browser fallback

Releases: https://t.co/HVTkwbU56C https://t.co/wF4SMHAHh7

139K53711295
查看原帖
平常的 2.1 倍

In the next version of Next.js Image Generation: - Sharp for rendering - Faster Satori core - background-size: cover, contain, auto - text-decoration-skip-ink

Same ImageResponse, 65% faster:

帖子图片图片加载中…
44.3K49114109
查看原帖
平常的 2.0 倍

Some recent updates to @vercel’s Satori library:

- text-wrap: "pretty" - text-decoration-style: double - pointScaleFactor - Async components - Memory and speed improvements https://t.co/SLmGvcjDmZ

@vercel
23.6K4676141
查看原帖
平常的 2.0 倍

Some big feature updates for Satori. More in thread. Coming soon to Next.js ImageResponse:

• HarfBuzz text shaper (YES!) • WebP as image source • backdrop-filter • shape() in clip-path • corner-shape https://t.co/SLmGvcjDmZ

26.4K46025181
查看原帖
平常的 1.7 倍

Made `legid` — a library for generating safe, legit and random URL-safe IDs:

https://t.co/Cw8sAdg9hI

30.7K40311197
查看原帖
平常的 1.5 倍

Some recent updates for @vercel’s OG image generation and Satori:

🔹 Flex gap is now supported 🎉 🔹 HTML lang= attr 🎉 🔹 currentColor 🎉 🔹 Improvements related to emojis, viewBox, data URI, break-word, white-space and more https://t.co/u6flVtDBfE https://t.co/PjbaxQigYW

@vercel
72.7K3591057
查看原帖
平常的 1.3 倍

Update: I added a `await all({...}, { debug: true })` mode to make local debugging easier with better-all.

It logs beautiful waterfall graphs: tasks, dependents, durations and visual representation of their relations. https://t.co/b59k7xQnd6

帖子图片图片加载中…
打开引用帖
27.2K3085128
查看原帖
平常的 1.3 倍

Why’s it different?

- It makes cross-context communication as simple as RPC-style function calls, that are fully typed - And you can pass and/or return Promises and Async Functions in between https://t.co/dMwdIFmL02

帖子图片图片加载中…
打开引用帖
34.8K2955114
查看原帖
平常的 1.2 倍

Got a lot of attention for this (thank you!), but also there're some criticisms and questions:

1) it's a stupid idea Maybe. Again, this is experimental and not meant to be used in production or as a replacement for anything. It is to explore new possibilities. 2) it's unnecessary and sometimes wrong Existing solutions are not always more correct just because they're "algorithmic". For example pic 1 is Highlight.js and 2 is gpu-lexer, lang is JS not something rare. There are counterexamples too. Furthermore, language-agnostic is the real reason for exploring this approach. During training, the neural network learned patterns like "[keyword] variable = value" that are not tied to any specific programming language such as: var ... = ... let ... = ... const ... = ... using ... = ... val ... = ... auto ... = ... type ... = ... def ... = ... And that knowledge can be shared without re-implementing a grammar rule repeatedly. Another advantage is that this approach can potentially generalize to new programming languages or dialects without requiring extensive manual rule creation. If you go to https://t.co/s92Q3d2w94, you can't find popular Web framework languages like Vue, Svelte, Astro, and many others. Not to mention that new languages and dialects are constantly emerging, making it impractical to maintain comprehensive grammar rules for all of them. When that's a concern, you either use more comprehensive solutions like Shiki with a cost (carefully bundle, detect and load language definitions on demand, larger size), or use an easier approach for all kinds of source code with another cost (less accurate). That is definitely a good reason to explore this direction.

帖子图片图片加载中…
打开引用帖
30.2K2762392
查看原帖
平常的 1.0 倍

Shipped to the latest @nextjs canary:

ImageResponse got 2x faster on basic images, up to 20x faster on complex ones. Plus inline CSS variables and a handful of QoL improvements.

@nextjs
帖子图片图片加载中…
打开引用帖
20.5K229933
查看原帖
平常的 0.9 倍

What if there’s a &lt;Satori&gt; component that adds fluid layout &amp; style transitions to your elements? https://t.co/E0pMeIr8ry

视频加载中…
30.1K215632
查看原帖
平常的 0.9 倍

Satori v0.16.0 (thanks to @yogalayout):

New features: - box-sizing - display: contents - position: static Improvements: - Bugfixes for absolute positioning - Support percentage values for flex gap - Smaller package size https://t.co/SLmGvcjDmZ

@yogalayout
18.7K214267
查看原帖
平常的 0.9 倍

Adding `text-wrap: balance` to Satori, cc @lachlanjc @andrewingram https://t.co/9KMj6zj8Ij

@lachlanjc@andrewingram
视频加载中…
43K201736
查看原帖
平常的 0.8 倍

Tip: you can use “advanced” CSS features like `mask-image` and `text-wrap: balance` in Satori and @vercel/og.

Very helpful for social cards! https://t.co/1MqsJvguHm https://t.co/amHXu7C7bw

@vercel
帖子图片图片加载中…
27.6K197573
查看原帖
平常的 0.7 倍

Not 100% yet but I'm very proud of SWR’s test coverage: https://t.co/vHfZyHJyoM

帖子图片图片加载中…
18.4K166515
查看原帖
平常的 0.6 倍

Satori (https://t.co/gKt6wPKylc) recently added: - tab &amp; tab-size - line-clamp with ellipsis - clip-path - improved HSL syntax - improved radial-gradient &amp; linear-gradient - multiple text-shadow

Can’t thank enough to our contributors @LuQinYan, https://t.co/bRMfvkJfQQ!

@LuQinYan
24.5K152431
查看原帖
平常的 0.5 倍

Latest SWR (v2.3.8) comes with:

- A new `strictServerPrefetchWarning` option to let you progressively embrace the “prefetch on the server” pattern for better performance: https://t.co/VVXrPB9TUQ - Better TSDoc with tons of new code examples https://t.co/DCoXTZi9KJ

帖子图片图片加载中…
15.1K116233
查看原帖
平常的 0.4 倍

gpu-lexer@v0.0.6

Top 25 lang accuracy: 92.20% → 93.88% Size: 28.5KB → 30.3KB Time for three.min.js (×10): 220.5ms → 187.0ms

@v0
打开引用帖
6K90812
查看原帖
平常的 0.1 倍

Improved type inference for `data` and `isLoading` in SWR 2.0.1!

Example 👇

打开引用帖
6.61K2613
查看原帖
帖子
41
内容占比
20.5%
点赞中位数
295
最高表现
17.9×

CSS 与 Web 渲染实验

平常的 10.7 倍

UI and math time! UI = f(props) is the most famous line in React. But that f is JavaScript, not math.

Inspired by @_chenglou’s Handwired project, I compiled a <Dashboard/> component into a real math function, and asked what becomes possible. https://t.co/huyWUwLCpx

@_chenglou
视频加载中…
203K2.51K592.31K
查看原帖
平常的 6.2 倍

There’s a trend of using rotating gradients as input / button borders with CSS. Here’s a neat trick to enhance its appearance: https://t.co/DvPg8hvcIm

视频加载中…
328K1.45K191.4K
查看原帖
平常的 5.8 倍

There’s an idea that I’ve been casually working on for quite a while: bringing shaders to React.

Here’s my first demo: https://t.co/oyygjLlIeQ

视频加载中…
169K1.37K34707
查看原帖
平常的 4.1 倍

CSS-only scroll area indicator using `scroll-timeline`.

The trick is to simply add an opacity animation, controlled by that timeline, to these 2 arrow elements. https://t.co/38X9SsaJka https://t.co/JY4TVTk6tX

视频加载中…
341K95115641
查看原帖
平常的 3.0 倍

These are real WebGL shaders on top of interactive DOM elements without the HTML-in-Canvas API (works in Safari too). There’re rough edges still but worth sharing: https://t.co/S9qWkQ2C19

视频加载中…
打开引用帖
57.5K69717428
查看原帖
平常的 1.6 倍

Guess I really love CSS and I’m obsessed with the idea of CSS-only challenges. There are some interesting tricks used and someday I’ll write about them...

Here are a few of them:

116K38010221
查看原帖
平常的 1.3 倍

Double-slit experiment in JavaScript: a single rule about console.log() produces a zoo of quantum phenomena.

which( function path1() { return 0 }, function path2() { return 1 }, ) // → 0.5 https://t.co/yVoh5WPP4b

27.5K29915161
查看原帖
平常的 1.2 倍

Going to convert markers of https://t.co/GzD8ceTH0C to attributes of a new vertex shader. This works similar to a particle system, and it is more performant than the for loop in our current fragment shader (so you can add more markers!).

Next is arcs and DOM nodes/events. https://t.co/NW0wZhSjPg

视频加载中…
52.9K2803115
查看原帖
平常的 1.0 倍

Tailwind CSS is a good abstraction.

41.1K234812
查看原帖
平常的 0.6 倍

Ported some of my generative visuals to React Native w/ @expo two years ago. Maybe this year I can make some progress… the “N connected sliders start from any point” interaction was clean and joyful :D https://t.co/lwvyhqhxEk

@expo
视频加载中…
19K146931
查看原帖
平常的 0.6 倍

Quick CSS tip: you can use word-spacing, text-transform and ::first-letter to turn English into German https://t.co/4lOYJsFoEO

视频加载中…
23.2K133914
查看原帖
平常的 0.5 倍

Here’s a list of CSS challenges I’ve been casually thinking about so far... very fun :D https://t.co/G7FNlcmsiA

帖子图片图片加载中…
33.1K114640
查看原帖
平常的 0.2 倍

After making https://t.co/GzD8ceUeQa I found that on Chrome, using requestAnimationFrame and CSS3 animations together will trigger style recalcs on every frame: https://t.co/byCehRE3IV.

Might be something to work around especially for WebGL sites.

14.1K53018
查看原帖
平常的 0.1 倍

There might be two dimensions, one is about machine and the other is about mind

Atomic styles vs bundled styles Inline styles vs multi-hop styles

8.91K3512
查看原帖
帖子
34
内容占比
17.0%
点赞中位数
284
最高表现
26.6×

AI 辅助开发与产品动态

平常的 8.6 倍

Tell your agent to optimize your site’s web fonts. I’m seeing a huge difference on my blog.

Full prompt: Make this site's web fonts load faster without changing how anything looks. Shrink font bytes as far as possible, keep rendering identical, and prove it with before/after pixel diffs. Treat any visual change as a regression unless I approve it. If an optimization would change rendering, tell me what it saves and what it changes, and keep the site looking the same by default. Keep the current loading behavior: don't touch font-display or fallback fonts. Don't add font processing to the build; write a script I run by hand, commit its output, and note when it needs rerunning. First measure the current state: each font file's size, glyph count, variable axes, OpenType features and hinting, plus font bytes per page and what each page preloads. Then find out what the site actually uses, checking inline component styles as well as stylesheets: which characters appear in the content, which axis values and weights each font needs (including one-off overrides and bold inside italics), which OpenType features are turned on, and CSS side effects like `hyphens: auto` using the U+2010 hyphen. Cut each font down to that. Keep the used characters plus Latin-1 and Latin Extended-A, and leave CJK to system fonts if that's how it renders today. Limit variable axes to the ranges in use, and only fix an axis at one value if nothing overrides it. Drop unused OpenType features and hinting. Split each font into two files. A small core with ASCII and the punctuation most pages use (curly quotes, dashes, ellipsis) gets preloaded. An extended file behind `unicode-range` only downloads when a page needs one of its characters. Each file's `unicode-range` should list only characters it actually contains. Watch out for a few things. A generated fallback face between the core and extended files will draw the extended characters before the real font does. Fonts with a Reserved Font Name under the OFL must be renamed internally once subset. Check the generated files, since font tools have quirks. Before calling it done, build a baseline from the same content and pixel-diff before and after on pages with code, italics, accented characters, components with their own font settings, and CJK. Explain every visible difference: content change, regression to fix, or harmless sub-pixel rounding. Re-measure bytes per page and confirm the extended files only load where needed. When you're done, tell me the bytes before and after per font and per page, the pixel-diff results, anywhere you deviated from what I asked and what it cost, and how to rerun the script. Later, it may be worth embedding the core font in the global stylesheet and precaching the extended files after idle.

帖子图片图片加载中…
160K2.01K633.33K
查看原帖
平常的 4.3 倍

We’ve added 12 new rules to the React Best Practices skill. To install or update it via https://t.co/t1sGqu1d8j, run:

npx skills add vercel-labs/agent-skills --skill vercel-react-best-practices

帖子图片图片加载中…
打开引用帖
132K99723681
查看原帖
平常的 2.4 倍

5 new rules added to the React Best Practices skill, run:

npx skills add vercel-labs/agent-skills --skill vercel-react-best-practices to install/update it. https://t.co/FsG3bLppPV

帖子图片图片加载中…
打开引用帖
95.8K55611466
查看原帖
平常的 2.3 倍

8 new rules added to the React Best Practices skill:

npx skills add vercel-labs/agent-skills --skill vercel-react-best-practices Some of these patterns are a fun read for humans too. https://t.co/wuF95P6Xqi

帖子图片图片加载中…
打开引用帖
45.8K5358399
查看原帖
平常的 2.2 倍

There are many ideas that can be built with the new AI SDK. I’ll post some of my favorites.

Let’s start with render(): https://t.co/3daQhvKPcG

视频加载中…
打开引用帖
97.6K5126409
查看原帖
平常的 1.7 倍

UIs that are 1) context-aware 2) dynamically streamed from the server 3) interactive 4) stateful in both server and client 5) hooked into LLMs.

Will share more and open source it very soon. https://t.co/y8LEGv3ZZB

帖子图片图片加载中…
打开引用帖
70.7K40113171
查看原帖
平常的 1.4 倍

I love shaders but they usually take a lot of time to tweak. It unfortunately makes me less motivated to create.

But recently @v0 is my superpower and encourages me to create more without hesitating. Even a 5 minute gap before sleep: https://t.co/Ytb9Q4espP https://t.co/ChzXhUmypy

@v0
视频加载中…
40.2K3329221
查看原帖
平常的 1.2 倍

Some @v0 Design Mode tips:

1. Double click to edit text https://t.co/mWZ7DqAvLG

@v0
视频加载中…
39.3K2798118
查看原帖
平常的 0.8 倍

We’ve improved the load time of @v0’s generations significantly. See the before/after difference: https://t.co/91aOlMbZzd

@v0
视频加载中…
14.6K1761418
查看原帖
平常的 0.5 倍

I asked @bot to go through my original post’s replies and quotes to see the savings: ~9.49 MB, avg -79%, for these 12 sites! https://t.co/j77VBqoGyT

@bot
帖子图片图片加载中…
打开引用帖
14.4K1281193
查看原帖
平常的 0.5 倍

Wanted to show IO waterfall impacts in server-client apps (https://t.co/1spONUGaTJ). With 1 prompt, it was joyful to see @v0 one-shot this visualization with agent-browser:

1. Screenshotted the WIP 2. Identified issues and ran browser scripts for more info 3. Patched fixes and re-screenshotted to verify

@v0
帖子图片图片加载中…
打开引用帖
17.3K118569
查看原帖
平常的 0.2 倍

LLM-powered apps have longer request/session durations. Common to see &gt;30s streamed requests.

With around 24*60*60/30 = 2,880 daily requests globally (distributed evenly), you can’t just cd into your server and restart your app anytime. It will break some users.

11.2K46410
查看原帖
平常的 0.1 倍

Some personal thoughts and notes from a while back about the architectural design of AI tools. And I guess AutoGPT now already implements something similar, even with long-term memory. https://t.co/GwYUu7GSUe

帖子图片图片加载中…
9.22K35117
查看原帖
帖子
28
内容占比
14.0%
点赞中位数
231.5
最高表现
8.6×

技术随笔与个人思考

平常的 18.6 倍

13 years ago, Apple asked a question that hits me harder today than ever:

If everyone is busy making everything, how can anyone perfect anything? Every day, I see a world flooded with effortless AI slops. I’m realizing that to build something truly great today, you need a level of focus the world has never demanded before. It feels like trying to write a quiet, beautiful song in a room full of loud noise.

161K4.35K1121.28K
查看原帖
平常的 2.1 倍

I spent a month in NYC &amp; SF preparing for the launch of https://t.co/zsRX0cmo66 with the team — it went smoothly. On the night of release, while flying back to Europe, I was treated to a stunning aurora over the Greenland skies. Breathtaking. https://t.co/dVD8UotiJc

帖子图片图片加载中…
65.1K4971016
查看原帖
平常的 2.0 倍

Miss the old days of open source. Code carried a piece of its maker. Software made with &lt;3.

28.4K4721934
查看原帖
平常的 1.0 倍

Books that keep coming back to me https://t.co/iPx4oZbtQ1

帖子图片图片加载中…
10.3K22713178
查看原帖
平常的 0.7 倍

“Give people wonderful tools, and they’ll do wonderful things.”

19.7K166916
查看原帖
平常的 0.4 倍

Reading a book about Fermat’s Last Theorem and I can’t stop thinking about this: a good conjecture is sometimes more valuable than the proof.

Good taste is about solving problems. Great taste is about identifying them.

7.82K95225
查看原帖
平常的 0.2 倍

“And what do you think was the salient feature of the rainbow that inspired Descartes’ mathematical analysis?”

[…] “I would say his inspiration was that he thought rainbows were beautiful.” https://t.co/Qdp7kNPLw7

帖子图片图片加载中…
16.6K46116
查看原帖
帖子
19
内容占比
9.5%
点赞中位数
246
最高表现
43.1×

其他

帖子
16
内容占比
8.0%
点赞中位数
108.5
最高表现
7.8×

关于Shu内容策略的常见问题

Shu有哪些主要内容支柱?

主要包括React 与 Next.js 框架实践、前端开源库与工具发布、CSS 与 Web 渲染实验和AI 辅助开发与产品动态。

查看内容支柱 ↗

Shu哪些主题的点赞贡献高于发布占比?

技术随笔与个人思考占发布量9.5%,贡献19.5%的点赞。

关于开源文化、设计品味、阅读、工作生活片段等非技术性个人表达与观点。

例如:My 10 years on GitHub ↗

查看主题表现 ↗

Shu在X哪些发布时段的点赞表现最高?

周日 00:00–04:00 UTC的点赞中位数最高,为1,176.5,来自6篇帖子。

查看发布时间 ↗

Shu哪条帖子的点赞最多?

点赞最高的帖子获得10,076次点赞,约为Shu单帖点赞中位数的43.1倍。

这篇帖子发布于2023年1月2日,原文写道:“My 10 years on GitHub”。

查看原帖 ↗

Shu最常发布什么形式,视频和图片表现有什么差别?

引用是Shu最常发布的形式,占39.5%。

按单帖平均浏览量比较,视频约为图片的1.13倍;按浏览量中位数比较,视频约为图片的1.62倍。

查看内容形式 ↗

Shu在X的发布频率是多少?

在这份报告覆盖的日期范围内,Shu平均每周发布约1.0条内容。

Shu最常在周日(36篇)和周五(34篇)发布。

发布最集中的一天是2023年9月18日,当天发布了3篇。

查看发布日历 ↗

ViewBrand怎样用AI分析Shu的内容?

AI将帖子归纳为内容主题。打开一个主题,可以结合表现数据查看对应原帖。

查看内容支柱 ↗