-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 keycodes package #7577
Add keycodes package #7577
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me but I'd like to tweak the package README if that's okay… mind if I sneak a quick commit in? After that I'll approve.
packages/keycodes/README.md
Outdated
|
||
## Installation | ||
|
||
Install the module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this in a few other packages and it seems so blunt and unhelpful 😉
Can we say "Install with npm
:"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should do this in a separate PR to keep consistency between the packages. and yes feel free to add some docs :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, fair point. I'll do that separately, but I'd like to add usage docs to this one 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #7579, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, looks like we need to change the deprecation version.
utils/deprecated.js
Outdated
// keycodes | ||
const wrapKeycodeFunction = ( source, functionName ) => ( ...args ) => { | ||
originalDeprecated( `wp.utils.keycodes.${ functionName }`, { | ||
version: '3.3', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be 3.4
? This will be out in 3.2, so we should deprecate after two versions.
packages/keycodes/README.md
Outdated
@@ -0,0 +1,13 @@ | |||
# @wordpress/keycodes | |||
|
|||
Keycodes utilities for WordPress. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we say what it's used for, in case someone reading this isn't familiar with what "key codes" means? I have some thoughts… I'll just add them in a commit 😄
Docs added 😄 |
packages/keycodes/README.md
Outdated
} | ||
``` | ||
|
||
## Installation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer if we keep the "installation" section before the "usage". It's fine to discuss these but it's important to keep our packages consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally right, good call. I moved it under "installation"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the change 👍
In our effort to split '@wordpress/utils' to smaller targeted packages, I'm extracting "keycodes" to their own package. This would allow us to move forward with the refactoring of the "components" module as a npm ready package.
Tesing instructions
wp.keycodes
==wp.utils.keycodes
on the consolewp.utils.keycodes
utils.