![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
cherrytree
Advanced tools
Cherrytree is a flexible hierarchical router that translates every URL change into a transition descriptor object and calls your middleware functions that put the application into a desired state.
The size excluding all deps is ~4.83kB gzipped and the standalone build with all deps is ~7.24kB gzipped.
$ npm install --save cherrytree
In a CJS environment
require('cherrytree')
In an AMD environment, require the standalone UMD build - this version has all of the dependencies bundled
require('cherrytree/standalone')
See it in action in this demo.
To use cherrytree
with React, check out cherrytree-for-react
.
var cherrytree = require('cherrytree')
// create the router
var router = cherrytree()
var handlers = require('./handlers')
// provide your route map
router.map(function (route) {
route('application', {path: '/', abstract: true}, function () {
route('feed', {path: ''})
route('messages')
route('status', {path: ':user/status/:id'})
route('profile', {path: ':user'}, function () {
route('profile.lists')
route('profile.edit')
})
})
})
router.use(function render (transition) {
transition.routes.forEach(function (route, i) {
route.view = handlers[route.name]({
params: transition.params,
query: transition.query
})
var parent = transition.routes[i-1]
var containerEl = parent ? parent.view.el.querySelector('.outlet') : document.body
containerEl.appendChild(view.render().el)
})
})
router.use(function errorHandler (transition) {
transition.catch(function (err) {
if (err.type !== 'TransitionCancelled' && err.type !== 'TransitionRedirected') {
console.error(err.stack)
}
})
})
// start listening to URL changes
router.listen()
You can clone this repo if you want to run the examples
locally:
A more complex example in it's own repo:
router.generate('commit', {sha: '1e2760'})
#
as appropriaterouter.transitionTo('commits')
cherrytree
you'll have to write the glue code for integrating into React yourself (see cherrytree-for-react
plugin). However, what you get instead is a smaller, simpler and hopefully more flexible library which should be more adaptable to your specific needs. This also means that you can use a react-router
like approach with other React
inspired libraries such as mercury
, riot
, om
, cycle
, deku
and so on.Cherrytree works in all modern browsers. It requires es5 environment and es6 promises. Use polyfills for those if you have to support older browsers, e.g.:
Thanks to Marko Stupić for giving Cherrytree a logo from his http://icon-a-day.com/ project!
cherrytree
written as one word? You got me, I'd say that represents the wabisabi nature of the library.v2.0.0
Nothing changed from v2.0.0-rc4.
FAQs
Cherrytree - a flexible hierarchical client side router
The npm package cherrytree receives a total of 4 weekly downloads. As such, cherrytree popularity was classified as not popular.
We found that cherrytree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.