From b0199992d3616fa5b1076dd29146cd13530dc5a9 Mon Sep 17 00:00:00 2001 From: Peter Bray Date: Wed, 9 Jun 2021 09:35:24 -0700 Subject: [PATCH] README update. --- .eslintrc | 4 ++- README.md | 6 ++--- demo/js/index.js | 19 ++++++--------- demo/js/main.js | 15 +++++------- package.json | 22 ++++++++--------- src/jsondiff-for-react.js | 4 --- yarn.lock | 51 ++++++++++++++++++++++++--------------- 7 files changed, 62 insertions(+), 59 deletions(-) diff --git a/.eslintrc b/.eslintrc index 1157da0..bca574d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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": []}], diff --git a/README.md b/README.md index 8a3edc9..203dff8 100644 --- a/README.md +++ b/README.md @@ -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'; +ReactDOM.render( + - ), - document.querySelector('#wrapper') + , + document.querySelector("#wrapper") ); diff --git a/demo/js/main.js b/demo/js/main.js index 2671179..e9b361d 100644 --- a/demo/js/main.js +++ b/demo/js/main.js @@ -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 (); + const left = { a: 1, c: 1 }; + const right = { a: 1, b: 2 }; + return ; } } export default Main; diff --git a/package.json b/package.json index def7cd2..7ccbbcd 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", @@ -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", diff --git a/src/jsondiff-for-react.js b/src/jsondiff-for-react.js index 2d3ed2c..d9332aa 100644 --- a/src/jsondiff-for-react.js +++ b/src/jsondiff-for-react.js @@ -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"; diff --git a/yarn.lock b/yarn.lock index 3860ef8..1ed68b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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" + +react-router@5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293" integrity sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw== @@ -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" read@1.0.x: version "1.0.7" @@ -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"