I'm looking for a simple Javascript framework for my Chrome extension development.
I'm using jQuery and jQuery UI, but as my project grows, my orientation in the code is worse. So I need some kind of consistent MV* framework that is really simple&lightweight, popular (because of help and tutorials) and that could be used with jQuery and jQuery UI (or the framework could contain anything similar). Any ideas? Don't suggest me TodoMVC - I tried it and every implementation except jQuery is unnecessarily complex.
For structuring your javascript application, I suggest using Backbonejs. It's lightweight, and it even uses jQuery, so you should feel quite at home. Assuming you need richer widget than what is built into the browser, instead of using jQueryUI you may want to look into "Twitter Bootstrap", which is quite pleasant to work with, looks great and already supports responsive applications (which may or may not be necessary for your Chrome Extensions). I also believe it is a lot more lightweight than jQueryUI, but I really haven't looked into that in detail on my own. The same combo also works great for traditional web pages, web apps, single page applications and even works quite well on mobile devices.
You've tagged your question with Knockout.js - have you found any compelling reasons not to go with that? I've been using it extensively in conjunction with jQuery and jQuery UI, it plays nicely and has plenty of clean extension points. There is a big support community on here and elsewhere, and the documentation is excellent. I'd highly recommend it.
Backbone is the winner. I found the best resources.
Related
So I have this project I'm working on and I'm trying to build the website part of my project. I have experience with Flash AS3, but not so much or none with JavaScript. My co-workers are telling me that they are almost the same and you can just build the site in JavaScript. But people can have JavaScript turned off, and not everyone uses Flash.
I'm having difficulty knowing what to use to build my website...by the way, this website is generally an application. It's going to have a menu with features and stuff. I figured I can probably do HTML and PHP, but there's some features I need that will be dynamic. I really want this site to be available to as many people as possible.
The only reason (again) why I would use flash is because I've used it before and it's easy to design with animations and junk.
I could use some advice.
This is my personal opinion, but if you can meet the needs of your application with HTML and Javascript, you will probably be much better off. Your application will not require Flash, will likely load faster, will work better on mobile devices and will work on iDevices which do not support Flash at all.
That said, there are some challenges to building some types of applications in HTML and Javascript, particularly if you need to work across a wide range of browsers. Using a popular library like jQuery or YUI can help with a lot of that cross browser compatibility, but some capabilities are only available in the more modern browsers.
On the opposite end of things, some things can be done better in Flash than in HTML (particularly in old browsers).
So ... the answer is that, it depends on the needs of your application. If it were me, I'd build it in HTML and Javascript unless I found a reason that I couldn't make a successful application that way.
As for computers with Javascript off, it's my opinion that those computers are not doing modern things on the web anyway and would not likely be customers of anything I'd build on the web. Google has dropped support for computers without javascript and some old browsers from some of their apps because the cost of development for those cases is way higher than the benefit from the few customers you might gain by it. Whether that logic applies to your application obviously depends upon what you're doing and who it would appeal to.
If you looking to use javascript, there is jquery which is very easy to use and very rich in functioanlity. There is also extjs which is also easy and functionality rich but its not free for commercial use.
If you are new to javascript and already know java, you can use Google web toolkit where you write the code in java and the toolkit compiles that into a javascript. But this depends on how much server functionality you have.
IF the website is a simple one, you can probably use jquery, html and css.
If its a commercial project I would use Flash because You're good at it and You will build the app faster.
If You want to take a fascinating journey with the most popular language and develop Your skills then use javascript.
Flash and javascript are both very popular. For both methods You can use a fallback if the technology is not available.
If You decide to use javascript consider using backbone.js. It's a great MVC library.
I am really big fan of jQuery, but I don't see it as a framework for a site, more like a library. I am looking for some sort of framework that will give me the tools to build really structured applications in javaScript. I have found backbone.js, but find it somewhat confusing. Is that a good one, and are there others similar to it? an MVC pattern would be really cool, but I havent found anything.
I use currently RightJS with RequireJS. It has worked out well for my purposes. I used jQuery + jQuery UI previously. The current combo fits my style better (more barebone functionality instead of just DOM wrapper + UI plugins).
I know RightJS isn't that popular. The docs are adequate and the author is responsive. This makes up for that. :)
Some other alternatives:
qooxdoo
MooTools
Prototype
I'm sure there are plenty of more alternatives. It really comes down to your preferences and exact needs.
Personally I have been looking at Sencha's offerings (ExtJS, Sencha Touch) lately. The latter is particularly interesting as it provides simple means to write cross-platform apps for mobile devices. Works great in iPad at least!
The Google Closure Library & Tools is pretty good, and is the framework they use to build Gmail, Google Maps, and so on.
jQuery and YUI 3: A Tale of Two JavaScript Libraries is a story about a jQuery developer that found that YUI3 was more "framework-like" and apt for his project.
I've been using YUI2 for years and it never disappointed me.
If you like dynamic OOP languages like Ruby/Python, you should really check RightJS. It is very compact, fast and simple. RightJS is built fully on OOP paradigm and allows you to implement serious stuff in a serious but not boring way.
As for the dom part, it doesn't exactly uses MVC as is, but RightJS has OOP dom-wrappers, with inheritance and so one. That provides basically the same result, but with much less headache.
And if you're particularly interested in patterns, check this out https://github.com/rightjs/rightjs-patterns :)
I am still learning javascript and the more i learn the more i ask myself why do i need to learn a js framework like cappuccino, sproutcore, qooxdoo, smartclient etc...? The learning curve for these frameworks is steep, also wouldn't it be better to just make use of JavaScript libraries?
Take note, that my objective is to create desktop like web apps. Thanks in advance for any good view points!
Desktop apps are built with frameworks that are of the same quality as those from SproutCore, Cappuccino, etc.
If you want to build desktop quality apps with true MVC architecture you can either write your own framework on top of a library, or start with a framework someone else has written. (SproutCore was originally built on top of jQuery for example)
The best part of a true framework is that the build tools can include only the pieces needed to run your app resulting in very small code with rapid load times.
Seeing as you are still learning Javascript, I would suggest that you continue to work with Javascript, and try out tools like jQuery, and then depending on the individual application you are working on, evaluate whether you need to use a more full featured desktop style Javascript framework at that time - something that will require a knowledge of jQuery/Prototype/etc to evaluate.
IMHO, those JS frameworks you mentioned are overrated bloatware.
I would wholeheartedly recommend that you learn JQuery instead.
It is a much more minimallistic and elegant framework.
Also, by the time IE 9 finally ships earlier next year, all the browsers
will be supporting most of the HTML5 standard, including offline storage and
websockets, making such complex frameworks completely unnecesary.
I am currently using JQuery and recently heard about RightJS. RightJS seems to be faster, lighter & more object oriented. But I was wondering if RightJS has somethings seriously missing compared to JQuery (Other than the huge plugin base).
Update:
I tried RightJS in a small web project & decided to use it on a few more projects. But I would still stick to JQuery till I am confidant about RightJS. So far RightJS seems to be doing all the things I do with JQuery (mostly ajax & selectors).
Nahar,
Nikolay, the author of RightJS is here. Couple of notes.
1) Mentioned above jQuery size is incorrect because 24k is the size of the gzipped version. Gzipped RightJS weights 14k.
2) I believe the_drow just don't know what he's talking about. RightJS has all the same as jQuery, Moo, Dojo or Prototype. More of that in RightJS you have things like classes, advanced form-features and cookies already packed into those 14k when jQuery has those things as plugins.
Then RightJS also has custom builds http://rightjs.org/build
As for dojo, I tried it on two projects before, and if you would ask me, I would say spare your time, jQuery is better.
The only problem with RightJS is that it's still an underground and we are still growing the critical mass of users, so occasionally you'll have to use your own brain instead of googling answers.
First of all jQuery currently weighs 24KB and rightJS weighs 30KB which means not as lighter as jquery.
Generally, when choosing amongst javascript frameworks, you consider these aspects:
Selectors
DOM traversal
DOM manipulation
Utility functions
Event handling
Ajax
Other than that, one of the most important factors are:
active/continuous development
community support
More Readings:
http://trends.builtwith.com/javascript
SideNote: Thanks for letting me know about RightJS :)
If you want something faster and more object oriented try the dojo toolkit.
RightJS seems nice but it's like any other minimal toolkit. I believe it's very lacking comparing to the big guns like jQuery, Dojo and Mootools.
With Dojo you can plug a datastore just about to any widget and communicate with the server side easily.
It has all of the quering capabilities jQuery has and also has a custom build process to include only what you need.
It it considered faster then jQuery in certain browsers/use cases but both are great.
There's nothing wrong with jQuery.
Both Dojo and jQuery has great community support and are continually developed.
If you are developing webapps Dojo is the right toolkit for you as it has a very comprehensive UI library.
Just check out their website.
See also this wikipedia page.
Aside from the framework, is jQuery worth using rather than creating your own javascript? I've always debated if the framework was better to use than to create your own calls. Are their disadvantages of using it?
Sorry for beginner question, I'm trying to feel out if it would be better to use this and create some of the ajaxish workings of my site rather than develop it from scratch.
Are there other frameworks out there that would be better to use to create an ajaxish website?
Yes, jQuery is worth it. I speak as someone who resisted using any library for a long time, then finally saw the light.
I do recommend that you build some hand-rolled Ajax interactions before you dive into using jQuery for Ajax, so that you understand exactly what is happening with Ajax. Once that's achieved, though, let the library do the dirty work.
jQuery (and most other framework) are for making difficult things simple. It keeps you from having to write cross-browser compatabile code. It keeps you from having to write recursive methods to update multiple dom-elements. It basically cuts your development time down substantially, and saves you a lot of frustration.
Stackoverflow Archive:
Which Javascript framework (jQuery vs Dojo vs … )?
Great discussion (with lots of involvement) over various javascript frameworks. It will benefit you to browse this in depth, or even at a cursory level.
When should I use a javascript framework library?
Which Javascript Framework is the simplest and most powerful?
What JavaScript library would you choose for a new project and why?
Which Javascript Ajax Framework is most powerful and very lightweight?
Which javascript framework can be used for all browsers?
If you like reinventing the wheel, write your own. For me, I prefer to spend my time focusing on solutions rather than lines and lines of javascript code. I'll use JQuery to save resources and frustration
One thing I want to add is for the past couple of months, I was trying to fill a web developer position for my team, and it proved to be a difficult task.
Lots of folks knew how to use a JS framework (JQuery, ExtJS, YUI...), but once outside of the framework, they found themselves in an unfamiliar ground. I had a self-claimed senior JS developer with over 10 years of experience couldn't tell me how to use function.call() or function.apply() or how to implement simple inheritance in JavaScript.
Framework is great and definitely useful, but you will also want to make sure to know how to implement the basic OO concept and DOM manipulation without the framework.
BTW, we use ExtJS and if you are starting to pick a JS framework, you may want to look around to see which one suits you the most.
jQuery is a big project with many users. By that nature, it will be better tested than anything you write by yourself.
It is a great framework for most uses I've come to need.
Is there anything in particular you are trying to do?
jQuery helps you avoid worrying too much about cross-browser JavaScript issues, and helps you get things done quickly. As far as I'm concerned, the key reason for using it vs your own hand-rolled JavaScript probably is the "don't re-invent the wheel" cliché.
Apart from added productivity, JQuery's main plus is that it takes all (most) of the pain out of cross-browser testing.
There is no reason you cannot write your own code and splash in JQuery where needed. JQuery is incredibly lightweight for what it provides and you will quickly find that you can do most takes easier in JQuery (especially once you start using the plugins for it) than by hand. I am a big believer in not reinventing the wheel. The JQuery code is tested by tons of people and there are so many plugins to chose from I could almost guarantee that what I want to do has already been done before.
If you are starting with a clean site, now is the perfect time to take JQuery for a spin though, because if you do get hooked on it your code will be more consistent if you solve similar tasks using the same technique. Go give it a try :)
I would highly recommend using jQuery (or any comparable framework) over straight JavaScript. It just makes common programming tasks easier, most notably cross-browser development.
jquery makes js related work easier and more important standardised/compliant.
If you need re-assurance as to its use:
MS & Nokia are bundling it in their dev platforms.
Its compatible with many of the newest web technologies.
It has a large developer community supporting it.
There are many plug-ins available to aid RAD.
and more...
Give it a go!!
Definutly! Jquery wil save you a lot of time struggling over code and makes your code easier to read to non-experts.