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

Fix: add missing form builder registrar dependencies for WP 6.4 compatibility #7028

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

jonwaldstein
Copy link
Contributor

@jonwaldstein jonwaldstein commented Oct 12, 2023

Description

In WP 6.4, some blocks were breaking. This was due to a missing lodash function that should have been loaded by WordPress deps. It turns out we were not defining the dependencies for the form builder registrar script. This PR adds the deps during enqueue.

As a side note, Gutenberg has been moving away from lodash in their packages.

Related:

Affects

WP 6.4 compatability

Visuals

N/A

Testing Instructions

Make sure block are working as expected on latest version of WP and 6.4

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@JasonTheAdams
Copy link
Contributor

JasonTheAdams commented Oct 12, 2023

Thanks! @jonwaldstein! Are we using Lodash anywhere else?

@jonwaldstein
Copy link
Contributor Author

Thanks! @jonwaldstein! Are we using Lodash anywhere else?

Yes we are, for debouncing and some other utility things. It's not a problem that we're using it as it's still available as a WP dependency.

@JasonTheAdams
Copy link
Contributor

it's still available as a WP dependency.

But... then why isn't noop working? I'm confused.

@jonwaldstein
Copy link
Contributor Author

@JasonTheAdams

See PR description

It turns out we were not defining the dependencies for the form builder registrar script.

lodash was not being defined as a dependency for the form builder registrars script (only the form builder app script).

Screenshot 2023-10-12 at 1 38 19 PM

@JasonTheAdams
Copy link
Contributor

Then why are we defining the noop function ourselves instead of using the import?

@jonwaldstein
Copy link
Contributor Author

Then why are we defining the noop function ourselves instead of using the import?

That's what I initially did and then the dependency part. I decided to leave it though because all the import does is return an empty function and I don't want to rely on lodash to supply that.

@JasonTheAdams
Copy link
Contributor

@jonwaldstein I get your point, but I'd prefer to continue using the documented, shared function, as simple as it is. So either we should have our own, shared noop function that's documented (why would someone even use this!?) or use Lodash. To reduce the scope of this PR, I'm inclined to use the Lodash function.

@jonwaldstein
Copy link
Contributor Author

@JasonTheAdams when lodash removes noop from their library because they realize its stupid, i'm going to hold you to this f2a9177

@JasonTheAdams JasonTheAdams changed the title Fix: add missing form builder registrar dependencies Fix: add missing form builder registrar dependencies for WP 6.4 compatibility Oct 12, 2023
Copy link
Contributor

@JasonTheAdams JasonTheAdams left a comment

Choose a reason for hiding this comment

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

Deal! 😁

Copy link
Member

@rickalday rickalday left a comment

Choose a reason for hiding this comment

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

Passed manual QA tests.

@JasonTheAdams JasonTheAdams merged commit 3767ab4 into release/3.0.0 Oct 13, 2023
20 checks passed
@JasonTheAdams JasonTheAdams deleted the fix/form-builder-registrars-deps branch October 13, 2023 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants