
Show HN: Sentinel.JS - The simplest alternative to angular.js - imakesnowflakes
https://bitbucket.org/sras/sentinel.js/overview
======
imakesnowflakes
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.

[http://imakesnowflakes.com/ceasium/Ceasium.html](http://imakesnowflakes.com/ceasium/Ceasium.html)

------
jwblackwell
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:

[https://angularjs.org/](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.

~~~
imakesnowflakes
> 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?

------
threeseed
This actually looks more complicated that VueJS. Which I would highly, highly
recommend.

It's one of the fastest out of all the frameworks, solid documentation and
very easy to use.

[http://vuejs.org](http://vuejs.org)

~~~
Kiro
How do you handle routing in VueJS?

~~~
notduncansmith
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).

------
julius
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.

[1]
[https://github.com/julius/AngularLite](https://github.com/julius/AngularLite)

~~~
imakesnowflakes
Yes, that was what I had in mind when I made this. Will try AngularLite now.
Thank you for sharing.

------
SchizoDuckie
So you have no directives, no routing, just 2 way data binding.

Sorry sir, you may have heard about angular.js but you don't understand it at
all.

~~~
imakesnowflakes
>So you have no directives, no routing, just 2 way data binding..

Well, there are directives, but not custom ones...

------
BPm
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.

~~~
imakesnowflakes
>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....

------
marcoms
Why does no client-side framework beside Knockout use data-* attributes?
Whyy??

~~~
skrebbel
React does.

~~~
chenglou
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.

~~~
skrebbel
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.

------
Kiro
No support for routing?

~~~
imakesnowflakes
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.

~~~
notduncansmith
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](https://github.com/notduncansmith/trails).
I'm using it in conjunction with Rivets.js and Viewmaster.js in a framework
I'm working on.

