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

Audit experimental APIs (WP 5.5) #23615

Closed
ellatrix opened this issue Jul 1, 2020 · 8 comments
Closed

Audit experimental APIs (WP 5.5) #23615

ellatrix opened this issue Jul 1, 2020 · 8 comments
Labels
[Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@ellatrix
Copy link
Member

ellatrix commented Jul 1, 2020

For each of these: is it still relevant? Can it be removed, or should I become a stable API? Cc @WordPress/gutenberg-core.

This list is created with the help of @jorgefilipecosta's script:

var reportExperimental = ( obr = window.wp, retObj = {}, path = [], depth = 0 ) => {
    if( depth > 6 || ! lodash.isObject( obr ) ) { return; }
    for( const key of Object.keys( obr ) ) {
        if( key.startsWith( '__experimental' ) ) {
            lodash.set( retObj, [ ...path, key ], typeof obr[ key ] ); 
        }
        reportExperimental( obr[ key ], retObj, [ ...path, key ], depth + 1 );
    }
    return retObj;
}

It only checks exposed properties on the window global, so its doesn't include parameters. I'll either find a better way to automate it or search manually, then update this issue.

Block Editor

__experimentalAlignmentHookSettingsProvider: "object"
__experimentalBlock: "object"
__experimentalBlockAlignmentMatrixToolbar: "function"
__experimentalBlockNavigationBlockFill: "function"
__experimentalBlockNavigationEditor: "function"
__experimentalBlockNavigationTree: "function"
__experimentalBlockSettingsMenuFirstItem: "function"
__experimentalBlockVariationPicker: "function"
__experimentalColorGradientControl: "function"
__experimentalGetGradientClass: "function"
__experimentalGetGradientObjectByGradientValue: "function"
__experimentalGradientPicker: "function"
__experimentalGradientPickerControl: "function"
__experimentalGradientPickerPanel: "function"
__experimentalImageSizeControl: "function"
__experimentalImageURLInputUI: "function"
__experimentalInserterMenuExtension: "function"
__experimentalLibrary: "function"
__experimentalLineHeightControl: "function"
__experimentalLinkControl: "function"
__experimentalPanelColorGradientSettings: "function"
__experimentalPreviewOptions: "function"
__experimentalResponsiveBlockControl: "function"
__experimentalUnitControl: "function"
__experimentalUseColors: "function"
__experimentalUseEditorFeature: "function"
__experimentalUseGradient: "function"
__experimentalUseResizeCanvas: "function"

SETTINGS_DEFAULTS

__experimentalBlockDirectory: "boolean"
__experimentalCanUserUseUnfilteredHTML: "boolean"
__experimentalEnableFullSiteEditing: "boolean"
__experimentalEnableFullSiteEditingDemo: "boolean"
__experimentalEnableLegacyWidgetBlock: "boolean"

Block Library

__experimentalRegisterExperimentalCoreBlocks: "function"

Blocks

__experimentalGetAccessibleBlockLabel: "function"
__experimentalGetBlockLabel: "function"

Components

__experimentalAlignmentMatrixControl: "function"
__experimentalBoxControl: "function"
__experimentalCustomGradientPicker: "function"
__experimentalDimensionControl: "function"
__experimentalGradientPicker: "function"
__experimentalInputControl: "object"
__experimentalNumberControl: "object"
__experimentalRadio: "object"
__experimentalRadioGroup: "object"
__experimentalText: {defaultProps: {…}, __emotion_real: {…}, __emotion_forwardProp: {…}}
__experimentalToolbarContext: {_currentValue: {…}, _currentValue2: {…}, Provider: {…}, Consumer: {…}}
__experimentalToolbarItem: "object"
__experimentalTreeGrid: "function"
__experimentalTreeGridCell: "object"
__experimentalTreeGridItem: "object"
__experimentalTreeGridRow: "object"
__experimentalUnitControl: "object"
__experimentalUseSlot: "function"

Compose

useViewportMatch: {__experimentalWidthProvider: "object"}
__experimentalUseDragging: "function"

Data

__experimentalResolveSelect: "function"

Date

__experimentalGetSettings: "function"

Edit Post

__experimentalFullscreenModeClose: "function"

Actions

__experimentalConvertBlockToReusable: "function"
__experimentalConvertBlockToStatic: "function"
__experimentalDeleteReusableBlock: "function"
__experimentalFetchReusableBlocks: "function"
__experimentalLocalAutosave: "function"
__experimentalOptimisticUpdatePost: "function"
__experimentalReceiveReusableBlocks: "function"
__experimentalRequestPostUpdateFinish: "function"
__experimentalRequestPostUpdateStart: "function"
__experimentalSaveReusableBlock: "function"
__experimentalTearDownEditor: "function"
__experimentalUpdateReusableBlock: "function"

Selectors

__experimentalGetReusableBlock: "function"
__experimentalGetReusableBlocks: "function"
__experimentalIsFetchingReusableBlock: "function"
__experimentalIsSavingReusableBlock: "function"

Rich Text

__experimentalRichText: "object"

Nothing changed here since 5.4. This should remain experimental.

@ellatrix ellatrix added the [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. label Jul 1, 2020
@ellatrix ellatrix added this to the Gutenberg 8.5 milestone Jul 1, 2020
@ellatrix ellatrix changed the title Audit experimental APIs Audit experimental APIs (WP 5.5) Jul 1, 2020
@youknowriad
Copy link
Contributor

The ones I know about on top of my head

__experimentalColorGradientControl: "function"
__experimentalGetGradientClass: "function"
__experimentalGetGradientObjectByGradientValue: "function"
__experimentalGradientPicker: "function"
__experimentalGradientPickerControl: "function"
__experimentalGradientPickerPanel: "function"
__experimentalUseColors: "function"
__experimentalUseGradient: "function"
__experimentalPanelColorGradientSettings: "function"

These gradients/colors related APIs should stay experimental. Ideally we remove them at some point and just rely on the "support flags"

__experimentalLibrary: "function"

This is the new inserter library component, I think it's starting to become mature, but let's stabilize it after 5.5

__experimentalUseEditorFeature: "function"

This is a great API that I'd love to stabilize sometimes but it's probably going to happen when we release Global styles.

__experimentalEnableFullSiteEditing: "boolean"
__experimentalEnableFullSiteEditingDemo: "boolean"
__experimentalEnableLegacyWidgetBlock: "boolean"

These should stay as experimental as these features (widgets screen and FSE) are still not ready yet.

__experimentalCanUserUseUnfilteredHTML: "boolean"

Maybe it's time to mark this as stable? @ellatrix you should know better here.

__experimentalRegisterExperimentalCoreBlocks

Seems like this could be made unstable as it's not something that should ever be made stable.

__experimentalGetSettings (date)

I'd like for this to be made unstable or removed but we need to refactor the module to drop moment first.

__experimentalInputControl

Why do we have both InputControl and TextControl? cc @ItsJonQ

__experimentalNumberControl

This one seems safe to stabilize?

__experimentalResolveSelect

We have this for some time now, is it time to make it stable cc @nerrad ?

Reusable blocks selectors and actions

These shouldn't be made stable as we should refactor reusable blocks to use entities instead.

@nerrad
Copy link
Contributor

nerrad commented Jul 1, 2020

__experimentalResolveSelect
We have this for some time now, is it time to make it stable cc @nerrad ?

I know of other projects that want to start using this reliably, so ya I’m fine with this being made stable.

@gziolo
Copy link
Member

gziolo commented Jul 2, 2020

  • __experimentalBlockVariationPicker: "function" – depends on Block API: Extract common logic as an initial screen for blocks that define variations #20582
  • __experimentalInserterMenuExtension – it could be revisited and promoted to stable API now that Block Directory is scheduled for WordPress 5.5
  • __experimentalUseEditorFeature – I confirm that it's too early, it's used in a few places already
  • __experimentalBlockDirectory – I guess this setting can be now removed since it's Block Directory is always enabled
  • __experimentalRegisterExperimentalCoreBlocks – I agree that is should be updated to unstable API

@diegohaz, has some follow-up work planned for the toolbar related components in #23316, it might impact:

  • __experimentalToolbarContext: {_currentValue: {…}, _currentValue2: {…}, Provider: {…}, Consumer: {…}}
  • __experimentalToolbarItem: "object"
  • __experimentalUseSlot: "function"

@ItsJonQ
Copy link

ItsJonQ commented Jul 6, 2020

Why do we have both InputControl and TextControl

@youknowriad Ideally, <InputControl /> would replace <TextControl />. However, I'm not comfortable making that leap yet!

@adamziel
Copy link
Contributor

adamziel commented Jul 7, 2020

The following ones are within the scope of the experimental navigation screen that's being actively developed:

  • __experimentalTreeGrid* - necessary for accessible block navigator.
  • __experimentalBlockNavigationTree - block navigator with extra featured.
  • __experimentalBlockNavigationEditor and __experimentalBlockNavigationBlockFill - required for inline editing of block navigator labels that is going to be implemented soon-ish.

@youknowriad youknowriad removed this from the Gutenberg 8.5 milestone Jul 8, 2020
@ellatrix
Copy link
Member Author

Let's close and audit again a bit more ahead of time for WP 5.6.

@iandunn
Copy link
Member

iandunn commented Sep 19, 2020

__experimentalGetSettings (date)
I'd like for this to be made unstable or removed but we need to refactor the module to drop moment first.

FWIW I've found it useful several times, like WordCamp.org's Schedule block and date-control. It could also be used in #core51130 if it were stable.

@youknowriad
Copy link
Contributor

@iandunn I believe some of these settings might be too moment dependent and since moment is being "deprecated", we might want to hold, see if we can get rid of moment internally and reconsider that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
None yet
Development

No branches or pull requests

7 participants