From 46aaa30b9d002cd6d0933cbb7c4b4e090e9c7c87 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 8 Nov 2019 18:04:03 -0500 Subject: [PATCH 1/2] drop keycode support RFC --- active-rfcs/0000-drop-keycode-support.md | 37 ++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 active-rfcs/0000-drop-keycode-support.md diff --git a/active-rfcs/0000-drop-keycode-support.md b/active-rfcs/0000-drop-keycode-support.md new file mode 100644 index 00000000..6da31366 --- /dev/null +++ b/active-rfcs/0000-drop-keycode-support.md @@ -0,0 +1,37 @@ +- Start Date: 2019-11-08 +- Target Major Version: 3.x +- Reference Issues: N/A +- Implementation PR: N/A + +# Summary + +- Drop support for using numbers (keyCodes) as `v-on` modifiers +- Remove `config.keyCodes` + +# Basic example + +N/A + +# Motivation + +In Vue 2.x, `v-on` already supports using the kebab-case version of any valid `KeyboardEvent.key` as a modifier. For example, to trigger the handler only when `event.key === 'PageDown'`: + +``` html + +``` + +This makes number keyCodes and `config.keyCodes` redundant. In addition, [`KeyboardEvent.keyCode` has been deprecated](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode), so it would make sense for Vue to stop supporting it as well. + +# Drawbacks + +N/A + +# Alternatives + +N/A + +# Adoption strategy + +- A codemod can detect usage of number `keyCode` modifier usage and convert it to `key` equivalents. + +- In compat build, `config.keyCode` can be supported, and the runtime can emit warning when a keyCode alias is matched to allow easy migration. From 91650e27eaf9927fe5e30ad3a1a58849543dc3ea Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 13 Dec 2019 15:26:51 -0500 Subject: [PATCH 2/2] Rename 0000-drop-keycode-support.md to 0014-drop-keycode-support.md --- ...{0000-drop-keycode-support.md => 0014-drop-keycode-support.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename active-rfcs/{0000-drop-keycode-support.md => 0014-drop-keycode-support.md} (100%) diff --git a/active-rfcs/0000-drop-keycode-support.md b/active-rfcs/0014-drop-keycode-support.md similarity index 100% rename from active-rfcs/0000-drop-keycode-support.md rename to active-rfcs/0014-drop-keycode-support.md