|
|
|
|
|
by rolae
2315 days ago
|
|
While the spirit of using a simple library for javascript sprinkles to enahnce your app is similar, stimulus.js and alpine.js are quite different: Alpine.js has the x-data property, to keep state that you can manipulate, in stimulus all state is directly in the DOM. So for example to make a modal with stimulus, you would add a class to show a hidden overlay. In Alpine you would use a x-show property, that reacts to a change in the data of the component. So the big difference is that alpine has a reactive data context as a first class citizen. In a way it is actually much more similar to AngularJS 1.x than to stimulus, with the idea that it is really intended only to be used to enhance existing html, not to build whole apps with it. |
|