Skit – I built another JavaScript framework
medium.com
medium.com
We have skit sitting on launchkit.io, with a REST API in Django sitting behind it (serving prelaunch native mobile clients from api.launchkit.io).
Logged-in requests that load data hit the API first from node, using the same JS API client that runs in the browser. The logged-in user cookie is actually an encrypted OAuth token from the backend API, so our website is actually a first-class API client just like our mobile apps. No separate session logic, etc.
I prerender the first results in the "reviews" list using a template on the server, then when you scroll down the list the additional items are loaded and rendered with the same template in the browser. It seems weird/foreign but in practice it's not that weird.
So far it's been fun, and honestly it's worked far better than I expected it to when I started tinkering.
Would love any feedback / etc., here or on twitter @taylorhughes
(Also serving all the CSS/JS on the page itself would be fairly easy with the way skit works — the other stuff I mentioned is farther flung.)
http://stackoverflow.com/questions/19352976/npm-modules-wont...
Otherwise, it looks very promising!
First criticism, this:
events.listen(dom.get('.thing'), 'click', function() {
That is a longer way of saying
$('.thing').on('click', function(){
Which could really just be:
on.click('.thing', function(){
As in, make the most common things more concise. Your current way isn't bad at all; it's just longer than it needs to be. Could be reorganized, I think.
Similarly, in jQuery, the most common function call is one character that's obvious if you mess up. You don't have to go to such extremes as `$`, but you should think about that sort of thing when you're designing APIs, imo.
I think there's a lot of space in the frontend arena for a convention-over-configuration frontend framework that ties in ES6 & jsx transforms, jshint, css bundling, sourcemap generation, and production bundling & minification in a nice way with sane defaults and strong conventions.
That way I don't end up using http://octo-labs.github.io/snowflake/ for every JS project.
At the same time, I feel like this could have been done with just a plugin to some existing framework instead of creating just another. But that's just because I am losing track of everything that is out there.
I tend to think it's because this stuff gets too complicated in a hurry, so you kind of need a more structured framework around it. But who knows.
I can completely agree though that it gets far too complicated far too fast, and doesn't easily solve the problems it is written to solve.
FWIW your framework makes me think of a modern backbone.js. I'll try and find some time to take it for a spin sometime soon. Good luck with it!
I bet it's awesome though.
Skipped unit testing didn't you? Uncle Bob Martin would be upset with you.
Without tests, someday you'll be afraid to change Skit as well.