Improve slug generation & matching in request utils#52414
Merged
swissspidy merged 6 commits intotrunkfrom Jul 20, 2023
Merged
Conversation
|
Flaky tests detected in d6864a1. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5547167272
|
`replaceAll` is only available since Node 16+, but Gutenberg is still on Node 14 right now.
|
Size Change: 0 B Total Size: 1.43 MB ℹ️ View Unchanged
|
kevin940726
approved these changes
Jul 20, 2023
Member
kevin940726
left a comment
There was a problem hiding this comment.
LGTM as long as it works! 💯
westonruter
added a commit
that referenced
this pull request
Jul 20, 2023
…ding-strategy * origin/trunk: (59 commits) Promisify action creator return type for WP data dispatch (#52530) [RNMobile] Add WP hook for registering non-core blocks (#52791) removes check for active preview device type to enable the fixed toolbar preference (#52770) Enforce checks against redeclaration for functions and classes (#52696) update appearance tools, (#52785) Behaviors: Extend Global Styles API to read/write behaviors config. (#52370) HeaderToolbar - Update inserterMethod meta data (#52735) add options for debugging php unit tests (#52778) Docs: Interactivity API > Getting Started Guide - minor adjustments (#52786) Footnotes: Use static closures when not using '' (#52781) Improve slug generation & matching in request utils (#52414) Open "docs" folder for the Interactivity API package and Getting Started Guide (#52462) Global Styles: Don't use named arguments for 'sprintf' (#52782) E2E utils - Update locator to hide the keyboard on iOS to pick the first element, on iPad two buttons are available and the second one makes the floating keyboard to show up (#52771) Patterns: Reinstate template parts mode spec (#52780) chore(release): publish Update changelog files Patterns: Fix empty general template parts category (#52747) Add id to pattern inserted notice to stop multiple notices stacking (#52746) Site Editor: Fix site link accessibility issues (#52744) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Improve plugin slug generation & matching in request utils.
Fixes #52411
Why?
Using
kebabCaseon the plugin title is not ideal. Making the title lowercase first leads to better results.That, plus the improved error message, helps with DX.
How?
Uses lowercase on the plugin titles first, and improves the error message by guessing the slug that was meant to be used instead (very simple approach, removing all hyphens and then doing a strict comparison).
Still not perfect, but already quite an improvement.
Testing Instructions
Try installing the DynaMo plugin and activating it.
Previously you had to use the slug
dyna-mo, but now it's correctlydynamo.If you try
dyna-monow, you will get an error like this:Testing Instructions for Keyboard
Screenshots or screencast