Giter Site home page Giter Site logo

aviator's People

Contributors

adamedgett avatar augustskare avatar barnabyc avatar flahertyb avatar hojberg avatar nahiluhmot avatar rssilva 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  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

aviator's Issues

Import statement in docs

I'm pretty sure I should import something from somewhere before using Aviator.setRoutes, but you don't seem to have put it in the docs!

Exception when no root specified

We're used to always having '/partners' - but when no root is specified (and it defaults to ""), you get an invalid RegEx from this guy:

  /**
  @method _removeURIRoot
  @param {String} uri '/partners/s/foo-bar'
  @return {String} uri '/s/foo-bar'
  **/
  _removeURIRoot: function (uri) {
    var rootRegex = new RegExp('^' + this.root);

    return uri.replace(rootRegex, '');
  }

CDN

Could you guys setup a cdn that people can just hit for simple front-end environments?

Odd corner case where query string raises an error with push state disabled

Given this code:

var Handler = {
  index: function(req) {
    console.log(req);
  }
};

Aviator.pushStateEnabled = false;

Aviator.setRoutes({
  '/users': {
    target: Handler,
    '/': 'index'
  },
  '/cats/:id': {
    target: Handler,
    '/': 'index'
  }
});

Aviator.dispatch();

Aviator.navigate('/users?foo=bar');

I get a Uncaught TypeError: Cannot read property 'indexOf' of undefined (aviator.js:898).

But if I comment out the pushStateEnabled = false, it works as expected.

Use the nearest ancestor target if none is provided

It should be allowed to provide the following config and have use the nearest ancestral route target:

Aviator.setRoutes({
  '/articles': {
    target: articleRouteTarget,
    '/comments': {
      '/:id': 'showComment'
    }
  }
});

matchedRoute should be complete regardless of current route target

Every request has a matchedRoute property but it only includes what is currently matched up to the route target being executed.

We should try to include the entirity of the route. Cases where we need to conditionally redirect, or exit are currently potentially limited. Ie. prompt for a login and return to the proper route on success.

README information missing/out of date

No mention of what is being passed to a route target.

The README mentions navigating to a named link parameter but doesn't include an example of one in Aviator.setRoutes or a route target.

In the above case, hitting "/campaigns/add" would call the add method on the on the MarketingTarget.

This should be CampaignsTarget.

Initial route

Hello,

Aviator works fine for me, just got a problem to handle initial url.
When I run 'http://127.0.0.1/', and then use navigate to /foo, it's ok, but when I directly access, for instance, http://127.0.0.1/foo (loading this url) I get a 404. How can you get rid of that using Aviator ?

Cheers

Query string parsing doesn't work with push state disabled?

Given this code:

var Handler = {
  index: function(req) {
    console.log(req);
  }
};

Aviator.pushStateEnabled = false;

Aviator.setRoutes({
  '/users': {
    target: Handler,
    '/': 'index',
    '/:id': 'index'
  }
});

Aviator.dispatch();

Aviator.navigate('/users/123?foo=bar');

I get a Request object with queryParams empty and queryString null?

If I comment out the line Aviator.pushStateEnabled = false though, I get the expected Request object, with the query string parsed properly.

I was testing this in Chrome 34. Any ideas what's going on?

Thanks!

Allow string-only target definition for sibling-level matches

Currently to match:

          '/retention': {
            target: targets.menuRetentionRouteTarget,
            '/*': 'beforeAll',
            '/':  'index'
          },

one has to write it as:

          '/retention': {
            target: targets.menuRetentionRouteTarget,
            '/*': 'beforeAll',
            '/':  {
              target: targets.menuRetentionRouteTarget,
              '/': 'index'
            }
          },

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.