react-router
Advanced tools
Comparing version 3.0.0-alpha.3 to 4.0.0-0
122
package.json
{ | ||
"name": "react-router", | ||
"version": "3.0.0-alpha.3", | ||
"description": "A complete routing library for React", | ||
"files": [ | ||
"*.md", | ||
"docs", | ||
"es", | ||
"lib", | ||
"umd" | ||
"version": "4.0.0-0", | ||
"description": "Declarative Routing for React.js", | ||
"repository": "reactjs/react-router", | ||
"license": "MIT", | ||
"authors": [ | ||
"Michael Jackson", | ||
"Ryan Florence" | ||
], | ||
"main": "lib/index", | ||
"module": "es/index", | ||
"jsnext:main": "es/index", | ||
"repository": "reactjs/react-router", | ||
"homepage": "https://github.com/reactjs/react-router#readme", | ||
"bugs": "https://github.com/reactjs/react-router/issues", | ||
"scripts": { | ||
"build": "npm run build-cjs && npm run build-es", | ||
"build-cjs": "rimraf lib && cross-env BABEL_ENV=cjs babel ./modules -d lib --ignore '__tests__'", | ||
"build-es": "rimraf es && cross-env BABEL_ENV=es babel ./modules -d es --ignore '__tests__'", | ||
"build-umd": "cross-env BABEL_ENV=cjs NODE_ENV=development webpack modules/index.js umd/ReactRouter.js", | ||
"build-min": "cross-env BABEL_ENV=cjs NODE_ENV=production webpack -p modules/index.js umd/ReactRouter.min.js", | ||
"lint": "eslint modules examples *.js", | ||
"start": "cross-env BABEL_ENV=cjs node examples/server.js", | ||
"test": "npm run lint && npm run test-node && npm run test-browser", | ||
"test-browser": "cross-env BABEL_ENV=cjs karma start", | ||
"test-node": "cross-env BABEL_ENV=cjs mocha --compilers js:babel-register tests.node.js" | ||
"start": "echo 'Make sure to `cd website && npm install`' && cd website && npm run dev", | ||
"release": "node ./scripts/release.js", | ||
"build-lib": "babel ./modules -d . --ignore '__tests__'", | ||
"build-umd": "webpack modules/index.js umd/react-router.js", | ||
"build-min": "webpack -p modules/index.js umd/react-router.min.js", | ||
"build": "node ./scripts/build.js", | ||
"prepublish": "node ./scripts/build.js", | ||
"test": "npm run lint && karma start", | ||
"lint": "eslint modules" | ||
}, | ||
"authors": [ | ||
"Ryan Florence", | ||
"Michael Jackson" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"history": "^3.0.0", | ||
"hoist-non-react-statics": "^1.2.0", | ||
"invariant": "^2.2.1", | ||
"warning": "^3.0.0", | ||
"loose-envify": "^1.2.0" | ||
"history": "^4.0.0", | ||
"query-string": "4.2.3", | ||
"react-history": "^0.13.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^0.14.0 || ^15.0.0" | ||
"react": "15.x", | ||
"react-dom": "15.x" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.11.4", | ||
"babel-core": "^6.11.4", | ||
"babel-eslint": "^6.1.2", | ||
"babel-cli": "^6.10.1", | ||
"babel-core": "^6.9.1", | ||
"babel-eslint": "^6.0.4", | ||
"babel-loader": "^6.2.4", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-dev-expression": "^0.2.1", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-preset-es2015-loose": "^7.0.0", | ||
"babel-preset-es2015-loose-native-modules": "^1.0.0", | ||
"babel-preset-react": "^6.11.1", | ||
"babel-preset-react": "^6.5.0", | ||
"babel-preset-stage-1": "^6.5.0", | ||
"babel-register": "^6.11.6", | ||
"bundle-loader": "^0.5.4", | ||
"codecov": "^1.0.1", | ||
"cross-env": "^2.0.0", | ||
"css-loader": "^0.23.1", | ||
"eslint": "^3.2.0", | ||
"eslint-config-rackt": "^1.1.1", | ||
"eslint-plugin-react": "^5.2.2", | ||
"expect": "^1.20.2", | ||
"express": "^4.14.0", | ||
"express-urlrewrite": "^1.2.0", | ||
"eslint": "^2.12.0", | ||
"eslint-plugin-import": "^1.8.1", | ||
"eslint-plugin-react": "^5.1.1", | ||
"expect": "^1.20.1", | ||
"gzip-size": "^3.0.0", | ||
"isparta-loader": "^2.0.0", | ||
"karma": "^1.1.2", | ||
"in-publish": "^2.0.0", | ||
"karma": "^0.13.22", | ||
"karma-browserstack-launcher": "^1.0.1", | ||
"karma-chrome-launcher": "^1.0.1", | ||
"karma-coverage": "^1.1.1", | ||
"karma-mocha": "^1.1.1", | ||
"karma-mocha-reporter": "^2.0.5", | ||
"karma-mocha": "^1.0.1", | ||
"karma-mocha-reporter": "^2.0.4", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
@@ -80,29 +54,17 @@ "karma-webpack": "^1.7.0", | ||
"pretty-bytes": "^3.0.1", | ||
"qs": "^6.2.1", | ||
"react": "^15.3.0", | ||
"react-addons-css-transition-group": "^15.3.0", | ||
"react-addons-test-utils": "^15.3.0", | ||
"react-dom": "^15.3.0", | ||
"rimraf": "^2.5.4", | ||
"style-loader": "^0.13.1", | ||
"react": "^15.1.0", | ||
"react-addons-test-utils": "^15.3.1", | ||
"react-dom": "^15.1.0", | ||
"readline-sync": "^1.4.4", | ||
"webpack": "^1.13.1", | ||
"webpack-dev-middleware": "^1.6.1" | ||
"webpack-dev-server": "^1.14.1" | ||
}, | ||
"browserify": { | ||
"transform": [ | ||
"loose-envify" | ||
] | ||
}, | ||
"tags": [ | ||
"react", | ||
"router" | ||
], | ||
"keywords": [ | ||
"react", | ||
"react-component", | ||
"router", | ||
"route", | ||
"routing", | ||
"route", | ||
"routes", | ||
"router" | ||
"history", | ||
"link" | ||
] | ||
} |
153
README.md
@@ -1,151 +0,28 @@ | ||
# React Router [![Travis][build-badge]][build] [![npm package][npm-badge]][npm] | ||
React Router | ||
============ | ||
<img src="/logo/vertical@2x.png" height="150"/> | ||
Declarative routing for [React.js][react]. | ||
React Router is a complete routing library for [React](https://facebook.github.io/react). | ||
Docs | ||
---- | ||
React Router keeps your UI in sync with the URL. It has a simple API with powerful features like lazy code loading, dynamic route matching, and location transition handling built right in. Make the URL your first thought, not an after-thought. | ||
https://reactjs.github.io/react-router | ||
[![Codecov][codecov-badge]][codecov] | ||
[![Discord][discord-badge]][discord] | ||
Installation | ||
------------ | ||
> **Important:** *This is the `next` branch of React Router and may contain changes that are not yet released. To see the code for stable releases, browse [the `master` branch](https://github.com/reactjs/react-router/tree/master).* | ||
### NPM | ||
### Docs & Help | ||
- [Tutorial – do this first!](https://github.com/reactjs/react-router-tutorial) | ||
- [Guides and API docs](/docs) | ||
- [Troubleshooting guide](https://github.com/reactjs/react-router/blob/master/docs/Troubleshooting.md) | ||
- [Changelog](/CHANGES.md) | ||
- [Stack Overflow](http://stackoverflow.com/questions/tagged/react-router) | ||
- [CodePen boilerplate](http://codepen.io/anon/pen/xwQZdy?editors=001) for bug reports | ||
**Older Versions:** | ||
- 0.13.x - [docs](https://github.com/reactjs/react-router/tree/v0.13.6/doc) / [guides](https://github.com/reactjs/react-router/tree/v0.13.6/docs/guides) / [code](https://github.com/reactjs/react-router/tree/v0.13.6) / [upgrade guide](https://github.com/reactjs/react-router/blob/master/upgrade-guides/v1.0.0.md) | ||
- 1.0.x - [docs](https://github.com/reactjs/react-router/tree/1.0.x/docs) / [code](https://github.com/reactjs/react-router/tree/1.0.x) / [upgrade guide](https://github.com/reactjs/react-router/blob/master/upgrade-guides/v2.0.0.md) | ||
For questions and support, please visit [our channel on Reactiflux](https://discord.gg/0ZcbPKXt5bYaNQ46) or [Stack Overflow](http://stackoverflow.com/questions/tagged/react-router). | ||
### Browser Support | ||
We support all browsers and environments where React runs. | ||
### Installation | ||
Using [npm](https://www.npmjs.com/): | ||
$ npm install --save react-router | ||
Then with a module bundler like [webpack](https://webpack.github.io/) that supports either CommonJS or ES2015 modules, use as you would anything else: | ||
```jsx | ||
// using an ES6 transpiler, like babel | ||
import { Router, Route, Link } from 'react-router' | ||
// not using an ES6 transpiler | ||
var Router = require('react-router').Router | ||
var Route = require('react-router').Route | ||
var Link = require('react-router').Link | ||
``` | ||
npm install react-router@4.0.0-0 | ||
``` | ||
The UMD build is also available on [npmcdn](https://npmcdn.com): | ||
### Script Tag Global | ||
```html | ||
<script src="https://npmcdn.com/react-router/umd/ReactRouter.min.js"></script> | ||
<script src="https://unpkg.com/react-router@4.0.0-0"></script> | ||
``` | ||
You can find the library on `window.ReactRouter`. | ||
You'll find the modules on `window.ReactRouter` | ||
### What's it look like? | ||
```jsx | ||
import React from 'react' | ||
import { render } from 'react-dom' | ||
import { Router, Route, Link, browserHistory } from 'react-router' | ||
const App = React.createClass({/*...*/}) | ||
const About = React.createClass({/*...*/}) | ||
const NoMatch = React.createClass({/*...*/}) | ||
const Users = React.createClass({ | ||
render() { | ||
return ( | ||
<div> | ||
<h1>Users</h1> | ||
<div className="master"> | ||
<ul> | ||
{/* use Link to route around the app */} | ||
{this.state.users.map(user => ( | ||
<li key={user.id}><Link to={`/user/${user.id}`}>{user.name}</Link></li> | ||
))} | ||
</ul> | ||
</div> | ||
<div className="detail"> | ||
{this.props.children} | ||
</div> | ||
</div> | ||
) | ||
} | ||
}) | ||
const User = React.createClass({ | ||
componentDidMount() { | ||
this.setState({ | ||
// route components are rendered with useful information, like URL params | ||
user: findUserById(this.props.params.userId) | ||
}) | ||
}, | ||
render() { | ||
return ( | ||
<div> | ||
<h2>{this.state.user.name}</h2> | ||
{/* etc. */} | ||
</div> | ||
) | ||
} | ||
}) | ||
// Declarative route configuration (could also load this config lazily | ||
// instead, all you really need is a single root route, you don't need to | ||
// colocate the entire config). | ||
render(( | ||
<Router history={browserHistory}> | ||
<Route path="/" component={App}> | ||
<Route path="about" component={About}/> | ||
<Route path="users" component={Users}> | ||
<Route path="/user/:userId" component={User}/> | ||
</Route> | ||
<Route path="*" component={NoMatch}/> | ||
</Route> | ||
</Router> | ||
), document.getElementById('root')) | ||
``` | ||
See more in the [Introduction](/docs/Introduction.md), [Guides](/docs/guides/README.md), and [Examples](/examples). | ||
### Versioning and Stability | ||
We want React Router to be a stable dependency that’s easy to keep current. We follow the same versioning as React.js itself: [React Versioning Scheme](https://facebook.github.io/react/blog/2016/02/19/new-versioning-scheme.html). | ||
### Thanks | ||
Thanks to [our sponsors](/SPONSORS.md) for supporting the development of | ||
React Router. | ||
React Router was initially inspired by Ember's fantastic router. Many thanks to the Ember team. | ||
Also, thanks to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows us to run our build in real browsers. | ||
[build-badge]: https://img.shields.io/travis/reactjs/react-router/master.svg?style=flat-square | ||
[build]: https://travis-ci.org/reactjs/react-router | ||
[npm-badge]: https://img.shields.io/npm/v/react-router.svg?style=flat-square | ||
[npm]: https://www.npmjs.org/package/react-router | ||
[codecov-badge]: https://img.shields.io/codecov/c/github/reactjs/react-router/master.svg?style=flat-square | ||
[codecov]: https://codecov.io/gh/reactjs/react-router | ||
[discord-badge]: https://img.shields.io/badge/Discord-join%20chat%20%E2%86%92-738bd7.svg?style=flat-square | ||
[discord]: https://discord.gg/0ZcbPKXt5bYaNQ46 | ||
[react]:https://facebook.github.io/react/ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
498082
5
28
9584
26
78
29
1
+ Addedquery-string@4.2.3
+ Addedreact-history@^0.13.0
+ Added@babel/runtime@7.25.6(transitive)
+ Addedhistory@4.10.1(transitive)
+ Addedquery-string@4.2.3(transitive)
+ Addedreact-dom@15.7.0(transitive)
+ Addedreact-history@0.13.3(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedresolve-pathname@3.0.0(transitive)
+ Addedtiny-invariant@1.3.3(transitive)
+ Addedtiny-warning@1.0.3(transitive)
+ Addedvalue-equal@1.0.1(transitive)
- Removedhoist-non-react-statics@^1.2.0
- Removedinvariant@^2.2.1
- Removedloose-envify@^1.2.0
- Removedwarning@^3.0.0
- Removedhistory@3.3.0(transitive)
- Removedhoist-non-react-statics@1.2.0(transitive)
- Removedinvariant@2.2.4(transitive)
- Removedquery-string@4.3.4(transitive)
- Removedwarning@3.0.0(transitive)
Updatedhistory@^4.0.0