jimu-core package contains classes, types, properties, functions, interfaces, enumerations and third party functions which will be used for widget development. The package focuses on handling widget properties, dispatching message actions, assigning data sources, and other tasks that are used for widget development.
Most widgets will make use of the
DataSourceComponent component (a union of the
DataSourceComponentProps interface and the
DataSourceComponentStateProps interface). You will use the
DataSourceComponent to obtain the
useDataSource immutable object containing the data source used by the widget, which is set by the experience author on the settings page. You may also use the
QueryParams query parameters which is sourced from the settings page and/or from within the widget against the data source.
A broad summary of the contents of the
jimu-core package are as follows:
- Initializes the app running environment including:
AppContextinterface which defines the properties not changed after the app is loaded.
- The redux store's state, which is contained within the
Stateinterface holding important properties about the experience reative to the widget, app, client, data source, map, theme, user locale, app location and portal.
- i18n internationalization, handled by translations strings within a
default.tsfile located in the
runtime/translationsdirectory and the
default.tsfile within the
setting/translationsdirectory. A common implementation makes use of the
defaultMessageproperty is applied, sourced from the
- Manage user login sessions using the
AppConfiginterface is the experience's configuration structure. It is stored in the redux store.
- Core interfaces such as
Messageare included. Based on these interfaces, the
jimu-corepackage provides predefined implementations, including a
Filter Data Recordsmessage action, an
Export to JSONdata action, a
Record Selection Changesmessage, and so forth.
- As explained above, the
DataSourceComponentPropsprovide access to the data source, while the
ExpressionResolverComponentPropsprovide acccess to resolve the
ResizeObserver, and other third-party libraries are re-exported by the
In summary, you will most likely use some part of the
jimu-core package for widget development.