-
Notifications
You must be signed in to change notification settings - Fork 154
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 image_url on data attributes #2285
Conversation
c12b87e
to
8ec7dd0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this PR, @montalvomiguelo!
I've tried the reproduction steps from the previous PR, and noticed that removing patch_body
would reintroduce the previous issue:
Here's the steps I've followed:
- Clone the Dawn theme using
git clone git@github.com:Shopify/dawn.git
- Switch to version 1.1.0 with
git reset 2566749e4226818500809892259b7713808319ae --hard
- Import product data from products.csv into your store
- Run
shopify theme dev
- Interact with the Classic Varsity Top and observe the browser console
Therefore, perhaps instead of removing patch_body
, we could adjust the regex to make it more specific to the data-base-url
attribute. This way, we could handle both Shopify/shopify-cli#1466 and #2240. What do you think?
Thanks again for this PR 🚀
Hi @karreiro (: It seems like the CORS issue persisted until Dawn v2.3.0 as reported in Shopify/dawn#548. Requesting the resources from the same origin solved the CORS issue per the work in Shopify/dawn#848. Prolly patching the data attributes is not needed anymore. |
Hey @montalvomiguelo, That's accurate indeed, but partners who have to deal with outdated Dawn themes would face this issue. With that in mind, I wonder if replacing the url only on Thanks again for the awesome PR :) 🚀 |
That approach makes sense. Please let me adjust the regex to replace only Thanks @karreiro (: |
12743e5
to
ce71016
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @montalvomiguelo! 🔥🚀
WHY are these changes introduced?
Fixes #2240
WHAT is this pull request doing?
This PR reverts the
patch_body
method since it's not needed anymore to fix CORS issues. Shopify/shopify-cli#2078. It will prevent replacing Shop Uris with Local Uris in data attributes.Using the current domain addressed CORS issues per Shopify/dawn#848
How to test your changes?
Notice that images load from CDN successfully, like in #2143
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist
dev
ordeploy
have been reflected in the internal flowchart.