Add upper case keys to the debug key handler#45559
Conversation
|
Hi @wh201906! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
@dmytrorykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
huntie
left a comment
There was a problem hiding this comment.
Hey @wh201906, thanks for opening this! I've suggested a change — think we're happy accepting this if the implementation is simplified.
Generally, we want to be precise about key bindings in CLI apps (with precedents like Vim being case sensitive), as it would allow us more space (although unlikely) to bind future commands. I think it's reasonable to expect developers to be aware of Caps Lock state (at least enough to debug in the moment before opening a GitHub issue 😅). However, I'm happy to break this precedent for the sake of convenience — so long as the codebase doesn't incur extra complexity.
Note that this will deviate us from Expo CLI and existing key handling within the iOS/Android simulators.
| @@ -46,14 +46,17 @@ export default function attachKeyHandlers({ | |||
| const onPress = async (key: string) => { | |||
| switch (key) { | |||
There was a problem hiding this comment.
Can we do this instead?
| switch (key) { | |
| switch (key.toLowerCase()) { |
There was a problem hiding this comment.
Thanks! I have change the code based on your suggestions.
Note that this will deviate us from Expo CLI
Would you suggest me to make a new PR for the same change in the Expo CLI repo?
|
@dmytrorykun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@dmytrorykun merged this pull request in 6390cf6. |
|
This pull request was successfully merged by @wh201906 in 6390cf6 When will my fix make it into a release? | How to file a pick request? |
Summary:
The CLI of Metro bundler only accepts key presses when the Caps Lock is off. This is somehow inconvenient because the developers might think the Metro bundler doesn't response when the Caps Lock is on.
Changelog:
[GENERAL] [ADDED] - Add upper case keys to the debug key handler
Test Plan:
n/a