alpinejs / alpine

A rugged, minimal framework for composing JavaScript behavior in your markup.
https://alpinejs.dev
MIT License
27.95k stars 1.22k forks source link

Project goals/ motivations #50

Closed thiagomajesk closed 4 years ago

thiagomajesk commented 4 years ago

You get to keep your DOM, and sprinkle in behavior as you see fit

This project reminds me of KnockoutJs and StimulusJs (both which I'm a big fan). So I got curious to know a little bit more about the motivations behind it.

For someone like me, that likes the "traditional" approach of server-side rendering and progressive enhancement instead of javascript-centric applications is very interesting to see other frameworks providing this kind of experience to kinda "fill jquery's shoes".

Can I assume that this project relates to both ko and stimulus in regards of not trying to take control of the whole app and instead is meant to be used with a server-side rendering approach (or something like that)? And if so, what are the main differences from those aforementioned frameworks?

PS: Also, it seems that there's some hint of integration with turbolinks and wanted to ask if there are plans to integrate with unpoly as well.

calebporzio commented 4 years ago

Hey @thiagomajesk, great questions.

I definitely need to add some of this in the README at least, but I'll start right here:

In my mind, Alpine shares the same philosophy and values as Stimulus, but IMO has a much better aesthetic, and a more declarative API.

It definitely is prime for server-rendered apps (which are my favorite to write too instead of complex SPAs or solely-JS frontends).

Its architecture is super flexible, so you can manipulate the DOM insode an Alpine component and it will adjust to the changes (unlike something that uses a v-dom like Vue or React (or even Knockout I believe)). You can even just add new Alpine components in a page using whatever you like, and they will automatically be initialized.

Alpine supports Turbolinks out-of-the-box. No need to hook into the TL listeners and restart or anything.

No plans to explicitly support Unpoly as of right now, but I'd be open to a docs section containing a little code snippet to add support on a per-project basis.

Hope this clears some things up.

Would love feedback on what things I've just communicated that aren't apparent or I should highlight in the docs or whatever.

Thanks!

thiagomajesk commented 4 years ago

Hey, @calebporzio thanks for the response 😊. I have to say that I'm very happy to find this project, mostly because I've been dabbling js frameworks for quite some time without finding the "right fit" for my workflow (I'm not a SPA-guy either).

I guess that the things you described are on point with my first impressions of the framework. What confused me a bit was the comparison with Vue and React right up front, so it was not clear for me how much of the goals were also shared by Alpine.

No plans to explicitly support Unpoly as of right now, but I'd be open to a docs section containing a little code snippet to add support on a per-project basis.

Nice! Maybe providing docs or guidelines will open the door for future contributions or plugins (it seems that Unpoly is a rather popular alternative to Turbolinks these days).

Besides that, I'm very excited to do something with Alpine (I'm considering using it in my next project already) 🙌