I'm on the dev team that built this. Happy to answer any questions!
We essentially use web components as a templating language to dynamically generate a GraphQL query to Shopify. Then render the data as text nodes inside the web components. This is powerful because the components don't include shadow roots. So you can come with your own HTML and CSS.
Most web component libraries are opinionated about design, and give you many CSS custom properties or CSS parts to customize. We tried really hard to invert that, and instead give you the design control. Most of our web components just produce a text node, with no shadow root!
There's a few exceptions, like the cart for example, where it's easier to just have an out of the box component that does it all for you `<shopify-cart>`. Though...you can actually build the entire cart component with the lower level primitives!
This looks great, glad to see this project and congrats on the launch. Having said that, how does this project fit in with the Shopify Hydrogen effort using Remix / React? There seems to be an ever growing number of ways to build a shopify storefront these days (ie, native templates, remix/hydrogen, web components, Shopify JS Buy SDK, etc.) so it's not clear what technology to "bet on" from a developer perspective.
Separately, nice touch adding the refined LLM instructions, this looks like a nice pattern for other UI frameworks to follow.
I'm a big fan of web components, and this seems like a very cool project. I'm curious about how it fits into the broader frontend ethos at Shopify. I remember the Shopify team being one of the earliest proponents of React Server Components, for example. Is the team still working in that direction as well, or does this represent a new direction org-wide?
I'm also on the hydrogen team. Today we also shipped support for Hydrogen on React Router 7, which has experimental support for RSC: https://remix.run/blog/rsc-preview
I'm excited to see more Web Component libraries in the wild eschewing the Shadow DOM. I don't think enough developers have yet caught the message that the Shadow DOM is optional and Web Components are simpler and especially simpler to style if they skip it.
How are these order annotated in Shopify admin? Thinking specifically about various types of partnerships? Could a flow automation be set up to: pay commission (for the influencer model), pay inverse wholesale pricing (for dropshippers), etc.
This seems super powerful. Would you recommend that an app developer who is creating App Blocks for PLPs (Search, Collections, etc.) use these new Web Components instead of building everything themselves?
This is primarily for embedding in 3p sites, Shopify already has liquid for hosted storefronts. As for search and collections, we don't quite yet have support for search and filters. Though we do support pagination.
This is great, I think this is perfect use for web components and gives your customers trying to build a fully custom storefront a much better experience. I built something similar for stripe based sites a couple years ago but didn't get too much attention: https://elements.launchscout.com/
This is a master move though - it's kinda like video(youtube) embeds in your site. If every site could sell and have an infinite curated catalog from shopify merchants - shopify becomes both the discovery, distribution and the shopping network?
> If every site could sell and have an infinite curated catalog from shopify merchants
are you implying a scenario where anyone could create a "storefront of storefronts" using products from various shopify accounts (owned or not owned by that person)? Would be an interesting affiliate opportunity
Web components are not a panacea and they will not eat everything. This sort of use case, making component libraries to drop into unknown territory, is what they're good at. Frameworks will still have their own component systems because it allows them to deliver better developer experience and achieve higher rendering performance.
These are awesome! Perfect use case for web component, incredible how much less code and work is required compared to hydrogen with React (no disrespect intended). Very clever.
Is it going to be open sourced at all? I took a brief look at shopify's GitHub and didn't see it there.
We essentially use web components as a templating language to dynamically generate a GraphQL query to Shopify. Then render the data as text nodes inside the web components. This is powerful because the components don't include shadow roots. So you can come with your own HTML and CSS.
Most web component libraries are opinionated about design, and give you many CSS custom properties or CSS parts to customize. We tried really hard to invert that, and instead give you the design control. Most of our web components just produce a text node, with no shadow root!
There's a few exceptions, like the cart for example, where it's easier to just have an out of the box component that does it all for you `<shopify-cart>`. Though...you can actually build the entire cart component with the lower level primitives!
Separately, nice touch adding the refined LLM instructions, this looks like a nice pattern for other UI frameworks to follow.
Will build a quick poc integration. How can I contact you with feedback?
I really appreciate that they built this. The `shopify-context` is especially useful. Makes rendering all of the various resources infinitely easier.
are you implying a scenario where anyone could create a "storefront of storefronts" using products from various shopify accounts (owned or not owned by that person)? Would be an interesting affiliate opportunity
Shopify for the longest time had a “hardline” with only supporting React directly, if I recall correctly
Is it going to be open sourced at all? I took a brief look at shopify's GitHub and didn't see it there.
The playground is very well done btw, worth checking out IMO: https://webcomponents.shopify.dev/playground?view=editor
https://webcomponents.shopify.dev/llms.txt