From 3a8b162e5b57b6cbcfe1ef43ebc10fb2126f3e3c Mon Sep 17 00:00:00 2001 From: Anton Lavrenov Date: Sat, 23 Mar 2019 09:27:25 -0500 Subject: [PATCH] update deps, remove id warning --- lib/makeUpdates.js | 16 +++++----------- package.json | 10 +++++----- src/makeUpdates.js | 10 +--------- tests/index-test.js | 2 +- 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/lib/makeUpdates.js b/lib/makeUpdates.js index dc0e550..65bd5d3 100644 --- a/lib/makeUpdates.js +++ b/lib/makeUpdates.js @@ -13,7 +13,7 @@ var propsToSkip = { unstable_applyCache: true, unstable_applyDrawHitFromCache: true }; -var idWarningShowed = false; + var zIndexWarningShowed = false; var dragWarningShowed = false; @@ -27,15 +27,9 @@ function toggleStrictMode(value) { function applyNodeProps(instance, props) { var oldProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; - if (!idWarningShowed && 'id' in props) { - var message = 'ReactKonva: You are using "id" attribute for a Konva node. In some very rare cases it may produce bugs. Currently we recommend not to use it and use "name" attribute instead.\nYou are using id = "' + props.id + '".\nFor more info see: https://github.com/konvajs/react-konva/issues/119'; - console.warn(message); - idWarningShowed = true; - } - if (!zIndexWarningShowed && 'zIndex' in props) { - var _message = 'ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n'; - console.warn(_message); + var message = 'ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n'; + console.warn(message); zIndexWarningShowed = true; } @@ -44,8 +38,8 @@ function applyNodeProps(instance, props) { var hasPosition = props.x !== undefined || props.y !== undefined; var hasEvents = props.onDragEnd || props.onDragMove; if (hasPosition && !hasEvents) { - var _message2 = 'ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n'; - console.warn(_message2); + var _message = 'ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n'; + console.warn(_message); dragWarningShowed = true; } } diff --git a/package.json b/package.json index 8967927..1d57c9d 100644 --- a/package.json +++ b/package.json @@ -16,23 +16,23 @@ "url": "git@github.com:konvajs/react-konva.git" }, "dependencies": { - "react-reconciler": "^0.20.2", - "scheduler": "^0.13.4" + "react-reconciler": "^0.20.3", + "scheduler": "^0.13.5" }, "peerDependencies": { "react": "16.8.x", "react-dom": "16.8.x", - "konva": "^2.0.0 || ^3.0.0" + "konva": "^3.2.3" }, "devDependencies": { "chai": "^4.2.0", "enzyme": "^3.9.0", - "enzyme-adapter-react-16": "^1.10.0", + "enzyme-adapter-react-16": "^1.11.2", "konva": "^3.2.0", "nwb": "^0.23.0", "react": "16.8.4", "react-dom": "16.8.4", - "sinon": "^7.2.7", + "sinon": "^7.3.0", "use-image": "^1.0.3" }, "scripts": { diff --git a/src/makeUpdates.js b/src/makeUpdates.js index dfad826..a4804fa 100644 --- a/src/makeUpdates.js +++ b/src/makeUpdates.js @@ -7,7 +7,7 @@ const propsToSkip = { unstable_applyCache: true, unstable_applyDrawHitFromCache: true }; -let idWarningShowed = false; + let zIndexWarningShowed = false; let dragWarningShowed = false; @@ -19,14 +19,6 @@ export function toggleStrictMode(value) { } export function applyNodeProps(instance, props, oldProps = {}) { - if (!idWarningShowed && 'id' in props) { - const message = `ReactKonva: You are using "id" attribute for a Konva node. In some very rare cases it may produce bugs. Currently we recommend not to use it and use "name" attribute instead. -You are using id = "${props.id}". -For more info see: https://github.com/konvajs/react-konva/issues/119`; - console.warn(message); - idWarningShowed = true; - } - if (!zIndexWarningShowed && 'zIndex' in props) { const message = `ReactKonva: You are using "zIndex" attribute for a Konva node. react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. diff --git a/tests/index-test.js b/tests/index-test.js index 4b174b6..0b83232 100644 --- a/tests/index-test.js +++ b/tests/index-test.js @@ -549,7 +549,7 @@ describe.skip('Bad structure', () => { // that creates mess in id references // see: https://github.com/konvajs/react-konva/issues/119 -describe.skip('Check id saving', () => { +describe('Check id saving', () => { it('Konva can loose ids?', function() { class App extends React.Component { render() {