Skip to content

Commit

Permalink
Lodash: Refactor embed block away from _.kebabCase() (#51916)
Browse files Browse the repository at this point in the history
* Lodash: Refactor embed block away from _.kebabCase()

* Expose kebabCase for RN
  • Loading branch information
tyxla authored Jun 27, 2023
1 parent d9c53e1 commit 33fc395
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions packages/block-editor/src/private-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as globalStyles from './components/global-styles';
import { ExperimentalBlockEditorProvider } from './components/provider';
import { lock } from './lock-unlock';
import { getRichTextValues } from './components/rich-text/content';
import { kebabCase } from './utils/object';
import ResizableBoxPopover from './components/resizable-box-popover';
import { ComposedPrivateInserter as PrivateInserter } from './components/inserter';
import { PrivateListView } from './components/list-view';
Expand All @@ -27,6 +28,7 @@ lock( privateApis, {
...globalStyles,
ExperimentalBlockEditorProvider,
getRichTextValues,
kebabCase,
PrivateInserter,
PrivateListView,
ResizableBoxPopover,
Expand Down
2 changes: 2 additions & 0 deletions packages/block-editor/src/private-apis.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import * as globalStyles from './components/global-styles';
import { ExperimentalBlockEditorProvider } from './components/provider';
import { kebabCase } from './utils/object';
import { lock } from './lock-unlock';

/**
Expand All @@ -11,5 +12,6 @@ import { lock } from './lock-unlock';
export const privateApis = {};
lock( privateApis, {
...globalStyles,
kebabCase,
ExperimentalBlockEditorProvider,
} );
10 changes: 4 additions & 6 deletions packages/block-library/src/embed/util.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
/**
* Internal dependencies
*/
import { ASPECT_RATIOS, WP_EMBED_TYPE } from './constants';

/**
* External dependencies
*/
import { kebabCase } from 'lodash';
import classnames from 'classnames/dedupe';
import memoize from 'memize';

/**
* WordPress dependencies
*/
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
import { renderToString } from '@wordpress/element';
import {
createBlock,
Expand All @@ -24,8 +19,11 @@ import {
* Internal dependencies
*/
import metadata from './block.json';
import { ASPECT_RATIOS, WP_EMBED_TYPE } from './constants';
import { unlock } from '../lock-unlock';

const { name: DEFAULT_EMBED_BLOCK } = metadata;
const { kebabCase } = unlock( blockEditorPrivateApis );

/** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */

Expand Down

1 comment on commit 33fc395

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 33fc395.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5389832392
📝 Reported issues:

Please sign in to comment.