Skip to content

Contentview API v2 #7215

@mhils

Description

@mhils

(no immediate intent to implement - filing this to collect my thoughts)

The current contentview API is limited to prettifying contents, but users are unable to edit the prettified representation. While this is bearable for most views (HTML, JSON, ...), it makes fiddling with binary protocols such as protobufs considerably harder. We want to fix this.

High-Level Considerations

  1. Consider removing syntax highlighting from the contentview API. This adds a ton of complexity to authoring contentviews. Instead, we can maybe just piggyback on syntax highlighting from our web editor.
  2. Some views never will have roundtripping - e.g. our image views.
  3. Things won't always roundtrip. For example, if protobuf deserializes to some generic YAML, we can't serialize back if that YAML is malformed.
  4. We probably still need partial/lazy rendering for some of the most important views to have them performant.
  5. Make it possible to have contentviews in Rust. This gives us access to a wider range of (performant) parsers.
  6. First step needs to be an API proposal on how we need to update base.View / what that new API should look like.

Roundtrip candidates (⭐️ for cases that would be particularly useful):

  • CSS
  • ⭐️ DNS
  • GraphQL
  • ⭐️ gRPC
  • ⭐️ Hex
  • HTTP/3
  • JavaScript
  • JSON
  • ⭐️ mqtt
  • ⭐️ msgpack
  • ⭐️ Multipart forms
  • ⭐️ Protobuf
  • Socketio
  • wbxml
  • XML/HTML

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureNew features / enhancements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions