Routing library for Javascript? [closed] - javascript

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I used to use Backbone.js as an easy MVC framework which have build-in routing support. Now I have moved and currently using Agility.js which doesn't routing support. So my question is, is there any alternative to Backbones.js's routing?
For reference on why I need this is because my "style" of writing is a one-page website that query the server for information.

I've faced the same question just some weeks ago and wrote "Simrou", a very basic framework that does nothing but this kind of routing (hash-based). You can define the routes in Backbone's own style and then attach action handlers to GET, POST, PUT etc. requests (GET is basically a clicked link, POST etc. can be triggered by forms).
https://github.com/buero-fuer-ideen/Simrou

Not sure what sort of features you are looking for, but I just put up an extremely lightweight JS router that offers the bare minimum to get things going. A lot of the routers I had come across were offering way more features than I was looking for, so I thought this might help fill a void for those looking for something light. It defaults to use pushState, falls back to hash. http://gabehayes.github.com/lennonjs/.

Another option is Davis.js it provides simple routing, based on pushState (it can work with hash based routing also). It is inspired by Sammy.js but only focuses on the routing side.

Related

Best practice for loading initial data into a backbone app? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I understand from the Backbone docs it is best practice to bootstrap model data into the application by embedding it in script tags that render on the initial page load.
I realize that this is done to avoid sending extra requests to the server, which will speed up page load.
But...
Does it really make that big of a difference? I am currently calling fetch on a half-dozen models and collections on page-load, and everything seems to load very quickly.
Are there any other reasons for using this suggested method of bootstrapping data? If not, it seems like extra effort for negligible gains, to me.
Maybe it's fast on your development machine with just you as the user (you didn't specify the environment), but when you have many more users those requests can begin to add up. In that case, if you can bootstrap some of the data then the benefits can become more apparent. Try using chrome inspector's network monitoring pane to get more detailed information on the difference between the two methods.

Can you help me with framework choice? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm thinking about developing an app which will make a strong use of geolocation (mongodb will be my choice), and strong upload of photos (and viewing too).
I was just wondering if you could help me with framework election. I've been using node.js for months and I'm very comfortable with it, but because of its one-process nature, will it be bad for locking when uploading big photos?
The other solution I'm working on is rails.
Which one will you choose? Any other ?
Thanks
With Streaming you can support more then one client during a upload, since the upload will be broken into different parts. I sure expressjs has some good streaming examples.
... but because of its one-process nature, will it be bad for locking when uploading big photos?
Take a look at the cluster module, this should help with leveraging more cores. In fact one of the node.js clients on the front page are these guys: Transloadit who focus on handling images.
I'm thinking about developing an app which will make a strong use of geolocation (mongodb will be my choice)...
I've done a lot of work with MongoDB and I recommend reading up on the limitations of MongoDB's geo-location tools. The product does provide some functionality, but it does not match the features of Postgres. You will want to ensure that MongoDB covers all of the features you require before beginning.

AngularJS or Backbone for beginner [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm choosing a javascript framework for my Chrome extension programming (localStorage, lots of ajax calls, filtering, json manipulation). Do you recommend AngularJS or Backbone? I started with JS a few months ago (I have PHP and Java background) and the main problem for me is to have a good and clean structure of my web app.
What I like about AngularJS? The two way binding and the concept itself.
What I like about Backbone? It's really simple for beginner. And there are a lot of resources.
Full disclosure: I work on AngularJS, and obviously have a bit of a bias. ;)
If you're looking for an opinionated application structure, I would definitely stick with AngularJS. Backbone provides many helpful utilities, but there are many choices that you have to make about how you want to connect things. From my experience writing medium/large apps with Backbone.js, I've found that I have to put in more effort to keep things organized compared to AngularJS, which has much clearer separation of concerns.
The best choice is to code little projects in these two libraries.
Why not test and see the code from Todo MVC project from Addy Osmani and after that, make your choice ?

Good tutorials on refactoring Javascript into a JavaScript MVC frameworks? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking for tutorial(s) on how to refactor JavaScript application into a JavaScript application using one of the existing JS MVC frameworks. Anyone got any?
Yes, I recommend the Backbone-Boilerplate located at GitHub.
This is beneficial because, not only do you get the Backbone MVC, but also require.js AMD, and underscore.js templates. The authors have been consistently active, and the code is impressive to work with.
Here are the associated tutorials:
Introduction
AMD Module setup
Boilerplate
Overview
Router Explanation
These were the tutorials I used to get it up and running. Also included is Node.js and Grunt build system. They are very much worth the effort if you are not familiar with them. I just saw today that a jQuery project is incorporating the Grunt build system. This is a good setup.
UPDATE: Apologies if you were already aware of the boilerplate. I realize it does not directly relate to refactoring. This looks like a good post on refactoring MVC.
Documentation may be sparse as it would be specific to how your codebase is architected. The key notion would be Data maps to Model, GUI maps to View, Collections contain multiple models, and the Router is used to route events.
Hope that helps.
All the best!
Nash

What are the best chart/graph js plugins? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm trying to find a smart way to display data on my dashboard page. What are the nicest and most flexible resources to plot charts and graphs?
First determine if you want to use an hosted solution like google charts, or you want more control and need a library you want to host yourself. Hosted solutions are very convenient and integrate fairly quickly, but your data is inherently exposed to the outside world. If you're building a corporate site this can be a "no go".
Also think if you want a client side or server side solution. I personally would go for a client side library if you don't have a huge amount of data that needs to be visualized. Client side libraries very often are more flexible (think: animation, resizing, etc)
I have used highcharts. It is very powerful, and has many types of graphs, but it can be hard to find the setting that you need to get the exact effect that you want. Not because the documentation is bad (which it isn't), but because there are so many options.
How about Google Charts?
Try Visualize. I like it, because it's fully accessible :).

Categories