Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Ity – A miniscule, depedency free JavaScript MVC (github.com/dcocchia)
12 points by dominic_cocch on May 21, 2015 | hide | past | favorite | 10 comments



Why?

- Tiny footprint for mobile networks (~5kb minified).

- Extremely fast DOM query/selection engine. No need for jQuery!

- Mobile first - no legacy hackery for ie < 10.

- Great for spinning up small, mobile-specific apps.

To Do

- More useful event delegation. Currently, views must call _setElement() every time they render new DOM elements

-Currently no router for fancy SPA style urls

Installation

npm install ity


Just a note as you've made this typo in a few places -- it's "dependency" not "depedency" as you have in your title here as well as Github project description and in your README.md


Whoops! Fixed in the repo now.

I can't seem to edit the title of the HN article anymore. Must be past a certain time or something.


This is really interesting. I guess the part that confuses me is using the "View" to do traditional controller-esque things. At least in the example, that is how it looked. Would you be able to explain that choice?


Yeah, I think the example itself is not a great pattern. :) If I were to redo that example, or do another example completely, I'd probably move a lot of that logic stuff into the model.

It's possible I'll add a more traditional 'controller' to the mix at some point, but I mostly wanted a similar structure to that of Backbone, without the need for jQuery/underscore.


It's just odd for an MVC framework to not have a 'C'. Generally, your view would just generate HTML, the controller listens for events and responds to them by updating the view and model. Here, your view is taking over that responsibility.

For how small the library is, this is pretty fantastic though. Significantly smaller than Backbone for similar syntax.


Calling it an MVC may be a misnomer, definitely. I know backbone often refers to itself as MV*, which is sort of funny. :)

Thanks for checking it out! I'll put some thought into the 'C' aspect of this thing.


Neat project! However, in reality I'd probably just use Backbone if I wanted this kind of architecture because of the wealth of knowledge and support for it on the web.

What is the main advantage of this over Backbone?


Yeah, for sure. I mostly started this to see if I can get a Backbone-like MVC without the heavy dependencies of jQuery/underscore/lodash/etc. The DOM selection stuff is also done relying much more heavily on native calls, so it should be much faster than jQuery at most DOM manipulation stuff. It doesn't have much/any browser support hackery built in.

For most of my work, I'll also be sticking to Backbone or something more supported/fully-featured. But I do have tinsy projects here and there that are mobile-focused one-offs that work really well with something like this. I found myself recreating this thing over and over, so I figured I'd just standardize it for me and see if anyone else felt the same need. :)

Thanks for checking it out and for the feedback!


looks tiny. great!! I'll use it in my next toy project to test it out.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: