Jimu Core

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 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 query 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:
    • The AppContext interface which defines the properties not changed after the app is loaded.
    • 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 the runtime/translations directory and the default.ts file within the setting/translations directory. A common implementation makes use of the FormattedMessage react-intl component. A defaultMessage property is applied, sourced from the default.ts file.
  • Manage user login sessions using the SessionManager class.
  • The AppConfig interface is the experience's configuration structure. It is stored in the redux store.
  • Core interfaces such as State, AllWidgetProps, DataSource and Message are included. Based on these interfaces, the jimu-core package provides predefined implementations, including a Filter Data Records message action, an Export to JSON data action, a Record Selection Changes message, and so forth.
  • As explained above, the DataSourceComponent and the DataSourceComponentProps provide access to the data source, while the ExpressionResolverComponent and the ExpressionResolverComponentProps provide access to resolve the Expression via the onChange function.
  • classNames, ResizeObserver, and other third-party libraries are re-exported by the jimu-core package.

In summary, you will most likely use some part of the jimu-core package for widget development.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.