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

Add missing dependency of @wordpress/patterns on @babel/runtime #54118

Merged
merged 1 commit into from
Sep 2, 2023

Conversation

anomiex
Copy link
Contributor

@anomiex anomiex commented Sep 1, 2023

What?

Add missing dependency of @wordpress/patterns on @babel/runtime

Why?

Build code transformations can introduce dependencies on packages such as @wordpress/element and @babel/runtime. These need to be declared if the package is to function correctly with yarn's p'n'p or pnpm with hoisting disabled.

How?

Adding the missing dependencies. Normally I'd probably have done the @babel/runtime dep as a peer dep, but I see you use a normal dependency everywhere else so I followed along.

Testing Instructions

  1. Follow the reproduction instructions in the linked bug to set up the test and reproduce the bug.
  2. Do yarn add <package>@file:/path/to/gutenberg/packages/<package> or pnpm add <package>@file:/path/to/gutenberg/packages/<package> to point yarn or pnpm at the locally built version of the package.
  3. Repeat the final instruction in the reproduction to check that the bug is fixed.
Build code transformations can introduce dependencies on packages such
as @wordpress/element and @babel/runtime. These need to be declared if
the package is to function correctly with yarn's p'n'p or pnpm with
hoisting disabled.

- @wordpress/patterns depends on @babel/runtime (fixes WordPress#54115)
@anomiex
Copy link
Contributor Author

anomiex commented Sep 1, 2023

Ping @glendaviesnz, @kevin940726, @andrewserong as people responsible for adding this in #53161, and @gziolo since you merged the similar #41486 for me recently.

@gziolo
Copy link
Member

gziolo commented Sep 2, 2023

Adding the missing dependencies. Normally I'd probably have done the @babel/runtime dep as a peer dep, but I see you use a normal dependency everywhere else so I followed along

Yes, we should start using peer dependencies more now that the Gutenberg project switched to Node 16 and npm 8. We probably need to stop using legacy peer deps flag first:

legacy-peer-deps = true

@gziolo gziolo added [Type] Code Quality Issues or PRs that relate to code quality [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Sep 2, 2023
@gziolo gziolo merged commit 3b114f7 into WordPress:trunk Sep 2, 2023
51 checks passed
@github-actions github-actions bot added this to the Gutenberg 16.7 milestone Sep 2, 2023
jamestitus299 added a commit to jamestitus299/gutenberg that referenced this pull request Sep 4, 2023
@anomiex anomiex deleted the fix/missing-deps branch October 9, 2023 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Code Quality Issues or PRs that relate to code quality
2 participants