Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove deprecated props & methods [EXT-4467] #1597

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ export default function createEditor(
onLocaleSettingsChanged: (handler) => {
return localeSettingsSignal.attach(handler)
},
/**
* @deprecated
*/
onShowDisabledFieldsChanged: (handler) => {
return showHiddenFieldsSignal.attach(handler)
},
getShowHiddenFields(): boolean {
return showHiddenFieldsSignal.getMemoizedArgs()[0]
},
Expand Down
9 changes: 0 additions & 9 deletions lib/types/api.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,6 @@ export interface SharedEditorSDK {
callback: (localeSettings: EditorLocaleSettings) => void
) => () => void

/**
* Subscribes to changes of whether or not disabled fields are displayed
*
* @param callback Function that is called every time the setting whether or not disabled fields are displayed changes. Called immediately with the current state.
* @returns Function to unsubscribe. `callback` won't be called anymore.
* @deprecated Use {@link onShowHiddenFieldsChanged} instead
*/
onShowDisabledFieldsChanged: (callback: (showDisabledFields: boolean) => void) => () => void

/**
* Returns whether or not hidden fields are displayed
*
Expand Down
4 changes: 0 additions & 4 deletions lib/types/app.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ interface AppStateEditorInterfaceItem {
controls?: Array<{ fieldId: string; settings?: Record<string, any> }>
sidebar?: { position: number; settings?: Record<string, any> }
editors?: { position: number; settings?: Record<string, any> }
/**
* @deprecated use `editors` instead
*/
editor?: boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we deprecate this? isn't this a slight regression in DX?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally, EditorInterface only had one editor. At some point, we allowed having multiple editors for one content type (the tabs [editor, reference, tags]). At that point editor was deprecated with editors.

The original editor boolean doesn't allow you to specify instance parameters or the position of the app. editors allows that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, that makes more sense now! ty 😄

}

export interface AppState {
Expand Down
5 changes: 0 additions & 5 deletions lib/types/entry.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ export interface EntryAPI extends TaskAPI {
onSysChanged: (callback: (sys: EntrySys) => void) => () => void
/** Allows to control the values of all other fields in the current entry. */
fields: { [key: string]: EntryFieldAPI }
/**
* Optional metadata on an entry
* @deprecated
*/
metadata?: Metadata
getMetadata: () => Metadata | undefined
onMetadataChanged: (callback: (metadata?: Metadata) => void) => VoidFunction
}
2 changes: 0 additions & 2 deletions test/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export const actionSelectors = {

export const widgetLocation = {
entryField: 'entry-field',
/** @deprecated */
entryFieldSidebar: 'entry-field-sidebar',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is deprecated simply because this concept was specific to legacy UI extensions, right? (field editor as a sidebar extension?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. entry field sidebar is extensions only

entrySidebar: 'entry-sidebar',
dialog: 'dialog',
entryEditor: 'entry-editor',
Expand Down