I am trying to understand the landscape of different approaches, and best practices, around the development of complex client-side JavaScript.
I'm not sure what to label this class of application, perhaps heavy AJAX or RIA (but not plugins like Flash/Silverlight). I'm referring to web apps with these characteristics:
- Emulate rich/native desktop UX in JavaScript
- Contain most/all behavior in client-side JS, using the server as a data-API (JSON/Html-Templates).
This is in contrast to using the web-server for the UI rendering, producing all HTML in a page-refresh model.
Some examples are:
- Google Docs / Gmail
- Mindmeister
- Pivotal Tracker
As we move forward into HTML5, I can see this style of RIA development, with heavy JavaScript, becoming ever more common and necessary to compete.
QUESTION: So what are the common approaches emerging around managing these kinds of heavy JS developments?
Client-side code, as an app grows in features, is fiendishly complicated. There are problems scaling a development effort across multiple teams with raw JS (or so I hear, and can well believe it).
Google has approached the problem by building GWT that compiles from a higher level language (Java) to JS, leaning on the existing development infrastructure that the higher level language has (Eclipse, strong-typing, refactoring tools), along with abstracting browser compatibility and other issues away from the developer.
There are other tools, like Script# for C# that do something similar. All this puts JS more in the role of an IL (Intermediate Language). ie. "You never really write in that 'low level language' anymore."
But this 'compile to JS' is not the only approach. It's not apparent that GWT is the dominant approach...or indeed will become it.
What are people doing with rich-client JavaScript? Some orienting questions:
- Are most shops crafting JS manually (atop libs like jQuery et al)?
- Or are there many many different approaches, with no clear best-practice emerging?
- Are most shops avoiding RIA scale development in favor of the simpler to developer server-side/page-redraw model? If so, will this last?
- Is compiling to JS perhaps an emerging future trend? Or is this just wrong headed?
- How do they manage the complexity and refactoring of client JS?
- Modularization and distribution of work across teams?
- The application, enforcement, and testing of client-side patterns like MVC/MVP etc.
So, what are the emerging trends in this heavy-JavaScript and HTML5 future of ours?
Thanks!