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

Remove Dependency on Lodash #473

Closed
ellm opened this issue Nov 9, 2023 · 0 comments · Fixed by #490
Closed

Remove Dependency on Lodash #473

ellm opened this issue Nov 9, 2023 · 0 comments · Fixed by #490
Assignees
Labels
bug Something isn't working gutenberg Requires understanding Gutenberg typescript Requires understanding TypeScript

Comments

@ellm
Copy link
Member

ellm commented Nov 9, 2023

User Story

As a developer, I want to remove the dependency on lodash to avoid an issue where lodash needs to be included in dependencies in userland code to avoid a fatal.

Acceptance Criteria

  • Find and replace instances of code in block-editor-tools that depends on lodash. As of the time of writing, this should be limited to the use of cloneDeep in usePostMeta.

Description of the bug

SlotFill fields stopped working after updating to WordPress 6.4.1

Upon typing in text or attempting to make changes to editing text into field nothing happens. I'd expect to be able to add/edit text.

Steps To Reproduce

  1. Ensure the current WordPress version is 6.4.1
  2. Add the hook usePostMetaValue to get a post meta value
  3. Create a slotfill and TextControl to manage that post meta value
  4. Attempt to edit the TextControl field from the SlotFill.

Additional Information

I noticed this JS error in the browser console:
Uncaught TypeError: Cannot read properties of undefined (reading 'cloneDeep')

It appears that Lodash is missing in the window object and the Lodash library is not being loaded. See WordPress/gutenberg#52571

@ellm ellm added the bug Something isn't working label Nov 9, 2023
@kevinfodness kevinfodness changed the title Block Editor Tools - Lodash undefined on WP 6.4.1 Remove Dependency on Lodash Nov 21, 2023
@kevinfodness kevinfodness added gutenberg Requires understanding Gutenberg typescript Requires understanding TypeScript labels Nov 21, 2023
@efuller efuller self-assigned this Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gutenberg Requires understanding Gutenberg typescript Requires understanding TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants