Skip to content

Commit b019999

Browse files
committed
README update.
1 parent 1cc6dad commit b019999

File tree

7 files changed

+62
-59
lines changed

7 files changed

+62
-59
lines changed

.eslintrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
"spaced-comment": [0, "always"],
1717
"object-curly-spacing": [0, "never"],
1818
"func-names": 0,
19+
"quotes": 0,
1920
"react/jsx-quotes": 0,
21+
"react/no-danger": 0,
2022
"jsx-quotes": 2,
2123
"indent": [2, 2, {"SwitchCase": 1}],
2224
"no-unused-expressions": 0,
23-
"no-undef": 1,
25+
"no-undef": 0,
2426
"prefer-arrow-callback": [0, { "allowNamedFunctions": true }],
2527
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"]}],
2628
"react/forbid-prop-types": [0, {"forbid": []}],

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# jsondiffpatch-for-react
1+
# jsondiffpatch-react
22

33
- Originally forked from archived https://github.com/hero-guo/jsondiffpatch-for-react
44
- Based on https://github.com/benjamine/jsondiffpatch
55

66
# 1. install
77

8-
npm install jsondiffpatch-for-react
8+
npm install jsondiffpatch-react
99

1010
# 2. usage
1111

1212
```jsx
1313
import React from 'react';
14-
import JsonDiffReact from 'jsondiffpatch-for-react';
14+
import JsonDiffReact from 'jsondiffpatch-react';
1515

1616
<JsonDiffReact
1717
right: PropTypes.any,

demo/js/index.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
/**
2-
* Created by guoguangyu on 2016/10/25.
3-
*/
4-
import React from 'react';
5-
import ReactDOM from 'react-dom';
6-
import {Router, Route, browserHistory} from 'react-router';
7-
import Main from './main';
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import { BrowserRouter, Route } from "react-router-dom";
4+
import Main from "./main";
85

9-
ReactDOM.render((
10-
<Router history={browserHistory}>
6+
ReactDOM.render(
7+
<BrowserRouter>
118
<Route path="/" component={Main} />
12-
</Router>),
13-
document.querySelector('#wrapper')
9+
</BrowserRouter>,
10+
document.querySelector("#wrapper")
1411
);

demo/js/main.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
/**
2-
* Created by guoguangyu on 2016/10/25.
3-
*/
4-
import React, {Component} from 'react';
5-
import PropTypes from 'prop-types';
6-
import JsonDiffReact from '../../src/jsondiff-for-react';
1+
import React, { Component } from "react";
2+
import PropTypes from "prop-types";
3+
import JsonDiffReact from "../../src/jsondiff-for-react";
74

85
class Main extends Component {
96
static propTypes = {
107
children: PropTypes.object,
118
};
129
render() {
13-
const left = {a: 1};
14-
const right = undefined;
15-
return (<JsonDiffReact left={left} right={right} />);
10+
const left = { a: 1, c: 1 };
11+
const right = { a: 1, b: 2 };
12+
return <JsonDiffReact left={left} right={right} />;
1613
}
1714
}
1815
export default Main;

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "jsondiffpatch-for-react",
3-
"version": "1.0.4",
4-
"description": "jsondiffpatch for react",
2+
"name": "jsondiffpatch-react",
3+
"version": "1.0.6",
4+
"description": "jsondiffpatch react",
55
"main": "./lib/jsondiff-for-react.js",
66
"scripts": {
77
"start": "NODE_ENV=dev node server.js",
@@ -11,19 +11,19 @@
1111
},
1212
"repository": {
1313
"type": "git",
14-
"url": "git+https://github.com/hero-guo/jsondiffpatch-for-react.git"
14+
"url": "git+https://github.com/bluepeter/jsondiffpatch-react.git"
1515
},
1616
"keywords": [
1717
"react",
1818
"json",
1919
"diff"
2020
],
21-
"author": "guoguangyu",
21+
"author": "bluepeter",
2222
"license": "MIT",
2323
"bugs": {
24-
"url": "https://github.com/hero-guo/jsondiffpatch-for-react/issues"
24+
"url": "https://github.com/bluepeter/jsondiffpatch-react/issues"
2525
},
26-
"homepage": "https://github.com/hero-guo/jsondiffpatch-for-react#readme",
26+
"homepage": "https://github.com/bluepeter/jsondiffpatch-react#readme",
2727
"devDependencies": {
2828
"autoprefixer": "^6.3.6",
2929
"babel": "^6.5.2",
@@ -59,11 +59,11 @@
5959
"postcss": "^5.0.21",
6060
"postcss-loader": "^0.8.2",
6161
"prop-types": "^15.6.0",
62-
"react": "^16.13.1",
63-
"react-dom": "^16.13.1",
64-
"react-hot-loader": "^4.12.21",
62+
"react": "^17.0.2",
63+
"react-dom": "^17.0.2",
64+
"react-hot-loader": "^4.13.0",
6565
"react-map-styles": "^0.3.0",
66-
"react-router": "^5.2.0",
66+
"react-router-dom": "^5.2.0",
6767
"redux-logger": "^3.0.6",
6868
"rimraf": "^2.5.4",
6969
"style-loader": "^0.12.3",

src/jsondiff-for-react.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
/**
2-
* Created by guoguangyu on 2016/10/25.
3-
*/
41
import React, { Component } from "react";
52
import PropTypes from "prop-types";
63
import * as Jsondiffpatch from "jsondiffpatch";
7-
84
import "jsondiffpatch/dist/formatters-styles/html.css";
95
import "jsondiffpatch/dist/formatters-styles/annotated.css";
106

yarn.lock

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5230,20 +5230,19 @@ rcfinder@^0.1.8:
52305230
dependencies:
52315231
lodash.clonedeep "^4.3.2"
52325232

5233-
react-dom@^16.13.1:
5234-
version "16.13.1"
5235-
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f"
5236-
integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag==
5233+
react-dom@^17.0.2:
5234+
version "17.0.2"
5235+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23"
5236+
integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==
52375237
dependencies:
52385238
loose-envify "^1.1.0"
52395239
object-assign "^4.1.1"
5240-
prop-types "^15.6.2"
5241-
scheduler "^0.19.1"
5240+
scheduler "^0.20.2"
52425241

5243-
react-hot-loader@^4.12.21:
5244-
version "4.12.21"
5245-
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.21.tgz#332e830801fb33024b5a147d6b13417f491eb975"
5246-
integrity sha512-Ynxa6ROfWUeKWsTHxsrL2KMzujxJVPjs385lmB2t5cHUxdoRPGind9F00tOkdc1l5WBleOF4XEAMILY1KPIIDA==
5242+
react-hot-loader@^4.13.0:
5243+
version "4.13.0"
5244+
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.13.0.tgz#c27e9408581c2a678f5316e69c061b226dc6a202"
5245+
integrity sha512-JrLlvUPqh6wIkrK2hZDfOyq/Uh/WeVEr8nc7hkn2/3Ul0sx1Kr5y4kOGNacNRoj7RhwLNcQ3Udf1KJXrqc0ZtA==
52475246
dependencies:
52485247
fast-levenshtein "^2.0.6"
52495248
global "^4.3.0"
@@ -5269,7 +5268,20 @@ react-map-styles@^0.3.0:
52695268
resolved "https://registry.yarnpkg.com/react-map-styles/-/react-map-styles-0.3.0.tgz#f5bea50752412358e58bc019019e530bb2897202"
52705269
integrity sha1-9b6lB1JBI1jli8AZAZ5TC7KJcgI=
52715270

5272-
react-router@^5.2.0:
5271+
react-router-dom@^5.2.0:
5272+
version "5.2.0"
5273+
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
5274+
integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
5275+
dependencies:
5276+
"@babel/runtime" "^7.1.2"
5277+
history "^4.9.0"
5278+
loose-envify "^1.3.1"
5279+
prop-types "^15.6.2"
5280+
react-router "5.2.0"
5281+
tiny-invariant "^1.0.2"
5282+
tiny-warning "^1.0.0"
5283+
5284+
52735285
version "5.2.0"
52745286
resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
52755287
integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==
@@ -5285,14 +5297,13 @@ react-router@^5.2.0:
52855297
tiny-invariant "^1.0.2"
52865298
tiny-warning "^1.0.0"
52875299

5288-
react@^16.13.1:
5289-
version "16.13.1"
5290-
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
5291-
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==
5300+
react@^17.0.2:
5301+
version "17.0.2"
5302+
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
5303+
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
52925304
dependencies:
52935305
loose-envify "^1.1.0"
52945306
object-assign "^4.1.1"
5295-
prop-types "^15.6.2"
52965307

52975308
52985309
version "1.0.7"
@@ -5640,10 +5651,10 @@ sax@~1.2.1, sax@~1.2.4:
56405651
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
56415652
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
56425653

5643-
scheduler@^0.19.1:
5644-
version "0.19.1"
5645-
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
5646-
integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==
5654+
scheduler@^0.20.2:
5655+
version "0.20.2"
5656+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
5657+
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
56475658
dependencies:
56485659
loose-envify "^1.1.0"
56495660
object-assign "^4.1.1"

0 commit comments

Comments
 (0)