Skip to content

Latest commit

 

History

History
50 lines (30 loc) · 1.57 KB

File metadata and controls

50 lines (30 loc) · 1.57 KB

Migration Guides

Below are instructions for migrating from one version of dc-extension-sdk to another.

1.x.x to 2.x.x

Specifying extension types (TypeScript only)

We have introduced improved control over the extension types you are initialising. Previously you would initialise the extension using:

const sdk = await init<FieldModel, Parameters>();

In version 2.x.x you can now pass an additional extension type:

const sdk = await init<ContentFieldExtension<FieldModel, Parameters>>();

The SDK class is no longer exposed

The SDK class has been removed and the SDK properties have been moved to the ContentFieldExtension class.

Previous you could create a new instance of the SDK and invoke init() on it

import { SDK } from 'dc-extensions-sdk';

const sdk = new SDK();
await sdk.init();

Please initialise the sdk using the exposed init() method

import { init } from 'dc-extensions-sdk';

const sdk = await init<ContentFieldExtension<FieldModel, Parameters>>();

Options, OptionsObject interfaces are no longer exposed (TypeScript only)

Please use InitOptions and Partial<InitOptions> instead

Events, ContentItem, ContentLink, ContentReference, Field, Frame, Form, HttpClient & MediaLink are no longer exported

Events, ContentItem, ContentLink, ContentReference, Field, Frame, Form, HttpClient & MediaLink are no longer exported as these are internal/private data structures.

You should only be using the resolved result from the init(); call.