by ryansolid · 2w ago · 0 comments
I think we will see more of this. Frameworks have been "languages" for years. Rich Harris of Svelte saw that. This is exactly the remaining gap right now. Peeling away the layers is also peeling away the guard rails. You can add those back with rigor of testing. But huge benefits to just encoding our learnings in the language itself.
Yeah that's what I mean.
A lot of my react components start out with the equivalent of
if (state==error) return <p>error</p>;
if (state==loading) return <p>loading</p>;
if (!connection) return <p>offline</p>;
if (admin) return <Redirect/>;
doing that with <Show /> (and passing the function so TypeScript still works) means the conditions take 20 lines instead of 4, and the meat of my component is indented an extra 8 levels.