正在加载视频...

视频加载失败

Here's what I'm using for RSC toast. - flash() function that server actions can call - useFlash() hook on the client that gets populated by all the server-side flash invocations Works with redirects, revalidation, progressive enhancement, etc. Blog post soon!

22,637 次观看 • 1 年前 •via X (Twitter)

11 条评论

Ryan Toronto 的头像
Ryan Toronto1 年前

It works by the server action setting a short lived cookie that's readable by js The browser uses cookie change event and when it sees a new flash cookie it'll populate state in useFlash() Browser then immediately deletes the cookie

Ryan Toronto 的头像
Ryan Toronto1 年前

Small update: No more cookie change event- Cookies are read in RSC and put in client component that populates context. That was missing piece to get SSR fully functional

Safari Web Extensions 的头像
Safari Web Extensions1 年前

Discover the top Safari web extensions to boost productivity, enhance workflow, and customize your browsing experience on Mac, iOS, and iPadOS.

Sam Selikoff 的头像
Sam Selikoff1 年前

Awesome! Does it depend on any framework-specific features or could it theoretically be a pure React lib?

Ryan Toronto 的头像
Ryan Toronto1 年前

It uses cookies, so it depends on your frameworks cookie impl (ie import {cookies} form "next/headers") But maybe there's a way to make an adapter layer that hooks into all the frameworks

Jack 的头像
Jack1 年前

yep been doing exact same, so easy to do it from the server

Zafar 的头像
Zafar1 年前

Awesome. Thanks for sharing.

Seb ⚛️ ThisWeekInReact.com 的头像
Seb ⚛️ ThisWeekInReact.com1 年前

IMHO this is the way @rwieruch Convenient to use, preserves progressive enhancement

pavi2410 的头像
pavi24101 年前

does this work similar to this?

zhxnrs 的头像
zhxnrs1 年前

Just why

Kiran 的头像
Kiran1 年前

But why?

相关视频

🚨 POC for CVE-2025-55182 that works on Next.js 16.0.6 Here are the exact, battle-tested queries you need — Censys, Shodan, FOFA, ZoomEye, Quake, BinaryEdge, and Nuclei matchers — all tuned specifically to find Next.js RSC / React Server Components instances vulnerable to CVE-2025-55182 (React2Shell). ⸻ ✅ 1. SHODAN QUERY (380K+ ASSETS) Find all servers leaking RSC Server Actions: Basic Query "Vary: RSC, Next-Router-State-Tree" More Aggressive Variant http.headers.vary:"RSC" AND http.headers.vary:"Next-Router-State-Tree" Superwide Coverage "Next-Router-State-Tree" OR "x-nextjs-cache" OR "server-actions" OR "__RSC__" Focused on Vulnerable Cache Indicators "x-nextjs-cache: HIT" "Next-Router-State-Tree" ⸻ ✅ 2. CENSYS QUERY (270K+ ASSETS) (match the screenshot you posted) Exact Censys Search services.http.response.headers.vary: "RSC, Next-Router-State-Tree" Safer Multi-Matcher services.http.response.headers.vary: "RSC" AND services.http.response.headers.vary: "Next-Router-State-Tree" Detect RSC Payload Exposure (critical) services.http.response.body: "__RSC__" Detect Flight Data Leaks services.http.response.body: "server-reference-manifest" ⸻ ✅ 3. FOFA QUERY (CHINA’S OSINT GIANT) (VERY POWERFUL for RSC/Next.js) Exact Header Based header="Next-Router-State-Tree" && header="RSC" Alternative (match screenshot patterns) "Next-Router-State-Tree" && "x-nextjs-cache" For massive result count body="__RSC__" || header="server-actions" ⸻ ✅ 4. ZOOMEYE QUERY ZoomEye scans often catch Node.js apps Shodan misses. Exact Unicode-Ready Query "Next-Router-State-Tree" && "RSC" Advanced app:"Next.js" && header:"RSC" ⸻ ✅ 5. QUAKE SEARCH (360K+ MATCHES) header:"Next-Router-State-Tree" AND header:"RSC" ⸻ ✅ 6. BINARYEDGE QUERY http.response.headers.vary:"Next-Router-State-Tree" ⸻ ✅ 7. QUERY headers:"Next-Router-State-Tree" && headers:"RSC" ⸻ 🎯 8. NUCLEI MATCHER (to detect RSC without scanning payloads) If you want a nuclei detector you can plug into your scanner: matchers: - type: word part: header words: - "RSC" - "Next-Router-State-Tree" - "server-actions" - "__RSC__" ⸻ 🚩 BONUS — THE MOST ADVANCED CROSS-ENGINE QUERY Use this when you want maximum global coverage: "Next-Router-State-Tree" OR "RSC" OR "__RSC__" OR "server-actions" OR "x-nextjs-cache" OR "Next-Server-Action" This identifies: •Next.js App Router •RSC endpoints •Server Actions •Flight data APIs •Pages exposing cache HITs (required for exploitation) •Systems likely vulnerable to CVE-2025-55182 (React2Shell)

X

10,469 次观看 • 6 个月前