Options
All
  • Public
  • Public/Protected
  • All
Menu

Version 5.0.1

General

See Hive Interface Registration for details.

How to upgrade

As a reference you can always check the example project (.template-project or custom-js-4-partners).

1. Update package.json

Add or update the following packages:

Please compare with the package.json of the latest example projects (.template-project or custom-js-4-partners), on where to add them.

  • @combeenation/custom-js-utils
  • ts-interface-checker
  • ts-interface-builder

Combeenation Devs only
There are two package.json files: One in the root directory and one per project.
Changes in the root directory should not be required!

2. Create Hive typing files

Every typing which represents a record-component must be moved inside a hive.d.ts file.
If the current typings-file only contains such interfaces it can simply be renamed.

Otherwise it's best practice to split them up in at least two files: Example

3. Start a watch/build process

This step is done automatically but noted for the sake of completeness.

For every 'Hive typing file' a file is created inside /src/typings-generated-objs/.
These files should never be modified!

4. Import and register in CJS project

All generated files should be imported and registered at the very beginning.

For easier usage make sure that all your interfaces follow the same naming convention.
E.g.: Identical to component-name, ending with 'Record', beginning with 'I', etc.

import { CmpUtils } from '@combeenation/custom-js-utils';
import HiveCmpItf from './typings-generated-objs/myproject-typings.hive.d-ti';

CfgrUtils.onCfgrReady(() => {
  // Example 1: all interfaces match the cmp-name
  CmpUtils.registerInterfaceSuite(HiveCmpItf);

  // Example 2: all interfaces end with 'Record'
  CmpUtils.registerInterfaceSuite(HiveCmpItf, { namePostfix: 'Record' });

  // Example: same as Example 1 with one additional mapping ->
  //          Cmp 'SpecialCmp' uses Interface 'ProductRecord'
  CmpUtils.registerInterfaceSuite(HiveCmpItf, {
    mappings: {
      'SpecialCmp': HiveCmpItf.ProductRecord
    }
  });

  // YOUR CODE
}

If there are special cases like multiple components using the same interface, it's possible to configure this as well.

For details see CmpUtils.registerInterfaceSuite and its options Cbn.CJS.CmpInterfaceSuiteOptions.

5. Test your project

Possible issues or errors aren't visible until a record is retrieved the first time.

Test all features of the project and check for any errors in the Console of your DevTools.

Generated using TypeDoc