Giter Club home page Giter Club logo

backbone.blazer's People

Contributors

adamlangsner avatar dschaub avatar samandmoore avatar samccone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

backbone.blazer's Issues

add filter chain to Route configuration

it would be nice to be able to pre-filter routes before they're executed.

example api:

we could allow this to just be a function that returns true to continue and false to bail out early.

Backbone.Blazer.Route.extend({
  filters: [(routeData) => { // true continues, false bails early }]
});

but what do we do if we bail out early? we trigger error? sounds crummy.

another idea:

we could create a special object like Route

Backbone.Blazer.Filter = Marionette.Object.extend({
  test: function(routeData) { // true/false },
  failed: function(routeData) {
    // called if test returns false
    // allows this filter to handle what happens if it fails
    // e.g. an auth filter could have this do a redirect to the log-in view
  }
});

Backbone.Blazer.Route.extend({
  filters: [new AuthenticatedFilter()]
});

questions:

  • should this support asynchronous filters? (leaning toward no).

Remove Marionette dependency

There's not really anything Marionette-specific in here. I'd just use a good ol' JavaScript function for your 'Route' object, then mix in the Backbone goodies like extend and Events.

If, in your own applications, you use Marionette features like triggerMethod, you could add them to your application by extending the Route class. The benefit to this change is that it makes the library usable by more of the Backbone community.

This issue competes with samccone@7faf9a7.

re-work route registration

instead of registering routes like this:

routes: {
  'foo': new FooRoute()
}

we'd like to register like this:

routes: {
  'foo': FooRoute
}

so that we can construct a new instance of the route for each navigation to that route. this makes it so that the route handler objects are not singleton-esque since they encourage the process of attaching state to themselves.

another approach would be to re-work the inner pipeline in the router so that the router takes the fulfillment values of the prepare promise and pipes them into the execute method. then the routes would be able to exist as singleton-esque instances.

should `Route` objects catch all errors?

decide if the error method on Route objects should be called given ALL types of errors that could arise when processing a route. i.e. should they be called when there is a view error? undefined method error? etc. is it a try/catch kind of thing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.