{"id":18720622,"url":"https://github.com/nareshbhatia/mobx-state-router","last_synced_at":"2025-04-04T16:13:49.699Z","repository":{"id":45486731,"uuid":"115668294","full_name":"nareshbhatia/mobx-state-router","owner":"nareshbhatia","description":"MobX-powered router for React apps - https://nareshbhatia.github.io/mobx-state-router/","archived":false,"fork":false,"pushed_at":"2023-07-13T13:45:11.000Z","size":4002,"stargazers_count":226,"open_issues_count":8,"forks_count":31,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-04-30T00:03:14.796Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nareshbhatia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-28T23:46:50.000Z","updated_at":"2024-06-18T15:49:59.028Z","dependencies_parsed_at":"2024-06-18T15:49:19.793Z","dependency_job_id":"2ef7a4ff-494d-46e1-9d73-626372ed1bef","html_url":"https://github.com/nareshbhatia/mobx-state-router","commit_stats":{"total_commits":118,"total_committers":13,"mean_commits":9.076923076923077,"dds":0.1610169491525424,"last_synced_commit":"fe9a35720279afc0a8f9a6b2dd9341558e7f67b7"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareshbhatia%2Fmobx-state-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareshbhatia%2Fmobx-state-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareshbhatia%2Fmobx-state-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nareshbhatia%2Fmobx-state-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nareshbhatia","download_url":"https://codeload.github.com/nareshbhatia/mobx-state-router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208140,"owners_count":20901570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T13:31:58.570Z","updated_at":"2025-04-04T16:13:49.682Z","avatar_url":"https://github.com/nareshbhatia.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MobX State Router\n\n[![npm](https://img.shields.io/npm/v/mobx-state-router?style=plastic)](https://www.npmjs.com/package/mobx-state-router)\n[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Travis](https://img.shields.io/travis/alexjoverm/typescript-library-starter.svg)](https://travis-ci.org/nareshbhatia/mobx-state-router)\n[![Coverage Status](https://coveralls.io/repos/github/nareshbhatia/mobx-state-router/badge.svg?branch=master)](https://coveralls.io/github/nareshbhatia/mobx-state-router?branch=master)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n\nMobX-powered router for React apps.\n\n## Features\n\n-   State is decoupled from the UI. UI is simply a function of the state.\n-   UI is no longer responsible for fetching data. Data is now fetched during\n    state transitions using router hooks.\n-   The router can override routing requests based on the application state. For\n    example, it can redirect to the Sign In page if the user is not logged in.\n-   Supports\n    -   404 (Not Found) errors\n    -   Server-Side Rendering\n\n[Learn how to use mobx-state-router in your own project.](https://nareshbhatia.github.io/mobx-state-router/)\n\n## Contributors\n\nMake sure all your commit messages conform to the\n[Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).\n\nTo simplify this process, we have included\n[Commitizen](http://commitizen.github.io/cz-cli/) as a dependency of this\nproject. Always execute the following command sequence to commit your changes.\nIt will prompt you to fill out any required commit fields interactively.\n\n```\ngit add --all\nyarn cz-commit # interactive conventional commit\ngit push\n```\n\n## Testing local builds\n\nTo test local builds with examples in the `examples` folder, follow the steps\nlisted below:\n\n-   Build the package\n\n```bash\nyarn build:local  # creates a dist folder\n```\n\n-   Create a tarball from the package\n\n```bash\nnpm pack  # packages src and dist into a tarball with name [package-name]-[version].tgz\n```\n\n-   Go to an example in the examples directory and add the tarball as a\n    dependency\n\n```bash\ncd examples/mobx-shop\nyarn add ../../[package-name]-[version].tgz\n```\n\n-   Run the example\n\n```bash\nyarn start\n```\n\n## Release to NPM\n\n-   Change the version number in package.json. Use semver. For pre-release\n    versions add a suffix \u0026 build number, e.g 5.0.0-beta.1.\n\n-   Commit and push (see above)\n\n-   Build the package\n\n```bash\nyarn build:local\n```\n\n-   Release to npm\n\n```bash\nnpm publish             # for normal release (adds `latest` tag)\nnpm publish --tag next  # for pre-release (adds `next` tag)\n```\n\n-   Tag the release and push the tag to remote\n\n## Publishing docs to GitHub Pages\n\nMake sure you are\n[connected to GitHub using your SSH key](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh).\n\n```sh\ncd website\nyarn\nGIT_USER=nareshbhatia CURRENT_BRANCH=master USE_SSH=true yarn publish-gh-pages\n```\n\n## Credits\n\nmobx-state-router is based on ideas from several Open Source projects. I am\ngrateful to the developers of these projects for their contributions. Special\nthanks go to the following contributions:\n\n[How to decouple state and UI (a.k.a. you don’t need componentWillMount)](https://hackernoon.com/how-to-decouple-state-and-ui-a-k-a-you-dont-need-componentwillmount-cc90b787aa37)\\\nThis article by [Michel Weststrate](https://twitter.com/mweststrate) provided the\ninitial inspiration for writing mobx-state-router. It explains the downsides of mixing\nState and UI and how to untangle the mess!\n\n[mobx-router](https://github.com/kitze/mobx-router)\\\nThis library by [Kitze](https://github.com/kitze) is a good implementation of Michel\nWeststrate's ideas. I have borrowed some concepts from this implementation and then\nadded my own. Thanks Kitze!\n\n[router5](https://github.com/router5/router5)\\\nThis is a more extensive library for routing. It's unique feature is that routes\nare organized as a tree, made of segments and nodes. It aims to be framework agnostic\nand uses middleware and plugins to adapt to different frameworks. Of course, with\nflexibility comes complexity. mobx-state-router makes some choices for you to keep\nthe overall learning curve simple.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnareshbhatia%2Fmobx-state-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnareshbhatia%2Fmobx-state-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnareshbhatia%2Fmobx-state-router/lists"}