Migrating from 10.0 to 11.0
Migrate from Handsontable 10.0 to Handsontable 11.0, released on November 17, 2021.
More information about this release can be found in the 11.0.0 release blog post.
For a detailed list of changes in this release, see the Changelog.
Adapt to the type definition changes
In Handsontable 11.0.0, Handsontable reorganizes the TypeScript definitions files and improves the overall consistency of the types.
For more details, see this pull request.
TypeScript definitions files
Before
Before, all TypeScript definitions were kept in one file in the root directory:
/handsontable.d.ts.The only way to import types was to get all of them by importing the
Handsontablepackage:import Handsontable from 'handsontable';Now
Now, each module has its own TypeScript definitions file. They’re all kept in a new directory called
types:/handsontable/types.You can still import all of Handsontable’s type definitions in the same as way as before. Additionally, you can also import individual modules from within the Handsontable package, with correct types:
import Handsontable from 'handsontable/base';import { registerPlugin, HiddenRows } from 'handsontable/plugins';Editors’ interfaces
Handsontable 11.0.0 changes the editors’ interfaces to improve type consistency.
Before
class CustomEditor extends Handsontable.editors.BaseEditor implements Handsontable._editors.Base ()Now
class CustomEditor extends Handsontable.editors.BaseEditor implements Handsontable.editors.BaseEditor ()Adapt to the
populateFromArray()method’s changesThe
populateFromArray()method works differently now, when itsmethodargument is set toshift_downorshift_right.For more details, see this pull request.
Before
populateFromArray()performed a separatespliceRowaction for each populated row, and a separatespliceColumnaction for each populated column.- The
beforeChangeandafterChangehooks trigger multiple times, separately for each populated row and column. - The
beforeChangeandafterChangehooks trigger for eachspliceRowandspliceColumnaction, with thesourceargument defined asspliceRoworspliceCol.
Now
populateFromArray()populates rows and columns with one large operation.- The
beforeChangeandafterChangehooks are triggered only once, for all populated rows and columns. - The
beforeChangeandafterChangehooks are triggered directly by thepopulateFromArray()method, with thesourceargument defined aspopulateFromArray.
Result
Your application now runs on Handsontable 11.0.