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
App
interface which defines the properties not changed after the app is loaded.Context - The redux store's state, which is contained within the
State
interface 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.ts
file located in theruntime/translations
directory and thedefault.ts
file within thesetting/translations
directory. A common implementation makes use of theFormatted
Message react-intl
component. Adefault
property is applied, sourced from theMessage default.ts
file.
- The
- Manage user login sessions using the
Session
class.Manager - The
App
interface is the experience's configuration structure. It is stored in the redux store.Config - Core interfaces such as
State
,All
,Widget Props Data
andSource Message
are included. Based on these interfaces, thejimu-core
package provides predefined implementations, including aFilter Data Records
message action, anExport to JSON
data action, aRecord Selection Changes
message, and so forth. - As explained above, the
Data
and theSource Component Data
provide access to the data source, while theSource Component Props Expression
and theResolver Component Expression
provide access to resolve theResolver Component Props Expression
via theon
function.Change class
,Names Resize
, and other third-party libraries are re-exported by theObserver jimu-core
package.
In summary, you will most likely use some part of the jimu-core
package for widget development.