deprecate some methods

This commit is contained in:
Anton Lavrenov 2021-05-21 10:45:44 -05:00
parent 734a66a75c
commit 29badd7f6c
10 changed files with 1429 additions and 1450 deletions

View File

@ -5,7 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## **NOT RELEASED V8** ## **NOT RELEASED V8**
This is going to be a very large release. This is going to be a very large release. The long term of Konva API is to make it simpler and faster. So when possible I am trying to optimize the code and remove unpopular/confusing API methods.
**BREAKING:** **BREAKING:**

2846
konva.js

File diff suppressed because it is too large Load Diff

4
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "konva", "name": "konva",
"version": "8.0.0-0", "version": "8.0.0-2",
"author": "Anton Lavrenov", "author": "Anton Lavrenov",
"files": [ "files": [
"README.md", "README.md",

View File

@ -108,9 +108,6 @@ var ABSOLUTE_OPACITY = 'absoluteOpacity',
].join(SPACE), ].join(SPACE),
SCALE_CHANGE_STR = ['scaleXChange.konva', 'scaleYChange.konva'].join(SPACE); SCALE_CHANGE_STR = ['scaleXChange.konva', 'scaleYChange.konva'].join(SPACE);
// TODO: can we remove children from node?
const emptyChildren = [];
let idCounter = 1; let idCounter = 1;
// create all the events here // create all the events here

View File

@ -197,24 +197,12 @@ export class Shape<
shapes[key] = this; shapes[key] = this;
} }
/**
* get canvas context tied to the layer
* @method
* @name Konva.Shape#getContext
* @returns {Konva.Context}
*/
// TODO: remove method
getContext() { getContext() {
Util.warn('shape.getContext() method is deprecated. Please don not use it.');
return this.getLayer().getContext(); return this.getLayer().getContext();
} }
/**
* get canvas renderer tied to the layer. Note that this returns a canvas renderer, not a canvas element
* @method
* @name Konva.Shape#getCanvas
* @returns {Konva.Canvas}
*/
// TODO: remove method
getCanvas() { getCanvas() {
Util.warn('shape.getCanvas() method is deprecated. Please don not use it.');
return this.getLayer().getCanvas(); return this.getLayer().getCanvas();
} }

View File

@ -25,7 +25,7 @@ var STAGE = 'Stage',
MOUSEMOVE = 'mousemove', MOUSEMOVE = 'mousemove',
MOUSEDOWN = 'mousedown', MOUSEDOWN = 'mousedown',
MOUSEUP = 'mouseup', MOUSEUP = 'mouseup',
// TODO: add them into "on" method docs and into site docs
POINTERMOVE = 'pointermove', POINTERMOVE = 'pointermove',
POINTERDOWN = 'pointerdown', POINTERDOWN = 'pointerdown',
POINTERUP = 'pointerup', POINTERUP = 'pointerup',

View File

@ -909,7 +909,6 @@ describe('DragAndDrop', function () {
] ]
); );
}); });
// TODO: try to move two shapes on different stages
it('can stop drag on dragstart without changing position later', function () { it('can stop drag on dragstart without changing position later', function () {
var stage = addStage(); var stage = addStage();

View File

@ -30,8 +30,6 @@ describe('Text', function () {
assert.equal(layer.getContext().getTrace(), trace); assert.equal(layer.getContext().getTrace(), trace);
}); });
// ======================================================
// TODO: what is the best UX here?
it('check text with FALSY values', function () { it('check text with FALSY values', function () {
var stage = addStage(); var stage = addStage();
var layer = new Konva.Layer(); var layer = new Konva.Layer();

View File

@ -385,7 +385,6 @@ describe('TouchEvents', function () {
); );
// now try to make two touches at the same time // now try to make two touches at the same time
// TODO: should we trigger touch end first?
simulateTouchStart( simulateTouchStart(
stage, stage,
[ [