Skip to content

Commit

Permalink
Upgrading devtools & cleanup peer deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Feb 6, 2021
1 parent b38c2a7 commit f9bb6c3
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 88 deletions.
131 changes: 52 additions & 79 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,24 @@
"mocha": "^8.2.1",
"neo-blessed": "^0.2.0",
"prettier": "^2.2.1",
"react-devtools-core": "4.10.1",
"rollup": "^2.38.5",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0"
},
"peerDependencies": {
"blessed": "^0.1.81",
"react": "^17.0.1",
"react-devtools-core": "^3.0.0",
"ws": "^6.0.0"
"blessed": ">=0.1.81 <0.2.0",
"react": ">=17.0.1 <18.0.0",
"react-devtools-core": ">=4.10.1 <5.0.0"
},
"peerDependenciesMeta": {
"blessed": {
"optional": true
},
"react-devtools-core": {
"optional": true
}
},
"dependencies": {
"react": "^17.0.1",
Expand Down
11 changes: 6 additions & 5 deletions src/fiber/devtools.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */

module.exports = {
version: require('react').version
};

try {
require.resolve('react-devtools-core');
const defineProperty = Object.defineProperty;
defineProperty(global, 'WebSocket', {
value: require('ws')
Expand All @@ -20,9 +25,5 @@ try {
resolveRNStyle: null // TODO maybe: require('flattenStyle')
});
} catch (err) {
if (process.env.NODE_ENV !== 'production') {
console.warn(
'WARNING: the `ws` package must be installed to use `react-devtools`.'
);
}
// no devtools installed...
}

0 comments on commit f9bb6c3

Please sign in to comment.