Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

feat: JSON-like objects for message content #8

@5GameMaker

Description

@5GameMaker

Area

Protolok

Problem

As can be seen with Discord, whenever a new formatting feature gets added (or removed, see replies), new formatting rules are getting applied on old messages, including where such formatting was not intended. In addition, sometimes people want to use some of the special characters without them being transformed into a style or use special symbols within the style, which can get tricky to get working.

Suggested solution

Replacing plaintext markdown with a JSON-like structure allows message formatting to persist throughout all updates of the app unchanged as well as allow us to add new features without updating protocol version (not that message formatting is something you'd be changing often anyway). Users do not like updating their apps and often keep old version for as long as they can, and the JSON-like structure (if done properly) is perfectly backwards-compatible as unsupported fields can be safely ignored, resulting in missing formatting at best.

Alternatives

Binary format[TM]
What even is a binary format, anyway?

  • Binary JSON
    This is literally the same thing, just expressed a bit differently.
  • Not quite JSON, but a similar thing
    If there's a more efficient format than JSON, go ahead. I'm talking about a structure, not format.
  • postcard-like binary format
    Problem with postcard and similar things is that they are neither forwards- nor backwards- compatible, thus we'd need to upgrade protocol version every time we add a message formatting feature and keep support for every single app version just to keep formatting working. Such trivial thing as adding a bit more formatting options should not require new protocol versions.

Additional information

No response

Checks

  • I have checked for existing issues about this, and did not
    find any.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions