Post

I've open sourced Ripple! github.com/trueadm/ripple It's super early days, not much works and there's little to no documentation or guidance. Plus the codebase is raw, but I at least wanted to share my ideas with the community. :)

github.comGitHub - trueadm/ripple: Ripple is a TypeScript UI framework for the web.Ripple is a TypeScript UI framework for the web. Contribute to trueadm/ripple development by creating an account on GitHub.

17 reposts94 likes

I like a lot of the syntax changes you’ve made. My one suggestion would be get rid of the {} from inside JSX tags and just assume everything is JS. The syntax reminds me of what I proposed with lightningscript.dev

I never intended to actually implement the language and was hoping someone else would do it, but I’ve started some work on it recently as an attempt. Let’s see if I can actually make it happen.

Someday I really want to see a JS framework use a syntax similar to Swift result builders instead of JSX component App { let $count = 0 div { div { "Count: " $count } button( type: "button", onClick: () => $count++ ) { "+1" } } }

100%, and I started with a very similar style but it just doesn't get any love from the people I showed it to. The common complaint, which I don't buy, is that the closing element makes it more readable.

Im probably alone on this but I would rather write <elm>{()=>{ switch (x) { ... } }}</elm> And get out-of-the-box IDE/web support for the syntax, than <elm> switch (x) { ... } </elm> and need custom tools. Mostly because I'm a tooling/config minimalist.

Ripple has support for the IDE with an extension that provides it all too. This makes for some other nice things, like try/catch/async and other stuff I've not yet documented for handling async

That's kinda my point, I don't want to install an extension to get syntax highlighting 🙂. Also won't work for GitHub/gist web. I know that with enough adoption things can end up being built in, but that has the chicken and egg of adoption being hindered by not working with existing ecosystems.

What's the motivation for Fragments? Their transform looks almost the same as a Component. If it's primarily a performance thing, I wonder if the transform could do this automatically instead of needing the explicit concept.

I've heard that feedback before, they're a way of creating JSX anywhere – as components can only be top-level in a module due to supporting styling via <script>

However, fragments are really useful for `<Component>` cases as forming the children prop to pass through (or $children in Ripple's case). We can't bass JSX as expressions, and you can't pass around statements, so it makes fragments required in these cases – just like Svelte 5's snippets.

Are they interchangeable? Here, in Svelte, is an issue that you cannot mount a snippet and @render a component, which often introduces extra friction. I personally think we should make them interchangeable, but it is a breaking change.

How funny! You’re the one who snagged the "ripple" NPM package! No joke, I was working on component model I was calling Ripple earlier this summer that has a *shockingly* similar shape to your ripple. I really love how much further you pushed the syntax tho, esp the native JS control flow!

Pretty interesting! I’m curious what the design purpose of how the JSX like syntax works within a component (not returning it). is there a reason or is it purely personal preference?

You don't return JSX-llike template as they are statements now, not expressions and you can only return expressions. The templating is immediately rendered from top-to-bottom.

This is really cool! Looking at the source code, I can definitely see how Svelte influenced it 😄 You said in your other post that it doesn't use signals, what does it use? The code looks very signal-esque...

Dominic Gannaway@trueadm.dev

I've had so many folks ask now, that I had to go for it. You asked me to build that ideal Inferno X framework that I described ages ago, so I went ahead and did just that. I built something that actually works and, well, it works well. Oh, and doesn't use signals!

It's a purely pull system. Only tracked contexts have dependencies using a versioning system. Sources have no knowledge of the things they affect downstream.