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

feat(core): support KeyboardEvent.key for built in keyboard event modifiers, fix #6900 #7121

Merged
merged 6 commits into from
Mar 7, 2018

Conversation

jkzing
Copy link
Member

@jkzing jkzing commented Nov 23, 2017

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:
#6900

@@ -16,6 +16,18 @@ const keyCodes: { [key: string]: number | Array<number> } = {
'delete': [8, 46]
}

const keyNames: { [key: string]: string | Array<string> } = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just move the keyNames and keyCodes to runtime instead of in the compiler? Since it leads sooo much repetition and should reduce the code size.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually in my first version, I did define keyNames in check-keycodes.js. After that I realize this would increase much runtime bundle size, so I got it moved into compiler...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the reason keyCodes stays in compiler is that it simply generate numbers rather strings. Agreed for moving keyNames into runtime.🙂

Copy link
Contributor

@dsonet dsonet Nov 24, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, considering all compiled templates size together, it could reasonable to move them into runtime. BTW, seems it has not that much different to deal with keyCodes and keyNames.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants