Skip to content

API V2: Bolder Experiments - #153

Merged
lorennorman merged 27 commits into
api-v2from
ap-v2-experiment-2
Nov 14, 2025
Merged

lorennorman merged 27 commits into
api-v2from
ap-v2-experiment-2

Conversation

@lorennorman

Copy link
Copy Markdown
Member
  • remove packge name prefixes from messages and enums
  • truncate enum field prefixes
  • crush toplevel names to just ws

@lorennorman
lorennorman changed the base branch from master to api-v2-experiment November 5, 2025 23:09
@lorennorman

Copy link
Copy Markdown
Member Author

@brentru I'm writing notes for you on each of 3 API V2 PRs. This is my wild experiment to see how much "noise" we can reasonably remove from the .proto files and the wrappers we use.

This PR branches from #152, and only makes naming/nesting changes (ie no algorithm changes.) I think you should get that one working and make sure you're happy with it before embarking on this one.

Message and Enum names

  • remove PackageName* prefix
    • e.g. DigitalIOAdd becomes Add

Message field names

  • remove package_name_* prefix
    • e.g. digitalio_add becomes add

Enum field names:

  • abbreviate the ENUM_NAME_* prefix:
    • e.g. DIGITAL_IO_SAMPLE_MODE_TIMER becomes SM_TIMER
    • disable protolint rule against this
    • note: Petteri does this on nanopb

Root package name

  • crush root package: wippersnapper becomes ws

The diff on this one is pretty bloody, but I love the way the final version of some of the files look:

I really like how tight and readable these are, I think it'll aid reasoning about them, troubleshooting, and extending. But the wrapper side matters just as much, you'll have to see if this works in your codebase. (I confirmed that I like working with the JS wrappers.)

TODOs for you:

  • comment on any of the above
  • just read the PR and see if you like it
  • try it in arduino
    • maybe try converting and building 1 file at a time
    • how does the code feel?
    • what's the lift like?
    • if it sucks, say so!

@brentru brentru mentioned this pull request Nov 14, 2025
@lorennorman
lorennorman changed the base branch from api-v2-experiment to api-v2 November 14, 2025 21:44
@lorennorman
lorennorman merged commit d7400ec into api-v2 Nov 14, 2025
5 checks passed
@lorennorman
lorennorman deleted the ap-v2-experiment-2 branch November 14, 2025 21:45
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.

2 participants