-
Notifications
You must be signed in to change notification settings - Fork 80
Migrating From egjs 1.x.x to egjs 2.0.0
ajaxpf edited this page Sep 18, 2017
·
17 revisions
egjs 2.0.0 rewrote egjs 1.x.x to separate the components of egjs 1.x.x into independent projects
- to keep lighter and concentrating the feature as is
- to have competitive functionality
- speeding up development process to being evolved fulfilling necessities
major changes in egjs 2.0 are as follows.
- Removed jQuery dependency transitioning to vanillaJS
- Transition to ES6/7
- eg.MovableCoord is completely rewritten under the name eg.Axes.
- Some of the utility functions in eg namespace are separated by eg.Agent, eg.rotate.
- Deprecated and Removed eg.Class, eg namespace utilities
egjs 2.0 provides each repository. you can download each resource through npm.
-
egjs-agent
npm install @egjs/agent
-
egjs-axes
npm install @egjs/axes
-
egjs-component
npm install @egjs/component
-
egjs-flicking
npm install @egjs/flicking
-
egjs-infinitegrid
npm install @egjs/infinitegrid
-
egjs-persist
npm install @egjs/persist
-
egjs-rotate
npm install @egjs/rotate
-
egjs-visible
npm install @egjs/visible
-
egjs-jquery-pauseresume
npm install @egjs/jquery-pauseresume
-
egjs-jquery-transform
npm install @egjs/jquery-transform
If you used eg.Movablecoord, change it to eg.Axes.
For more information, see the following:
https://naver.github.io/egjs-axes/
eg.agent
is still provided by the egjs-agent module
- eg.cancelAnimationFrame
- eg.isHWAccelerable : It is still provided by eg.isHWAccelerable.js at gist.
- eg.isPortrait : It is still provided by egjs-rotate#isVertical
- eg.isTransitional
- eg.requestAnimationFrame
- eg.translate : It is still provided by [eg.translate.js] (https://gist.github.com/ajaxpf/06f50c57b3e91863b96029bc5c3046ca) at gist.
jQuery.animate/pause/resume are still provided by the egjs-jquery-transform and egjs-jquery-pauseresume modules
- jQuery.persist()
- jQuery.fn.flicking()
- jQuery.fn.infiniteGrid()
- jQuery.fn.visible()
- jQuery custom events
- rotate
- scrollEnd
- flicking:beforeFlickStart
- flicking:beforeRestore
- flicking:flick
- flicking:flickEnd
- flicking:restore
- infiniteGrid:append
- infiniteGrid:layoutComplete
- infiniteGrid:prepend
- visible:change
rotate event is still provided by the egjs-rotate module
// bind rotate event
$(window).on("rotate", handler);
// unbind rotate event
$(window).off("rotate", handler);
// or unbind all the rotate event binds
$(window).off("rotate");
// bind rotate event
eg.rotate.on(handler);
// unbind rotate event
eg.rotate.off(handler);
// or unbind all the rotate event binds
eg.rotate.off();
Each persist instance has an independent store.
// set
$.persist("KEY",state);
// get
$.persist("KEY");
const persist = new eg.Persist("componentID");
// set
persist.set("KEY",state);
// get
persist.get("KEY");