Giter VIP home page Giter VIP logo

ju-mvc's People

Contributors

andreybs11 avatar canamo06 avatar fahernandez avatar fairplaay avatar jpgarbanzo avatar klam avatar lcorrales avatar sesegura avatar stevevega avatar

Watchers

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

ju-mvc's Issues

Allow push/replace route using a route definition

Currently, we're able to manipulate the history (using push/replace), but only if we have the actual route string.

We should add support to do so using a route definition object, i.e. {route , params, queryString}

Adding targetHeight for animation

For the slideUp function in the transitionManager, sometimes we required the end animation not to end in 0 but to leave certain part of the content still visible.

We need to have the option to specify the amount of space we want to have visible.

Improve route wrapper to support view stacking

Enable a route to define a wrapper and stack those views as a sequence

'controller-name' : {
route : 'route/path',
controller : 'some/controller',
controllerWrapper : {
wrapper : 'controller/wrapper'
}
}

billing > billing-source

Routing : final slash and query params

Even though it is not a good practice, neither significant, some end-users like adding a slash at the end of urls (by this I mean outside devs scope).

Examples:
https://foo.com/my-page/ instead of https://foo.com/my-page

But, when a routing is defined using regex like:

mypage : { route: '/^my-page$/', controller : 'some/controller' }

is isn't truly matching end-of-string '$' because of query params

router.js : line 195
source = source.replace(/\$$/, '').concat('(?:\\?([\\s\\S]*))?$');

transforms '/^my-page$/' into '/^my-page(?:\\?([\\s\\S]*))?$/'

...which brokes route testing flow as a final slash isn't supported, then no controller is instantiated for those urls.

Working regex might be

/^my-page(.*)?(?:\\?([\\s\\S]*))?$/ ---> can match things like https://foo.com/my-page/hello?p=1
/^my-page\/?(?:\\?([\\s\\S]*))?$/ ---> force special support for an optional final slash before query string

Move web-storage to ju-shared

web-storage is library that should live on ju-shared because is not part of the main functionality of the MVC architecture:

Also the library must have:

  • A fallback to store the keys on cookies when the localstorage is not supported in old browsers or incognito modes.
  • A flag to indicate if the library is running with native suppoert or using a fallback.

Routing : add queryStrings support to PageManager#navigateToRoute

Currently there's no support on PageManager or Router for adding query strings to the URL.

The usual way for handling URL params is to set optional params on the route definition, but this may be inconvenient in certain cases where the correct approach (or at least, one of the best approaches) is to use query strings.

For example: when a search or a filter with single or multiple criteria must be performed and the result of these operations could be a empty set, query strings could be used, instead of returning a 404 status if the route doesn't match the route params given.

(...)/examples/invalidparam could return 404 because the route may not match a defined route
(...)/examples?param=invalid could return a 200 status but with an empty set as response and the application may be able to handle this case.

Middleware support

Add the functionality to support(add any) middlewares/pipelines when the app is processing the routes.

This is very useful when we need to define global loggers, error handler or authentication for example.

Routing : Routes optional parameters

In my code I had this as an optional parameter for the profile path

  • route : 'profile/:action';
    The method navigateToRoute was not receiving this parameter as valid, I had to chage it to this:
  • route : 'profile/(:action)',

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.