开发者生态
morning
固体2.0
2026-11-18
1 阅读
约9分钟阅读
pier25
字号:
5年对于任何事情来说都是很长的时间。 It took 5 years from my first commit of Solid to 1.0, and it's been another 5 since then. 5年里发生了很多变化。 Solid 1.0 made a bet that fine-grained reactivity, signals, was the right foundation for building user interfaces.在当时,这是一个不寻常的职位。如今,信号无处不在。 In Angular, in Svelte's runes, in Vue Vapor, and in a proposal before TC39 to put them in the language itself. It even pushed the conversation into React's compiler. More recently that conversation has shifted to AI, arguably an even larger change in how we build. But Solid has always been about building the right things;性能的东西。 So for us the mission hasn't really changed all that much. The things that we identified as standout about our approach still stand out now. But instead of living in the shadow of more popular solutions Solid 2.0 carves out a path that others can follow.这次是故意的。今天该解决方案达到稳定。如果细粒度反应性的最大优势是了解应用程序的形状,那么这种知识不应该随着流程或代码运行的机器而结束。真正的应用程序是分布式的。 Real applications are born from data that lives on a server. The coordination of these pieces should be intentional and by design.首先将异步引入图表中。 A computation can return a Promise or an async iterator, and everything downstream just understands: function Profile ( props ) { const user = createMemo (() => fetchUser (props.id)); < Loading Fallback = { } > < h1 class = {{ stale : isPending (user) }} > { user ().name} h1 > 这允许按可供性进行创作,同时自动处理竞争条件。 The introduction of async doesn't cause an app refactor.推测状态会自动回滚,无需手动编写流程,确保服务器保持真实的权威。 SolidStart introduce the world to server functions in early 2022, and now they have found their way home to Solid's core, better than ever. Not only do they support highly capable RPC calls over Request/Response but persistent connections over Server Sent Events. And consuming it remains as simple as the code below. import { live } from "@solidjs/web/server-functions" ; const stockPrice = live ( async function* ( symbol : string ) { for await ( const tick of subscribe (symbol)) yield tick.price; const price = createMemo (() => stockPrice ()) This is only the beginning of what can be done with Server Functions and we will be announcing some new features (like reactive Server Components) in coming weeks that leverage this capability. "But, we aren't writing the code anymore!" We hear you. A system built on constraints by construction ends up with less code to maintain and less edge cases. What used to be considered a DX shortcoming of reactive frameworks are now their greatest strength. And Solid 2.0 goes all in. Every framework now says it "works great with AI", and usually that means models have seen a lot of it. That's a statement about training data, not about the framework. The question that matters is what happens when the agent gets it wrong. In most frameworks a reactive mistake is silent. The app runs, it's just wrong, Solid 也无法告诉你,因为它也看不到它。Solid 2.0 的开发版本可以准确地知道所读取的内容、位置以及将要更新的内容,并使用稳定的代码、源代码中的位置以及修复:[STRICT_READ_UNTRACKED] 在效果回调中直接读取的反应值不会更新。在 › - › 效果在 http://localhost:5173/src/It
这篇文章对您有帮助吗?
订阅66必读
每日精选科技资讯,直达你的邮箱