短评 · ·

X 归档 2025-04-02

10 条动态 · 图 4 · 视频 3
Pro tip: `history.replaceState` works as a perfect `structuredClone` polyfill! 🔥

Key facts:
- Deep clones objects exactly like IndexedDB/MessageChannel but synchronous
- Main thread only, but covers 90% use cases
- Beats 8KB npm polyfills! [🚀][🐶]
小贴士:`history.replaceState` 可以充当完美的 `structuredClone` polyfill!🔥

关键事实:
- 像 IndexedDB/MessageChannel 一样深拷贝对象,而且是同步的
- 仅限主线程,但能覆盖 90% 的使用场景
- 秒杀 8KB 的 npm polyfill![🚀][🐶]
ts polyfill:

const structuredClone =
globalThis.structuredClone ??
(<T>(data: T): T => {
const oldState = history.state;
history.replaceState(data, "");
const clonedState = history.state;
history.replaceState(oldState, "");
return cloneState as T;
});
ts polyfill:

const structuredClone =
globalThis.structuredClone ??
(<T>(data: T): T => {
const oldState = history.state;
history.replaceState(data, "");
const clonedState = history.state;
history.replaceState(oldState, "");
return cloneState as T;
});
Native Observables are already in the stable version of Chrome! (v135)
原生 Observables 已经进入 Chrome 稳定版!(v135)
@eugeniyoz 的配图 1/1
Tutorial🔴🟣🔵
How to design and animate a rolling chrome ball in @figma .
-
Lets dive in!🧵:
教程🔴🟣🔵
如何在 @figma 里设计并动画一颗滚动的电镀金属球。
-
一起开搞!🧵:
You can put SQLite in the browser now? Yeah, here's how 👀
现在可以把 SQLite 放进浏览器了?没错,做法如下 👀
Had an early adopter trying out rolldown-vite in a huge production app with 12k modules and found the build slower than current Vite.

The team identified the cause and suggested a few tweaks, now it's almost 5x faster than current Vite! (55s -> 11.74x) 🚀
有位早期用户在拥有 1.2 万个模块的超大生产应用里试用 rolldown-vite,发现构建比现在的 Vite 还慢。

团队找出了原因并给出几个调整建议,现在它比现在的 Vite 快了近 5 倍!(55s -> 11.74x) 🚀
This guy literally collected 300+ MCP servers and open-sourced them
这哥们真的收集了 300+ 个 MCP 服务器并开源了
@aaditsh 的配图 1/1
ByteDance just dropped MegaTTS3 on Hugging Face
字节跳动刚把 MegaTTS3 放上了 Hugging Face
@_akhaliq 的配图 1/1
I believe package:heroine is shaping up to be one of the best ways to build fullscreen Container Transform transitions. I wanna refine it some more, so it's a prerelease for now, but check it out!

https://pub.dev/packages/heroine/versions/0.5.0-dev.2

#FlutterDev
我认为 package:heroine 正在成为实现全屏 Container Transform 转场效果的最佳方案之一。我还想再打磨打磨,所以目前还是预发布版,快去看看吧!

https://pub.dev/packages/heroine/versions/0.5.0-dev.2

#FlutterDev
Native Observables are already in the stable version of Chrome! (v135)
原生 Observables 已经进入 Chrome 稳定版!(v135)
@eugeniyoz 的配图 1/1