diff --git a/CHANGELOG.md b/CHANGELOG.md index 1273e54f..9466ad28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [3.1.0][2019-02-27] + +* Make `Konva` modular: `import Konva from 'konva/lib/Core';`; + ## [3.0.0][2019-02-25] ## Breaking diff --git a/README.md b/README.md index dc70b4e6..6bc1d1c7 100644 --- a/README.md +++ b/README.md @@ -100,16 +100,22 @@ import * as Konva from 'konva'; ### 4 Minimal bundle -If you are using webpack or browserfy you can use this approach to load only required Konva's parts: - ```javascript -import Konva from 'konva/src/Core'; -// now you have Konva object with Stage, Layer, FastLayer, Group, Shape and some additional utils function -// so there are no shapes (rect, circle, etc), no filters, no d&d support. +import Konva from 'konva/lib/Core'; +// now you have Konva object with Stage, Layer, FastLayer, Group, Shape and some additional utils function. +// Also core currently already have support for drag&drop and animations. +// BUT there are no shapes (rect, circle, etc), no filters. // but you can simply add anything you need: -import 'konva/src/shapes/rect'; -//now Konva.Rect is available to use +import { Rect } from 'konva/lib/shapes/Rect'; +// importing a shape will automatically inject it into Konva object + +var rect1 = new Rect(); +// or: +var shape = new Konva.Rect(); + +// for filters you can use this: +import { Blur } from 'konva/lib/filters/Blur'; ``` ### 5 NodeJS