[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.
/ shopify-reloadr Public archive

Reloads a remote Shopify theme during development 🎯

License

Notifications You must be signed in to change notification settings

uicrooks/shopify-reloadr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shopify Reloadr

This package is now deprecated, consider using Shopify Theme Lab Reloader

Shopify Reloadr is a collection of scripts for reloading a remote Shopify theme during development when working with Shopify Theme Lab.

The server.js script runs an HTTP server, as well as a WebSocket server, locally. The HTTP server listens for requests, sent from the shopify:watch task (which is the default Shopify Them Kit watch task) and communicates via WebSocket connection with the client.js script.

The client.js script (WebSocket client) is injected into the webpack bundle, during development, and connects via localhost:port to the WebSocket server. The script listens to reload messages from the server script.

If the connection between client.js and server.js is lost, client.js tries every couple of seconds to reconnect to the server.

Settings and ports for the script can be adjusted in package.json.

Settings

Option Description
serverPort the localhost port shopify:watch task and server.js use to communicate
websocketPort the localhost port server.js and client.js use to communicate
delay auto-reload needs a slight delay before reloading the remote site, so all newly uploaded files will be loaded. Values between 1600ms and 2000ms seem to work well