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 shopify theme dev issue to avoid previewing the live theme instead of the development one #3471

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

karreiro
Copy link
Contributor

@karreiro karreiro commented Feb 23, 2024

WHY are these changes introduced?

Fixes #3466

WHAT is this pull request doing?

It seems like the caching policy at SFR has changed, so we're implementing this temporary solution to clean it and mitigate the issue.

How to test your changes?

  • Delete your current development theme with shopify-dev theme delete -t <development_theme_id>
  • Run shopify theme dev
  • Notice that the localhost no longer loads the live theme; and the theme in localhost matches with the preview theme

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.

@karreiro karreiro requested review from shauns, lucyxiang and a team February 23, 2024 10:28
Copy link
Contributor

Thanks for your contribution!

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

  • Themes: @shopify/advanced-edits
  • UI extensions: @shopify/ui-extensions-cli
    • Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
  • Hydrogen: @shopify/hydrogen
  • Other: @shopify/cli-foundations

Copy link
Contributor

github-actions bot commented Feb 23, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
73.67% (+0.05% 🔼)
6604/8964
🟡 Branches
70.37% (+0.05% 🔼)
3202/4550
🟡 Functions
73.1% (+0.05% 🔼)
1745/2387
🟡 Lines
74.68% (+0.05% 🔼)
6228/8340
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / GitDiff.tsx
100% 87.5% 100% 100%

Test suite run success

1579 tests passing in 738 suites.

Report generated by 🧪jest coverage report action from 57b51c3

@karreiro karreiro added this pull request to the merge queue Feb 23, 2024
Merged via the queue into main with commit 8b2561a Feb 23, 2024
@karreiro karreiro deleted the fix-theme-dev-live branch February 23, 2024 14:56
@edmeehan
Copy link

Additional instructions are needed. I followed the instructions and can only confirm that the localhost link works in an incognito window. Does not work on standard window. I also attempted to clear local storage, cache, and cookies in standard window but still the same result.

CLI localhost is serving published theme not local files on "shopify theme dev" cli command.

@architchandra
Copy link

Posting my comment here as well since #3466 has been closed and I fear that no one will look at it.


I'm working on a theme app extension and am facing a lot of issues where any change that I'm making in the code is not reflecting on the development store preview page that I'm adding the app block to (product pages). The changes are showing up only if I reload the product page several minutes after I made the code change. This is making the development effort extremely infuriating (sorry). I'm wondering if my problem is also related to this issue. Any fix or suggestion on this front will be greatly appreciated. Thanks.

What I've tried so far (unsuccessfully):

  • Reloading the dev store product page on which I'm rendering the data using the theme app extension
  • Disabling the cache for this page and reloading (initially assuming this to be a browser caching issue)
  • Deploying the extension again using npm run deploy and then previewing again using npm run dev. A support forum thread suggested that this might work.
  • Upgrading the @shopify/cli package to 3.56.3 after seeing the latest release, but it has sadly not helped.

More info:

  • Shopify CLI v3.56.2 (npm package)
  • MacOS Ventura 13.6.3
  • Node v18.18.2

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]: Shopify theme dev returns published theme instead of development theme
4 participants