Add script to compile usage of experimental APIs #51341
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: #47196
What?
Add a shell script that generates a Markdown-formatted list of experimental APIs found across our packages and
lib
. Here, "experimental API" means any string match for__experimental...
. For each such match, output a link to a GitHub search page for that match.Why?
Experimental APIs must be regularly audited, particularly in the context of major WordPress releases. Typically, release leads would run their own scripts as shared in comments in #47196. This PR offers one such implementation.
This came about in conversation with @ntsekouras, who had shared a Bash script that had become more difficult to maintain. /cc @tellthemachines
How?
I wrote an alternative in POSIX sh (well, with the exception of
git ls-files
, it's as POSIX as I can tell) that should perform better and be readily understandable, since it works by transforming a single stream rather than dealing with loops and state.This script's output differs from that found in the description of the audit issue, mostly because it traverses matches in a different order. This matters because the scripts ascribe experimental APIs to the first package in which they were found. This is particularly noticeable when comparing the APIs listed under
lib
.Testing Instructions
Run
./bin/list-experimental-api-matches.sh
and inspect the results. Note that the output differs from that produced by previous scripts.Generated output
List of experimental APIs
lib
__experimentalBorder
__experimentalDefault
__experimentalDuotone
__experimentalEnableColorRandomizer
__experimentalEnableGroupGridVariation
__experimentalEnableListBlockV2
__experimentalEnablePatternEnhancements
__experimentalEnableQuoteBlockV2
__experimentalEnableZoomedOutView
__experimentalFeatures
__experimentalFontFamily
__experimentalFontStyle
__experimentalFontWeight
__experimentalInteractivityAPI
__experimentalLayout
__experimentalLetterSpacing
__experimentalSelector
__experimentalSettings
__experimentalStyle
__experimentalStyles
__experimentalTextDecoration
__experimentalTextTransform
packages/annotations
__experimentalAddAnnotation
__experimentalCreateOnChangeEditableValue
__experimentalCreatePrepareEditableTree
__experimentalGetAllAnnotationsForBlock
__experimentalGetAnnotations
__experimentalGetAnnotationsForBlock
__experimentalGetAnnotationsForRichText
__experimentalGetPropsForEditableTreeChangeHandler
__experimentalGetPropsForEditableTreePreparation
__experimentalRemoveAnnotation
__experimentalRemoveAnnotationsBySource
__experimentalUpdateAnnotationRange
packages/block-directory
__experimentalIsFocusable
packages/block-editor
__experimentalAlignmentMatrixControl
__experimentalAppenderTagName
__experimentalBlockAlignmentMatrixControl
__experimentalBlockDirectory
__experimentalBlockFullHeightAligmentControl
__experimentalBlockPatternCategories
__experimentalBlockPatternSetup
__experimentalBlockPatterns
__experimentalBlockPatternsList
__experimentalBlockVariationPicker
__experimentalBlockVariationTransforms
__experimentalBorderBoxControl
__experimentalBorderRadiusControl
__experimentalBoxControl
__experimentalCanUserUseUnfilteredHTML
__experimentalCaptureToolbars
__experimentalCloneSanitizedBlock
__experimentalColorGradientControl
__experimentalColorGradientSettingsDropdown
__experimentalConvertBlockToStatic
__experimentalDateFormatPicker
__experimentalDefaultBlock
__experimentalDefaultControls
__experimentalDirectInsert
__experimentalDisableBlockOverlay
__experimentalDragComponent
__experimentalDropdownContentWrapper
__experimentalDuotoneControl
__experimentalExposeControlsToChildren
__experimentalFetchLinkSuggestions
__experimentalFetchReusableBlocks
__experimentalFetchRichUrlData
__experimentalFilterValue
__experimentalFirstVisibleItemClass
__experimentalFontAppearanceControl
__experimentalFontFamilyControl
__experimentalGetAccessibleBlockLabel
__experimentalGetActiveBlockIdByBlockNames
__experimentalGetAllowedBlocks
__experimentalGetAllowedPatterns
__experimentalGetBlockAttributesNamesByRole
__experimentalGetBlockLabel
__experimentalGetBlockListSettingsForBlocks
__experimentalGetBorderClassesAndStyles
__experimentalGetColorClassesAndStyles
__experimentalGetDirectInsertBlock
__experimentalGetElementClassName
__experimentalGetGapCSSValue
__experimentalGetGlobalBlocksByName
__experimentalGetGradientClass
__experimentalGetGradientObjectByGradientValue
__experimentalGetLastBlockAttributeChanges
__experimentalGetMatchingVariation
__experimentalGetParsedPattern
__experimentalGetPatternTransformItems
__experimentalGetPatternsByBlockTypes
__experimentalGetReusableBlockTitle
__experimentalGetSpacingClassesAndStyles
__experimentalGlobalStylesBaseStyles
__experimentalGrid
__experimentalGroup
__experimentalHStack
__experimentalHandleURLSuggestions
__experimentalHasContentRoleAttribute
__experimentalHasSplitBorders
__experimentalHeading
__experimentalHideChildBlockControls
__experimentalHint
__experimentalImageEditor
__experimentalImageSizeControl
__experimentalImageURLInputUI
__experimentalInitialIndex
__experimentalInitialPosition
__experimentalInsertionIndex
__experimentalInspectorPopoverHeader
__experimentalIsDefinedBorder
__experimentalIsQuick
__experimentalIsRenderedInSidebar
__experimentalItem
__experimentalItemGroup
__experimentalLabel
__experimentalLastVisibleItemClass
__experimentalLayoutStyle
__experimentalLetterSpacingControl
__experimentalLibrary
__experimentalLinkControl
__experimentalLinkControlSearchInput
__experimentalLinkControlSearchItem
__experimentalLinkControlSearchResults
__experimentalListView
__experimentalMetadata
__experimentalMinHeight
__experimentalNavigatorBackButton
__experimentalNavigatorButton
__experimentalNavigatorProvider
__experimentalNavigatorScreen
__experimentalNumberControl
__experimentalOnIndexChange
__experimentalOnlyMediaLibrary
__experimentalPadding
__experimentalPanelColorGradientSettings
__experimentalParentSelector
__experimentalParseQuantityAndUnitFromRawValue
__experimentalPopoverLegacyPositionToPlacement
__experimentalPreferPatternsOnRoot
__experimentalPreferredStyleVariations
__experimentalPreviewOptions
__experimentalPublishDateTimePicker
__experimentalRecursionProvider
__experimentalRenderControl
__experimentalRenderSuggestions
__experimentalResponsiveBlockControl
__experimentalReusableBlocks
__experimentalRichText
__experimentalRole
__experimentalSelectBlock
__experimentalSetIsInserterOpened
__experimentalShareWithChildBlocks
__experimentalShouldInsertAtTheTop
__experimentalShowInitialSuggestions
__experimentalShowSelectedHint
__experimentalSkipSerialization
__experimentalSlashInserter
__experimentalSpacer
__experimentalSpacingSizesControl
__experimentalStyleProvider
__experimentalText
__experimentalTextDecorationControl
__experimentalTextTransformControl
__experimentalToggleGroupControl
__experimentalToggleGroupControlOption
__experimentalToggleGroupControlOptionIcon
__experimentalToolbar
__experimentalToolbarContext
__experimentalToolsPanel
__experimentalToolsPanelContext
__experimentalToolsPanelItem
__experimentalTransferDataType
__experimentalTreeGrid
__experimentalTreeGridCell
__experimentalTreeGridItem
__experimentalTreeGridRow
__experimentalTruncate
__experimentalUndo
__experimentalUnitControl
__experimentalUpdateSelection
__experimentalUpdateSettings
__experimentalUseBlockOverlayActive
__experimentalUseBlockPreview
__experimentalUseBorderProps
__experimentalUseColorProps
__experimentalUseCustomSides
__experimentalUseCustomUnits
__experimentalUseDropZone
__experimentalUseFixedWindowList
__experimentalUseGradient
__experimentalUseHasRecursion
__experimentalUseMultipleOriginColorsAndGradients
__experimentalUseResizeCanvas
__experimentalUseSlotFills
__experimentalVStack
__experimentalVersion
__experimentalView
__experimentalZStack
__experimentaluseLayoutClasses
__experimentaluseLayoutStyles
packages/block-library
__experimentalConvert
__experimentalDiscussionSettings
__experimentalGetCoreBlocks
__experimentalGetDefaultTemplatePartAreas
__experimentalInputControl
__experimentalIsEditingReusableBlock
__experimentalOnEnter
__experimentalRegisterExperimentalCoreBlocks
__experimentalShowHowTo
__experimentalShowTooltip
__experimentalTooltipProps
packages/blocks
__experimentalGetUnprocessedBlockTypes
__experimentalReapplyBlockTypeFilters
__experimentalRegisterBlockType
__experimentalSanitizeBlockAttributes
packages/commands
__experimentalHideHeader
packages/components
__experimentalApplyValueToSides
__experimentalAutoSelectFirstMatch
__experimentalBorderControl
__experimentalConfirmDialog
__experimentalDimensionControl
__experimentalDivider
__experimentalElevation
__experimentalExpandOnFocus
__experimentalInputControlPrefixWrapper
__experimentalInputControlSuffixWrapper
__experimentalInvalid
__experimentalIsEmptyBorder
__experimentalNavigation
__experimentalNavigationBackButton
__experimentalNavigationGroup
__experimentalNavigationItem
__experimentalNavigationMenu
__experimentalNavigatorToParentButton
__experimentalPaletteEdit
__experimentalRadio
__experimentalRadioGroup
__experimentalRenderItem
__experimentalScrollable
__experimentalSurface
__experimentalTheme
__experimentalToggleGroupControlOptionBase
__experimentalUseDialog
__experimentalUseDragging
__experimentalUseFocusOutside
__experimentalUseNavigator
__experimentalUseSlot
__experimentalValidateInput
packages/compose
__experimentalWidthProvider
packages/core-data
__experimentalBatch
__experimentalFetchUrlData
__experimentalGetCurrentGlobalStylesId
__experimentalGetCurrentThemeBaseGlobalStyles
__experimentalGetCurrentThemeGlobalStylesVariations
__experimentalGetDirtyEntityRecords
__experimentalGetEntitiesBeingSaved
__experimentalGetEntityRecordNoResolver
__experimentalGetTemplateForLink
__experimentalNoFetch
__experimentalReceiveCurrentGlobalStylesId
__experimentalReceiveThemeBaseGlobalStyles
__experimentalReceiveThemeGlobalStyleVariations
__experimentalSaveSpecifiedEntityEdits
__experimentalUseEntityRecord
__experimentalUseEntityRecords
__experimentalUseResourcePermissions
packages/customize-widgets
__experimentalGetInsertionPoint
packages/date
__experimentalGetSettings
packages/dependency-extraction-webpack-plugin
__experimentalInjectInteractivityRuntime
packages/e2e-test-utils
__experimentalActivatePlugin
__experimentalDeactivatePlugin
__experimentalRest
packages/edit-post
__experimentalFullscreenModeClose
__experimentalGetPreviewDeviceType
__experimentalMainDashboardButton
__experimentalSetPreviewDeviceType
packages/edit-site
__experimentalAdditionalBlockPatternCategories
__experimentalAdditionalBlockPatterns
__experimentalDashboardLink
__experimentalGetDefaultTemplateTypes
__experimentalGetTemplateInfo
packages/editor
__experimentalCreatePageEntity
__experimentalGetDefaultTemplateType
__experimentalTearDownEditor
__experimentalUserCanCreatePages
packages/reusable-blocks
__experimentalConvertBlocksToReusable
__experimentalDeleteReusableBlock
__experimentalSetEditingReusableBlock