8000 Support for SVGs and images in theme-graph by aswamy · Pull Request #988 · Shopify/theme-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support for SVGs and images in theme-graph #988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aswamy
Copy link
Contributor
@aswamy aswamy commented Jun 18, 2025

What are you adding in this PR?

Fixes #981

  • Added support for SVGs and Images on theme-graph

Tophat

  • Check out branch
  • Press F5
  • Open a theme repo
  • Find a theme file that calls out an SVG or an image file in the assets folder
  • It should appear in the Dependencies panel
image

Before you deploy

  • I included a patch bump changeset

@aswamy aswamy requested a review from a team as a code owner June 18, 2025 20:05
@aswamy aswamy requested a review from charlespwd June 18, 2025 20:05
LiquidFilter: (node, ancestors) => {
if (node.name === 'asset_url') {
if (['asset_url', 'asset_img_url', 'inline_asset_content'].includes(node.name)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the only filters i knew that reference images or svgs that are in assets folder, let me know if i missed anything

@@ -136,13 +159,29 @@ export const enum LiquidModuleKind {
Template = 'template',
}

export const SUPPORTED_ASSET_IMAGE_EXTENSIONS = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'heic'];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im not sure if we support other image assets in the asset folder, but could add more if anyone knows more

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we ever want .ico?

Copy link
Contributor
@EvilGenius13 EvilGenius13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! 🎩 'd the changes and could see dependencies including images.

Copy link
Contributor
@charlespwd charlespwd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Design is sound!

Comment on lines +28 to +33
| JSONSourceCode
| LiquidSourceCode
| JsSourceCode
| CssSourceCode
| ImageSourceCode
| SvgSourceCode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably type alias this union :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

theme graph does check inline_asset_content filter
3 participants
0