Skip to content

Commit

Permalink
README update.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluepeter committed Jun 9, 2021
1 parent 1cc6dad commit b019999
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 59 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
"spaced-comment": [0, "always"],
"object-curly-spacing": [0, "never"],
"func-names": 0,
"quotes": 0,
"react/jsx-quotes": 0,
"react/no-danger": 0,
"jsx-quotes": 2,
"indent": [2, 2, {"SwitchCase": 1}],
"no-unused-expressions": 0,
"no-undef": 1,
"no-undef": 0,
"prefer-arrow-callback": [0, { "allowNamedFunctions": true }],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"]}],
"react/forbid-prop-types": [0, {"forbid": []}],
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# jsondiffpatch-for-react
# jsondiffpatch-react

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

# 1. install

npm install jsondiffpatch-for-react
npm install jsondiffpatch-react

# 2. usage

```jsx
import React from 'react';
import JsonDiffReact from 'jsondiffpatch-for-react';
import JsonDiffReact from 'jsondiffpatch-react';

<JsonDiffReact
right: PropTypes.any,
Expand Down
19 changes: 8 additions & 11 deletions demo/js/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
/**
* Created by guoguangyu on 2016/10/25.
*/
import React from 'react';
import ReactDOM from 'react-dom';
import {Router, Route, browserHistory} from 'react-router';
import Main from './main';
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter, Route } from "react-router-dom";
import Main from "./main";

ReactDOM.render((
<Router history={browserHistory}>
ReactDOM.render(
<BrowserRouter>
<Route path="/" component={Main} />
</Router>),
document.querySelector('#wrapper')
</BrowserRouter>,
document.querySelector("#wrapper")
);
15 changes: 6 additions & 9 deletions demo/js/main.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
/**
* Created by guoguangyu on 2016/10/25.
*/
import React, {Component} from 'react';
import PropTypes from 'prop-types';
import JsonDiffReact from '../../src/jsondiff-for-react';
import React, { Component } from "react";
import PropTypes from "prop-types";
import JsonDiffReact from "../../src/jsondiff-for-react";

class Main extends Component {
static propTypes = {
children: PropTypes.object,
};
render() {
const left = {a: 1};
const right = undefined;
return (<JsonDiffReact left={left} right={right} />);
const left = { a: 1, c: 1 };
const right = { a: 1, b: 2 };
return <JsonDiffReact left={left} right={right} />;
}
}
export default Main;
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jsondiffpatch-for-react",
"version": "1.0.4",
"description": "jsondiffpatch for react",
"name": "jsondiffpatch-react",
"version": "1.0.6",
"description": "jsondiffpatch react",
"main": "./lib/jsondiff-for-react.js",
"scripts": {
"start": "NODE_ENV=dev node server.js",
Expand All @@ -11,19 +11,19 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/hero-guo/jsondiffpatch-for-react.git"
"url": "git+https://github.com/bluepeter/jsondiffpatch-react.git"
},
"keywords": [
"react",
"json",
"diff"
],
"author": "guoguangyu",
"author": "bluepeter",
"license": "MIT",
"bugs": {
"url": "https://github.com/hero-guo/jsondiffpatch-for-react/issues"
"url": "https://github.com/bluepeter/jsondiffpatch-react/issues"
},
"homepage": "https://github.com/hero-guo/jsondiffpatch-for-react#readme",
"homepage": "https://github.com/bluepeter/jsondiffpatch-react#readme",
"devDependencies": {
"autoprefixer": "^6.3.6",
"babel": "^6.5.2",
Expand Down Expand Up @@ -59,11 +59,11 @@
"postcss": "^5.0.21",
"postcss-loader": "^0.8.2",
"prop-types": "^15.6.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-hot-loader": "^4.12.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-hot-loader": "^4.13.0",
"react-map-styles": "^0.3.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"redux-logger": "^3.0.6",
"rimraf": "^2.5.4",
"style-loader": "^0.12.3",
Expand Down
4 changes: 0 additions & 4 deletions src/jsondiff-for-react.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
/**
* Created by guoguangyu on 2016/10/25.
*/
import React, { Component } from "react";
import PropTypes from "prop-types";
import * as Jsondiffpatch from "jsondiffpatch";

import "jsondiffpatch/dist/formatters-styles/html.css";
import "jsondiffpatch/dist/formatters-styles/annotated.css";

Expand Down
51 changes: 31 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5230,20 +5230,19 @@ rcfinder@^0.1.8:
dependencies:
lodash.clonedeep "^4.3.2"

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

react-hot-loader@^4.12.21:
version "4.12.21"
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.12.21.tgz#332e830801fb33024b5a147d6b13417f491eb975"
integrity sha512-Ynxa6ROfWUeKWsTHxsrL2KMzujxJVPjs385lmB2t5cHUxdoRPGind9F00tOkdc1l5WBleOF4XEAMILY1KPIIDA==
react-hot-loader@^4.13.0:
version "4.13.0"
resolved "https://registry.yarnpkg.com/react-hot-loader/-/react-hot-loader-4.13.0.tgz#c27e9408581c2a678f5316e69c061b226dc6a202"
integrity sha512-JrLlvUPqh6wIkrK2hZDfOyq/Uh/WeVEr8nc7hkn2/3Ul0sx1Kr5y4kOGNacNRoj7RhwLNcQ3Udf1KJXrqc0ZtA==
dependencies:
fast-levenshtein "^2.0.6"
global "^4.3.0"
Expand All @@ -5269,7 +5268,20 @@ react-map-styles@^0.3.0:
resolved "https://registry.yarnpkg.com/react-map-styles/-/react-map-styles-0.3.0.tgz#f5bea50752412358e58bc019019e530bb2897202"
integrity sha1-9b6lB1JBI1jli8AZAZ5TC7KJcgI=

react-router@^5.2.0:
react-router-dom@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662"
integrity sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==
dependencies:
"@babel/runtime" "^7.1.2"
history "^4.9.0"
loose-envify "^1.3.1"
prop-types "^15.6.2"
react-router "5.2.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

[email protected]:
version "5.2.0"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==
Expand All @@ -5285,14 +5297,13 @@ react-router@^5.2.0:
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react@^16.13.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==
react@^17.0.2:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037"
integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"

[email protected]:
version "1.0.7"
Expand Down Expand Up @@ -5640,10 +5651,10 @@ sax@~1.2.1, sax@~1.2.4:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==

scheduler@^0.19.1:
version "0.19.1"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==
scheduler@^0.20.2:
version "0.20.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91"
integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
Expand Down

0 comments on commit b019999

Please sign in to comment.