hulilabs / ju-mvc Goto Github PK
View Code? Open in Web Editor NEWDynamic routing for web apps
Dynamic routing for web apps
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}
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.
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
Define a interface on the page-manager.js to check if a route needs authentication.
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
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:
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.
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.
We need a method that returns the path of the class than handles a particular route.
In my code I had this as an optional parameter for the profile path
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.