Tuxedo.js – A Framework Built on React and Flux
tuxedojs.org
tuxedojs.org
(I might have the details wrong but here's the flavour)
Backbone was a good start - Ember and later angular offered to fulfil a genuine need but after a long period of bedding in, many people have become dissatisfied with them.
React (and a few similar frameworks that appeared around thw same time) turned everyone's head and seemed to offer a much better way forward. However it was only part of the jigsaw. It can be described as the V in MVC with some suggestions on the right way to add the M and C ('Flux').
So - what we're seeing now is a lot of people who've had time to digest React+Flux and are releasing a complete MVC package that incorporates all the lessons learnt. Consider how long we had the "just use jQuery" phase of front-end development. It's just time for pendulum to swing back the other way.
This has many benefits like code reusability and not having to write placeholders/render code twice -- in two different languages.
Furthermore, I'm not convinced it's a good thing to blur the lines between client and server. Or in other words, I think it's a good thing for the developer to be thinking about the differences and the ramifications of code on the client vs. code on the server. The whole thing reminds me of the EJB days, where we were sold on the idea of not having to think about the implications of local vs. remote objects. In reality, no matter how you hide it in the syntax, those kinds of distinctions have consequences, and treating client code like it's server code or vice versa just seems like a bad idea to me.
Keep it DRY. Write once, run everywhere. Bearing in mind you have to write the application once in Javascript, it's a counter-proposal to "being able to work in the language of my choice on the server", which is to use the 1 version.
"When building complex front-end apps frameworks help."
doesn't imply:
"Everything on the web should pretend it's an app"
My sweet-spot is is pjax, progressive enhancement and "let's pretend some people have javascript turned off so we can maintain a sane architecture without having to explain why"...
But - some things that run in a browser ARE apps and need some support beyond jQuery et al.
Sometimes they are useful though. For instance, they make sense when routing. But in those cases, they should more like libraries as well: more lightweight. Something like Express or Koa.js but more lightweight.
Some are pioneering-friendly others just-doing-the-job-friendly.
Nothing static, all oscillating in a big Cambrian Explosion of JavaScript creativity
People say this a lot, and it makes me wonder if they've ever worked on a team working on the same codebase. And if they do, what secret sauce they're drinking to not go insane.
In my experience, when people on a team use libraries at their whim, the coding styles diverge wildly from feature to feature. One person decides they're going to write all their AJAX callbacks in an anonymous function; another likes to reference a function directly; another likes to both; and yet another uses promises.
And as soon as someone needs to fix someone else's project, they do some combination of (a) getting wildly frustrated with this other coding style, (b) rewire their mental model to adapt to this new style, (c) spend a week rewriting it in their own style, (d) introduce a ton of bugs in the process, or (e) by some miracle, get it to work perfectly.
So to combat this, the team works out coding standards and a style guide. You must tab with two spaces! You must pass a real Javascript function to your callbacks! You must separate your state from your view!
And of course, once your style guide is big enough, lo and behold: you have your own hand-rolled framework. And hopefully it's tight enough that everyone writes in the same style, but is still expressive, and is still simple enough for a new team member to learn quickly.
So if you're just starting a codebase, it makes complete sense to pick a framework on the outset because people have already gone through that headache for you.
The 'don't use frameworks, use libraries' argument is naive, and just does not hold up in the real world of teams trying to build things.
If I'm using Backbone over Ember, my style guide has to cover things that would be covered by Ember's own docs, for example how to compose views, how to do nested routing, how to represent computed properties ...
Your longer style guide is defining code patterns for those use-cases. Your longer style guide is a framework, just more verbose because you aren't actually abstracting away those patterns.
I generally disagree with the sentiment that collections of libraries are somehow inherently a better solution than frameworks, though. I just think that it is probably a poor solution to the problem you describe here.
There is no perfect framework and by choosing one you're usually stuck with its warts for the long haul. I usually find that I'm bending my code to fit into the framework conventions that I don't necessarily agree with.
With ExtJS for example, the framework conventions dictate your project should be organized into folders like this:
controllers/
models/
views/
...whereas I prefer controllers, models, and views, which are coupled, to be located in the same folder and models which are intended to be shared to be explicitly in a shared folder.Another example (still ExtJS!) is that I never agreed with ExtJS's MVC implementation - where its controllers were global for all instances of a view. It took Sencha several years before they fixed this by adding "ViewControllers" in ExtJS 5.
If ExtJS was not an all-encompassing framework I would have liked to use its UI components with a different MVC library (or simply vanilla JS) organized into my preferred project structure. I suppose it's still possible to do this but with frameworks you tend to not want to deviate too much from the framework conventions or things start to go wrong.
One could argue that the arms race between Prototype, Dojo, YUI etc from the last decade was a race of incremental solutions and one-upmanship, and jQuery largely stood out from the crowd by having extremely well thought out developer ergonomics.
I think that the ideas behind React/Mithril/Mercury (composability, unidirectionality, etc) are, as jQuery UX was at the time, a "leap out of the box" in the frameworks' arms race, but I feel that frameworks like tuxedo are again settling into the territory of being merely stabs at incremental improvements.
The main problem I see here is that it's not particularly obvious what kind of problem this framework solves. Virtual DOM frameworks are hot because they help solve problems. In contrast, it's hard to sell features.
* "I'll go with Angular since it's supported by Google"
* "When I'm not sure which library to use, I just choose the one with the most commits"
* "I'll just choose something with the most features in case I need them"
The upshot is that incremental, monolithic solutions get selected over and over because they're easiest to digest and usually supported by a well-known entity with lots of capital (lol meritocracy).
Ultimately, OSS is a poor vehicle for R&D because the market is every bit as dysfunctional and short-term-gain-seeking as the real market. Very strange.
I have never seen anyone use that logic.
If the last commit is months old, you should be careful. If it is years old, you should stay away from it. (Example: The original Qmail mailserver was rock solid and djb's masterpiece of security. But you had to add custom patches for even basic features such as SMTP Auth. Why? Because at the time Qmail was written, SMTP Auth wasn't common yet.)
If the author then says that this is not due to lack of time, but because the software is "ready" / "done", this is an even worse sign. (Yes, I'm looking at you, Tilecache.)
It is very difficult to know a priori whether something will really alleviate a pain point, or whether it just seems like it will. The ability to do that successfully most of the time is one of the great advantages of experience.
Even worse, it's basically impossible to predict the future evolution of community support for a given project, but support from a company that can pay salaries and is not itself going anywhere is one of the best positive indicators of longevity and maintenance (though it says little of quality).
My biggest problem is I don't want to invest time anymore keeping up with the latest technology fad. I still write Perl code for this very reason, I invested the time, and it's "good enough" for most problems.
The second biggest problem is the maintenance of software developed using a fad technology. As often happens when I've used something cool it ends up biting me in the ass when a year or two down the line I have to go back and make code changes and the framework/library is no longer maintained, breaks in newer browsers, etc. because people have moved on to something newer and better.
I seriously question the long-term return on investment using new web technologies these days and am very apprehensive about willy-nilly investing time learning and using them until they've gained a significant amount of traction.
I'd reduce this to "some lessons learnt".
While some people build frameworks based on React+Flux, other poeple still think these frameworks are larger than they should be, and provide even more lightweight alternatives, such as Riot.js.
Nevertheless, I agree that this is still in progress. There are phases of trying entirely new designs, pushing them to their limits, reducing them to their essence, using them as building blocks for new designs, and so on.
Anyway, lots of frameworks coming out != progress. Similarly, lack of new frameworks != stagnation. It often implies maturity, especially if the language has undergone a previous period of hype.
Good tech stays around. Everything else dies by the wayside. Easier to just sit back and see who's left standing a year later. React looks desirable in my eyes because it isn't a framework with a God complex (aka all 'opinionated' frameworks).
Likewise I do think the sleuth of frameworks means progress. Not always good progress, but we will continue to learn and improve things going forward as these experiments succeed or fail.
Not that I think that's inherently bad, especially since web technology is constantly in flux, but you can't say that having tons of small frameworks has zero impact on anyone's life.
[1] https://github.com/goatslacker/alt [2] https://github.com/goatslacker/iso
With Marty.js posted the other day (https://news.ycombinator.com/item?id=8923053) and, having spent a while looking at that, i'm interested to know if the motivations for creating the two are broadly the same? Are they taking similar approaches or are there fundamental (or subtle) differences? This is something i'm struggling to understand so would appreciate other input.
e.g. in Tuxxedo, why would 'actions' be named 'add', 'remove', 'edit' or 'get'. Why not following CRUD or POST/DELETE/PUT/GET convention? That's just one example.
It feels like the front-end developer community tends to over-engineer things these days.
The Graceful degradation link, for example, goes to http://www.tuxedojs.org/www.tuxedojs.org/docs/TuxModularity instead of http://www.tuxedojs.org/docs/TuxModularity.
> InvalidCharacterError: DOM Exception 5: An invalid or illegal character was specified, such as in an XML name.
Seems like an useful combination, but doesn't make me feel great when it's got an error on a mainstream browser.
Interestingly, the user-written code (around 175 lines) appears to make for less lines than the Angular one. It seems that doesn't happen much, so to me that plus this using React makes it seem notable.
Then again, Tuxx using FB's React + Flux without otherwise having affiliation with FB may raise questions about how well FB (React/Flux) will play with them in the future...
What's even the point of criticizing me being "lazy"? How am I supposed to complain the valid point without being "lazy"? Write a tutorial on using JavaScript syntax highlighting library? That might be OK elsewhere, but this is Hacker News and they are demoing code snippets. They are supposed to know this will cause serious usability issues.
And if this complaint is off-topic, I'm not sure what else we should talk about here on HN.
Is anyone keeping count, we must be in the hundreds by now?
Mind to develop your point ?
Note: I didn't say making a good framework was easy, just making one at all.
Sometimes people just decide to experiment, to try something and then as they grow with it they think it's big enough to share. When a whole bunch of people do that, you end up where we are with JS frameworks.
I'm in the "it's no big deal" group. Are there thousands of frameworks? Yes. Have I heard of more than 5 of them being used extensively? No. The good ones are embraced by developers and shared. The other ones are mocked into oblivion. It's the natural order of things.
This should not be the "natural order" of things.