Migrating from 17.1 to 18.0
Migrate from Handsontable 17.1 to Handsontable 18.0.
For a detailed list of changes in this release, see the Changelog.
Replace
handsontable/commonimportsThe
handsontable/commonsubpath is removed in version 18.0. It was never part of the official public API and was not documented, but some projects imported TypeScript types from it directly.All types previously available at
handsontable/commonare now exported from the main entry points —handsontableandhandsontable/base. The new exports are a superset: every type that existed inhandsontable/commonis available in the new location.Who is affected
You are affected if your TypeScript source files contain any of these import patterns:
import type { ... } from 'handsontable/common';import { ... } from 'handsontable/common';How to migrate
Replace every
handsontable/commonimport with an import fromhandsontable(orhandsontable/baseif you use tree shaking).The table below lists the complete set of types that were available from
handsontable/commonand their new import location.Type New import GridSettingshandsontableEventshandsontableHotInstancehandsontableColumnSettingshandsontableCellPropertieshandsontableCellMetahandsontableCellValuehandsontableCellChangehandsontableChangeSourcehandsontableRowObjecthandsontableSourceRowDatahandsontableNumericFormatOptionshandsontableSelectOptionsObjecthandsontableRangeTypehandsontableCellCoordshandsontableCellRangehandsontableIndexMapperhandsontableHooksRegistryhandsontableBefore:
import type { RowObject, CellChange, GridSettings } from 'handsontable/common';After:
import type { RowObject, CellChange, GridSettings } from 'handsontable';Or, if you use the base module with tree shaking:
import type { RowObject, CellChange, GridSettings } from 'handsontable/base';Quick fix with search and replace
To migrate an entire project at once, run a global find-and-replace in your editor or IDE:
Find:
from 'handsontable/common'Replace:
from 'handsontable'If you use double quotes:
Find:
from "handsontable/common"Replace:
from "handsontable"For a full reference of all exported types and usage examples, see TypeScript types.
Summary of breaking changes
| Change | Who is affected | Action required |
|---|---|---|
handsontable/common subpath removed | Any project importing TypeScript types from handsontable/common | Replace from 'handsontable/common' with from 'handsontable' (or from 'handsontable/base') |
Related resources
Result
Your application now runs on Handsontable 18.0.