The 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 Data component (a union of the Data interface and the Data interface). You will use the Data to obtain the use 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 query Query 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:
- The
Appinterface which defines the properties not changed after the app is loaded.Context - The redux store's state, which is contained within the
Stateinterface holding important properties about the experience relative 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 theruntime/translationsdirectory and thedefault.tsfile within thesetting/translationsdirectory. A common implementation makes use of theFormattedMessage react-intlcomponent. Adefaultproperty is applied, sourced from theMessage default.tsfile.
- The
- Manage user login sessions using the
Sessionclass.Manager - The
Appinterface is the experience's configuration structure. It is stored in the redux store.Config - Core interfaces such as
State,All,Widget Props DataandSource Messageare included. Based on these interfaces, thejimu-corepackage provides predefined implementations, including aFilter Data Recordsmessage action, anExport to JSONdata action, aRecord Selection Changesmessage, and so forth. - As explained above, the
Dataand theSource Component Dataprovide access to the data source, while theSource Component Props Expressionand theResolver Component Expressionprovide access to resolve theResolver Component Props Expressionvia theonfunction.Change class,Names Resize, and other third-party libraries are re-exported by theObserver jimu-corepackage.
In summary, you will most likely use some part of the jimu-core package for widget development.