You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2021. It is now read-only.
The Shopify themes team has the problem of maintaining 10+ different free themes all with their own unique codebase. Whenever we need to apply an update to our themes, we need to 10+ times. Even worse, each update needs to be customized to each theme because themes development has changed over the past 4 years that they've all been created.
What if teams could develop and share self-incapsulated components that could be configured and used if a variety of themes. So instead of maintaining 10+ different implementations of a hero slider, we only need to maintain 1 implementation.
<!-- /node_modules/@ShopifyComponents/hello/hello.liquid --><h1>Hello, {{ name }}!</h1><style>h1 {
color: {{ color }}
}
</style>
WebPack could parse {% import %} tags URL, copy the files referenced to the /snippets directory, and change the {% import %} URL to reference the newly created snippet. Eg:
{% import '@ShopifyComponents/hello` %}
would be compiled to
{% import 'hello` %}
So far this is only a partial implementation of something that kind of resembles Web Components. Would love to hear from the community on any ideas how to approach this problem!
The text was updated successfully, but these errors were encountered:
t-kelly
changed the title
Import components for reduced code duplication across projects
Web components for reduced code duplication across projects
Nov 7, 2017
t-kelly
changed the title
Web components for reduced code duplication across projects
Reduce code duplication across projects with Web Components
Nov 7, 2017
Drupal uses Twig, which looks similar to Liquid. When I worked with it, i did things like the code examples you shared, like:
{% include @scope/thing %}
where @scope gets mapped to a specific folder. Maybe theres some concepts from Pattern Lab that could influence or inspire some solutions to Shopify Theming.
The Shopify themes team has the problem of maintaining 10+ different free themes all with their own unique codebase. Whenever we need to apply an update to our themes, we need to 10+ times. Even worse, each update needs to be customized to each theme because themes development has changed over the past 4 years that they've all been created.
What if teams could develop and share self-incapsulated components that could be configured and used if a variety of themes. So instead of maintaining 10+ different implementations of a hero slider, we only need to maintain 1 implementation.
Essentially what we need are Web Components.
Random Idea 1
One idea to get started is to combine
{% import %}
tags and WebPack to take advantage of sharing snippets (components) through NPM:WebPack could parse
{% import %}
tags URL, copy the files referenced to the/snippets
directory, and change the{% import %}
URL to reference the newly created snippet. Eg:would be compiled to
So far this is only a partial implementation of something that kind of resembles Web Components. Would love to hear from the community on any ideas how to approach this problem!
The text was updated successfully, but these errors were encountered: