Migration Steps for Cloud Apps Core
This document outlines the changes needed to migrate from the old plugin bridge system to the new Cloud Apps Core system.
Prerequisites
Install the New Package
First, install the required package:
yarn add @jtl-software/cloud-apps-coreRemove the Old Package
After completing the migration, remove the old package:
yarn remove @jtl-software/platform-plugins-coreFrontend Changes
Overview of Changes
The migration involves three main pattern changes:
- Package and Import: Switch from
platform-plugins-coretocloud-apps-core - Method Calls: Add
.methodnamespace to all bridge method calls - Event Handling: Add
.eventnamespace to all event subscriptions
1. Import Changes
Before:
import { createPluginBridge, PluginBridge } from '@jtl-software/platform-plugins-core';After:
import { AppBridge, createAppBridge } from '@jtl-software/cloud-apps-core';2. Method Calling
Before:
bridge.callMethod('methodName', ...args);After:
bridge.method.call('methodName', ...args);3. Event Handling
Before:
appBridge.subscribe('eventName', (data: EventDataType) => {
// Handle event data
});After:
appBridge.event.subscribe('eventName', (data: EventDataType) => {
// Handle event data
});Migration Checklist
- Install the new package:
yarn add @jtl-software/cloud-apps-core - Update import statements to use
AppBridgeandcreateAppBridge - Replace
bridge.callMethod()calls withbridge.method.call() - Update event subscriptions to use
appBridge.event.subscribe() - Test all functionality after migration
- Update any TypeScript types if needed
- Remove the old package:
yarn remove @jtl-software/platform-plugins-core