Code Monkey home page Code Monkey logo

hirouter's People

Contributors

ohager avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

hirouter's Issues

Compatibility Builds

Err, I wanted to use HiRouter in one of our projects, but got

events.js:141 throw er; // Unhandled 'error' event ^ SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'

Seems, that I need to babel the guy first. Thought it'd be babel'd by our build chain. Need to solve this. This way it's not usable ๐ŸŽฑ

Page Transition not triggering

Under certain circumstances the transition does not trigger or stucks. I experience this mostly with Flux. A working solution seems to set the following routingImpl option.

const hiRouterOptions = {
		routingImpl: function(url){ setTimeout( () => this.props.history.push(url), 0 ); }
	};

ReactDOM.render(<HiRouter router={Router} options = {hiRouterOptions} />, document.getElementById('app-container'));

This kind of implementation should be default!

Get rid of require('react-hirouter').HiRouter

For some reasons the ES6,CJS build creates exports.default=HiRouter (in hirouter.js), which makes imports in React projects not that intuitive as I'd like to have. Instead of export default HiRouter I use an explicit export export {HiRouter}. This way, imports work like this const HiRouter = require('react-hirouter').HiRouter.

Ideally, it should be const HiRouter = require('react-hirouter')

Consider special route patterns

Currently, only URL variables (i.e. path/:id) are parsed. See, how to treat more advanced patterns, like path/(:id), or /**/*.jpg

ES5 support

In a current project we'd problems with IE11 due to Object.assign and string interpolation. While Object.assign can be resolved with a simple shim, the string interpolation feature is a bit more difficult to resolve. It is used inside the dynamic function creation (createMountPathFunction in createRouteFunction.js).

Handle IndexRoute

Should be nice if IndexRoute can be handled, i.e. creating special goToIndex() function. Mind, that IndexRoute has a related parent Route

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.