HTML js - A new MVVM framework

202 views
Skip to first unread message

Nhân Nguyễn

unread,
Apr 29, 2014, 9:07:56 PM4/29/14
to ang...@googlegroups.com
I'm delighted to announce that I've finished my MVVM framework. It's still in beta version however it'll release soon. You can download at HTMLjs.
I'm sorry for announcing publishment here because I haven't created a website for the framework. You can contribute to the framework now by contacting me.

This framework is similar to Angular data-binding but 6-7 times faster, it's even faster than browser's rendering processing because it only uses pure javascript code; no thing such as template and strange attibutes like ng-model or data-bind. Hopefully, Angular team will take a look a my implementation to see how fast it is and use my appoach to make Angular more beautiful. See meal reservation example in examples folder. You can take a look at the API, it's very beautiful and comprehensive for those familiar with Knockout js.
Note that I use HTML.data instead of ko.observable and ko.observableArray and also ko.computed. And you must use each function within a container (e.g a div tag).

Code sample

var vm = new ReservationsViewModel();

HTML.render(document.body)
.h2('Your seat reservations ').span(vm.seatNum).$().$()
.br()
.button('Add seat').click(vm.addSeat).refreshChange(vm).$()
.br()
.table()
.thead().tr().th('Passenger name').$().th('Meal').$().th('Surcharge').$().$()
.tbody()
.each(vm.seats, function(seat){
HTML.render(this)
.tr()
.td().input(seat.name).$().$()
.td()
.dropdown(vm.availableMeals, seat.meal, 'mealName').refreshChange(seat, vm).$()
.$()
.td().span(seat.formattedPrice).$().$()
.td().a('Remove').click(vm.removeSeat, seat).click(vm.f5).$().$()
.$()
})
.$()
.$()

Darlan Alves

unread,
Apr 29, 2014, 9:48:55 PM4/29/14
to ang...@googlegroups.com
Dude, nice try, however you are sooo out of context here.

I've ran your tests, trying not to be petulant. Your performance test, that adds a bunch of lines to a list, actually rendered faster than AngularJS ng-repeat. However, none of the lines have live bindings, so nope, it's not better.

And I've read your code too. Now that's a crazy shit. You don't even think about unit testing, do you? You cleary come from a jQuery background, since you use the same ".fn." syntax.

Also, beautiful API? Nope.
I am a experienced AngularJS dev, and I love the way it works. No way I'd leave the awesomeness of Angular for a bunch of chained Javascript calls just to make a template. HTML is for markup, JS is for behavior. Don't mix things!


"because it only uses pure javascript code; no thing such as template and strange attibutes like ng-model or data-bind."

Yeah, AngularJS is written in Java, compiled to Fortran and runs on a IBM mainframe. No Javascript at all.

So, my opinion: nope, not, nein, não.

Nhân Nguyễn

unread,
Apr 30, 2014, 1:04:31 AM4/30/14
to ang...@googlegroups.com
Hi Darlan Alves,

Thanks for your feedback. I have fixed that bug, now the example has live data binding, sorry for that. You can see meal reservation example. it's similar to Knockout meal reservation example.
About the API to create HTML, I can tell you that you can seperate the View and the Model easily. In my example, from HTML.render().... is the View. The View should be placed in another file. The Model you made never mix with the View.

This project is really serious, not a try. I'm very pleased to get your feedback so that I can improve the framework. But again, this framework is serious.

system

unread,
Apr 30, 2014, 1:15:45 AM4/30/14
to ang...@googlegroups.com
You've made my day.

Even when it was 29 days late :)

Nhân Nguyễn

unread,
Apr 30, 2014, 7:56:42 AM4/30/14
to ang...@googlegroups.com
Hi Darlan Alves,

Have you came back to see my update? I've added some unit tests and now no memory leaking in the lib.

Douglas Lira

unread,
Apr 30, 2014, 9:18:40 AM4/30/14
to ang...@googlegroups.com
I agree with Darlan in degree, number and gender. You was daring on their part, say that it is better than the AngularJS. But you were brave at least tried.


2014-04-30 8:56 GMT-03:00 Nhân Nguyễn <nhan....@gmail.com>:
Hi Darlan Alves,

Have you came back to see my update? I've added some unit tests and now no memory leaking in the lib.

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Atenciosamente,

Douglas Lira
"No que diz respeito ao empenho, ao compromisso, ao esforço, à dedicação, não existe meio termo. Ou você faz a coisa bem feita ou não faz."

Douglas Lira

unread,
Apr 30, 2014, 9:23:35 AM4/30/14
to ang...@googlegroups.com
And more... I for one would not use this framework, for several reasons: 

1 - Not friendly 
2 - Writing is not clean 
3 - I'm sure it would not perform 

These were the basic reasons ...

Nhân Nguyễn

unread,
Apr 30, 2014, 10:26:32 AM4/30/14
to ang...@googlegroups.com
Hi Douglas Lira,
 
Have you taken a look or tried to run my performance test, my unit test also?

If you say no, please don't say that it doesn't work. At the first time commit, I created some mistakes but now I improve it a lot.
Just take time to see and run.

Note that I didn't say that I'm better than Angularjs because Angular provide hundred of features, I just say that my framework render faster than Angular.

Douglas Lira

unread,
Apr 30, 2014, 12:01:23 PM4/30/14
to ang...@googlegroups.com
Hi Nhân Nguyễn

Really have not seen his new post, but I'll take a look. I think you were brave to do something like that, that's good. I saw the code and did the tests, I will contribute when I can and have time.


--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages