I have often wondered if the nice things provided by Angular.js can be provided in a simpler interface and Sentinel.js is the result of my attempts to do so. I need someone to take a look and tell me how much I have succeeded.
This is a small timetracking app for freelancers, that only uses html and javascript that I created using Sentinel.js. It uses local storage to store the data.
It does look simpler but could it be because there are less functionalities and it is less extensible? won't be enough to be called an alternative. I voted up though because I still think it's cool. Hope to see it grow further.
>It does look simpler but could it be because there are less functionalities and it is less extensible?
Yes, probably. But these are my thoughts
1) How Important are the missing parts. For eg, I think you can define custom directives in angular.js. You can't do that with Sentinel.js. But can this be still useful without that feature? What I have tried to do is to minimize the number of 'things' that one needs to learn, by providing more powerful constructs. For eg, angular have ng-even and ng-odd directives to distinguish between even and odd iterations for a repeat loop. But in Sentinel.jS, you can give "sn-computed-" prefix for an attribute, and that attribute value will be evaluated and bound to the given expression. So you can cover a lot of cases with this feature that angular.js cover with a lot of directives.
2) Can we add those missing parts without sacrificing its simplicity. For eg, Dependency Injection. May be we can add it without making it a lot more complex.
Pardon me calling it as an alternative to angular.js. I just couldn't find another way to convey what it does under 80 characters. I know all of these are kind of naive. I know I am a nobody, and there is no way I can be right about these things. But those are my thoughts. Please correct me where I am wrong....
No, React does internally, for the purpose of its diffing algorithm (which is subject to changes). React's public facing API does not use data-* whatsoever.
As a matter of fact, storing user data in data-* attributes is unnecessary in React. Just like graphics programming, you're better off storing vertices data in the data structures themselves, not in the final onscreen output of the vertices.
Indeed. I don't believe the GP implied that the data-* had to be user data to count. In fact, the way data-bind is used in Knockout isn't really user data either. You'd store that on the view model, not in a data-* attribute.
I don't think you do, that's why it's called Vue (View). Think of it more like Ractive or React - it's just the presentation layer, with 0 opinions about your routing or state management layers (as it should be, IMO).
No. But why do you need that bundled with something like this? You got two way data binding, so use a separate routing library to read routes off the url and change a variable in the bound scope, and let the DOM update accordingly.
If you're looking for a dead-simple routing library for the client, allow me to shamelessly plug the one I wrote: https://github.com/notduncansmith/trails. I'm using it in conjunction with Rivets.js and Viewmaster.js in a framework I'm working on.
I don't really understand why there is a need to simplify something like AngularJS. Kudos for building something but I'd rather stick with the battle tested version thanks. If you're building a single page app then the initial payload isn't a big deal anyway, so I don't really care if it's a few KB less.
Your simple example is (IMO) more complicated than the AngularJS version, and Sentinel JS requires Jquery:
> Kudos for building something but I'd rather stick with the battle tested version thanks...
Thanks. And what you say is only reasonable. I wouldn't imagine Sentinel.js to be any where near as stable as Angular.js. I rewrote the whole thing three times, to get the code in a manageable form. There are tests that cover most of the functionality. Since there are only a handful of directives, there are actually less 'moving parts' than something big like angular.js. But still, there are a lot of things that can go wrong for some combination of directives.
And can you please tell me which example you found more complicated than the angular version? Also can you think of any use case that something like this would fail to meet?
If you are looking for a templating/data-binding solution that works like Angular.js, but without all the framework stuff. You can actually use Angular.js for it.
All you have to do is get yourself a "scope" from Angular.js, which is linked to a DOM-Node, and you are good to go.
You can use my code [1], which will do this for you.
26 comments
[ 4.3 ms ] story [ 61.1 ms ] threadThis is a small timetracking app for freelancers, that only uses html and javascript that I created using Sentinel.js. It uses local storage to store the data.
http://imakesnowflakes.com/ceasium/Ceasium.html
Yes, probably. But these are my thoughts
1) How Important are the missing parts. For eg, I think you can define custom directives in angular.js. You can't do that with Sentinel.js. But can this be still useful without that feature? What I have tried to do is to minimize the number of 'things' that one needs to learn, by providing more powerful constructs. For eg, angular have ng-even and ng-odd directives to distinguish between even and odd iterations for a repeat loop. But in Sentinel.jS, you can give "sn-computed-" prefix for an attribute, and that attribute value will be evaluated and bound to the given expression. So you can cover a lot of cases with this feature that angular.js cover with a lot of directives.
2) Can we add those missing parts without sacrificing its simplicity. For eg, Dependency Injection. May be we can add it without making it a lot more complex.
Pardon me calling it as an alternative to angular.js. I just couldn't find another way to convey what it does under 80 characters. I know all of these are kind of naive. I know I am a nobody, and there is no way I can be right about these things. But those are my thoughts. Please correct me where I am wrong....
As a matter of fact, storing user data in data-* attributes is unnecessary in React. Just like graphics programming, you're better off storing vertices data in the data structures themselves, not in the final onscreen output of the vertices.
It's one of the fastest out of all the frameworks, solid documentation and very easy to use.
http://vuejs.org
Which part?
Your simple example is (IMO) more complicated than the AngularJS version, and Sentinel JS requires Jquery:
https://angularjs.org/
Please correct me if I'm wrong, just don't see the benefit of using this over AngularJS, you're ultimately going to want more functionality anyway.
Thanks. And what you say is only reasonable. I wouldn't imagine Sentinel.js to be any where near as stable as Angular.js. I rewrote the whole thing three times, to get the code in a manageable form. There are tests that cover most of the functionality. Since there are only a handful of directives, there are actually less 'moving parts' than something big like angular.js. But still, there are a lot of things that can go wrong for some combination of directives.
And can you please tell me which example you found more complicated than the angular version? Also can you think of any use case that something like this would fail to meet?
All you have to do is get yourself a "scope" from Angular.js, which is linked to a DOM-Node, and you are good to go.
You can use my code [1], which will do this for you.
[1] https://github.com/julius/AngularLite
Sorry sir, you may have heard about angular.js but you don't understand it at all.
Well, there are directives, but not custom ones...