Skip to content
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

Fix an issue in shopify theme dev and shopify app dev that was affecting image loading on local servers #2105

Merged
merged 2 commits into from
Jun 7, 2023

Conversation

karreiro
Copy link
Contributor

@karreiro karreiro commented Jun 6, 2023

WHY are these changes introduced?

Fixes #2094

WHAT is this pull request doing?

This PR modifies the regex for the assets middleware in both shopify theme dev and shopify app dev. This change allows images to load directly from the disk when users access the local server (http://127.0.0.1:9292), rather than pointing to the CDN URLs.

How to test your changes?

  • Run shopify theme dev
  • Add an image called test-image-1.jpg in the /assets directory
  • Add an snippet like <img src="{{ 'test-image-1.jpg' | asset_url }}"> in the sections/announcement-bar.liquid file
  • Open http://127.0.0.1:9292
  • Notice that images load from the local server now

Before

After

Post-release steps

None.

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've made sure that any changes to dev or deploy have been reflected in the internal flowchart.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Thanks for your contribution!

Depending on what you are working on, you may want to request a review from a Shopify team:

  • Themes: @shopify/theme-code-tools
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/cli-foundations

@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2023

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 71.35% 4645/6510
🟡 Branches 68.01% 2130/3132
🟡 Functions 69.33% 1214/1751
🟡 Lines 72.78% 4422/6076

Test suite run success

1087 tests passing in 564 suites.

Report generated by 🧪jest coverage report action from 045dc31

Copy link
Contributor

@mgmanzella mgmanzella left a comment

Choose a reason for hiding this comment

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

thank you @karreiro !!

@merziy
Copy link

merziy commented Jun 7, 2023

Thanks!

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.

[Bug]: JS & CSS assets return 404 when developing locally
3 participants