8000 Could block be standard and interoperable web components? · Issue #2 · githubnext/githubnext · GitHub
[go: up one dir, main page]

Skip to content
Could block be standard and interoperable web components? #2
Open
@justinfagnani

Description

@justinfagnani

I see from the blocks-template repo that blocks are React components. This means that custom blocks builders have to use React, and possibly a specific version of React.

If blocks were web components there would be a few advantages:

  1. They could bring their own renderer, be it React, Vue, Lit, etc.
  2. They could bring a specific version of their renderer and not have to use the host environment's version.
  3. They would be runtime encapsulated against other blocks styles
  4. Many existing components, regardless of whether they were built with React or something else, could potentially used as blocks.
  5. They would work in standard Markdown files, which already supports HTML, and therefore custom elements.

This seems similar to the discussion (and name!) to the Blocks Protocol, which has oriented a bit more around custom elements as a way for blocks to bring their own rendering library: https://blockprotocol.org/docs/developing-blocks#choosing-your-approach.

Web components can take complex objects as properties, so they could receive the same BlockProps as the React components.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0