Skip to content

Commit

Permalink
Add TODO note about RNMobile's circular dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsf committed Jul 17, 2023
1 parent 4382c18 commit a1ceee2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/core-data/src/footnotes/get-rich-text-values-cached.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
*/
import { unlock } from '../private-apis';

// Avoid calling `unlock` at the module level, deferring the call until needed
// in `getRichTextValuesCached`.
// TODO: The following line should have been:
//
// const unlockedApis = unlock( blockEditorPrivateApis );
//
// But there are hidden circular dependencies in RNMobile code, specifically in
// certain native components in the `components` package that depend on
// `block-editor`. What follows is a workaround that defers the `unlock` call
// to prevent native code from failing.
//
// Fix once https://github.com/WordPress/gutenberg/issues/52692 is closed.
let unlockedApis;

const cache = new WeakMap();
Expand Down

0 comments on commit a1ceee2

Please sign in to comment.