hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

[RTE Phase 1] Rich text editor updates in Metafield

Open TirmanSidhu opened this issue 3 years ago • 4 comments

Epic: #374898

Renders react components in hydrogen when passed to the Metafield component. This will require recursively traversing the AST, and performantly rendering React components according to the AST.

How does the serializer support current and new plugins?

From the first take, we would have to support updating the serializer for every new plugin.

Link to demo: https://screenshot.click/01-13-f2vi9-ho4dn.mp4

TirmanSidhu avatar Aug 24 '22 17:08 TirmanSidhu

Having discussions around AST and the GraphQL API.

  • Sanity call as an action item with Kusum.
  • Slack coordination as an action item.

joe-szczepaniak avatar Sep 27 '22 20:09 joe-szczepaniak

Exciting to see rich text support getting worked on! Just wanted to call out that we've had really great experiences with the Contentful rich text schema. Specifically, one of the most useful features is the ability to inject either inline or block entity references. That has enabled us to e.g. personalize marketing copy using a customer's name or render an interactive React component within the copy.

I have a lot of first-hand experience working with Contentful rich text, happy to provide more context if that helps!

davidhousedev avatar Sep 30 '22 09:09 davidhousedev

hey @TirmanSidhu @joe-szczepaniak - Can you please provide more context on this? Are there any specific requirements you need from the Hydrogen Metafield component?

elisenyang avatar Oct 05 '22 16:10 elisenyang

Hi @elisenyang, we are just sorting out the AST structure we plan to use for storing the metafield value, but also considering return serialized HTML to consumers for the initial release, since this might get us more adoption from developers. I'll reach out as soon as we are settled on something!

TirmanSidhu avatar Oct 06 '22 14:10 TirmanSidhu