Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h

### Fixed
* [#2735](https://github.com/Shopify/shopify-cli/pull/2735): Remove theme directory confirmation during tests and make confirmation dialogue respect `SHOPIFY_CLI_TTY` (from cli#1369)
* [#2737](https://github.com/Shopify/shopify-cli/pull/2737): Do not inject hot-reload code into web-pixels-manager sandbox (from cli#1568)

### Added
* [#2735](https://github.com/Shopify/shopify-cli/pull/2735): Pass development theme from CLI 3’s to CLI 2’s local storage (from cli#1410)
Expand Down
2 changes: 1 addition & 1 deletion lib/shopify_cli/theme/dev_server/hot_reload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def request_is_html?(headers)
end

def leads_to_injectable_body?(path)
path !~ /web-pixels-manager.+sandbox/
path !~ /.+\/sandbox/
end

def inject_hot_reload_javascript(body)
Expand Down
12 changes: 12 additions & 0 deletions test/shopify-cli/theme/dev_server/hot_reload_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ def test_calls_reload_script_injector
assert_equal(correct_output, request.get("/").body)
end

def test_does_not_call_reload_script_injector_for_web_pixels_manager_sandbox
correct_output = "<html></html>"
app = lambda do |_env|
[200, { "content-type" => "text/html" }, [correct_output]]
end
stack = HotReload.new(@ctx, app, watcher: @watcher, mode: @mode)
request = Rack::MockRequest.new(stack)

assert_equal(correct_output, request.get("/web-pixels-manager@0.0.219/sandbox/").body)
assert_equal(correct_output, request.get("/wpm@0.0.233@6b2037/sandbox/").body)
end

private

def app
Expand Down