Skip to content

Optional pretty-printing #640

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

Open
wismill opened this issue Feb 3, 2025 · 0 comments
Open

Optional pretty-printing #640

wismill opened this issue Feb 3, 2025 · 0 comments
Labels
performance question Indicates that an issue, pull request, or discussion needs more information tools: compile-keymap tools: dump

Comments

@wismill
Copy link
Member

wismill commented Feb 3, 2025

Currently we always pretty-print the keymap when serializing it, but it means more work to generate (computing paddings, human-friendly mask, etc.) and then more work to parse in the client.

We could make this optional:

  • Use a minified1 keymap for serialization by default in the API, with optional pretty-print using a flag.
  • Use a pretty-printed keymap for all tools by default and a tool flag to turn it off.

The same could apply to Compose files.


Not related to pretty-printing, but we could also consider to (optionally) drop some bits that are not used in the keymap, e.g. key types and interprets. Indeed, they would not impact the behavior of the resulting keymap in the client, but could cut a bit the serializing/parsing time. We should probably keep all the keycodes though, even if not mapped.

Footnotes

  1. Keep the newlines, we are no monsters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance question Indicates that an issue, pull request, or discussion needs more information tools: compile-keymap tools: dump
Projects
None yet
Development

No branches or pull requests

1 participant