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 that was affecting assets/fonts loading on local servers #2110

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

karreiro
Copy link
Contributor

@karreiro karreiro commented Jun 7, 2023

WHY are these changes introduced?

This PR fixes a corner case related to #2094

WHAT is this pull request doing?

When the storefront_vanity_assets_url flag is activated, assets URL get a different shape. So, this PR modifies the regex for the assets and fonts middlewares in the shopify theme dev commands [1]. 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.

[1] This flag doesn't affect theme app extensions.

How to test your changes?

  • Activate the storefront_vanity_assets_url flag
  • Run shopify theme init
  • Open the theme directory
  • Run shopify theme dev
  • Notice that images and fonts 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

This comment has been minimized.

@karreiro karreiro changed the title Fix an issue in shopify theme dev that was affecting asset loading on local servers (2) Fix an issue in shopify theme dev that was affecting asset loading on local servers Jun 7, 2023
@karreiro karreiro requested review from amcaplan and mgmanzella June 7, 2023 10:42
@karreiro karreiro changed the title Fix an issue in shopify theme dev that was affecting asset loading on local servers Fix an issue in shopify theme dev that was affecting assets/fonts loading on local servers Jun 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 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 99fc03f

Copy link
Contributor

@amcaplan amcaplan left a comment

Choose a reason for hiding this comment

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

Works like a charm!

@karreiro karreiro removed the request for review from mgmanzella June 7, 2023 12:14
@karreiro karreiro added this pull request to the merge queue Jun 7, 2023
Merged via the queue into main with commit ea0e18f Jun 7, 2023
@karreiro karreiro deleted the fix-2036-2 branch June 7, 2023 12:15
@shopify-shipit shopify-shipit bot temporarily deployed to production June 7, 2023 14:20 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to experimental-deployments-for-3-48 June 8, 2023 01:12 Inactive
@shopify-shipit shopify-shipit bot temporarily deployed to nightly June 8, 2023 11:32 Inactive
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.

2 participants