
Security News
Open VSX Begins Implementing Pre-Publish Security Checks After Repeated Supply Chain Incidents
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.
@weareeight/renew
Advanced tools
TL;DR: A page reloader that hot swaps css, and reloads browser windows for other files while you are developing awesome themes on Shopify.
This project is in Beta and being adjusted while its in use so there may be some breaking changes, but we dont foresee many.
Renew ties up to a notification event emmited by Themekit, so Themekit is as requirement.
There are a numnber of ways to include "renew" in your theme project below are a few:
Renew uses a locally runnign server to act as the go between from a shopify notification that a file has been updated and any number of browsers / tabs. We additionally have a client script that needs to load on the theme to make this communication possible. These two connected with a ThemeKit notification that sends a POST request to the server. Keep these in mind.
Great for giving it a quick whirl with minimal installation.
Add the script to your layout (normally /layouts/theme.liquid) just before the </body> tag.
<script src="https://unpkg.com/@weareeight/renew/dist/client.js" defer="defer"></script>
Locally Installed
theme watch --notify=http://localhost:5000
Node CLI wrapper
shopify-themekit watch --notify=http://localhost:5000
You can start a server as an executable without installing it in your project anything, great to test it out.
Run the command
npx @weareeight/renew --server
This will load the server, leave the terminal open and start your usual themekit watch.
Leave the server running in its terminal, and start up your themekit watch in a seperate terminal. BUILD AWESOME THINGS!
NPM
npm install @weareeight/renew --save-dev
Yarn
yarn add @weareeight/renew --dev
This will allow the cli to be used locally to start the server
Add a script to your package.json scripts list
{
"scripts" : {
"renew:server":"renew-cli --server"
}
}
There is further config available, see advanced usage.
Locally Installed
theme watch --notify=http://localhost:5000
Node CLI wrapper
shopify-themekit watch --notify=http://localhost:5000
Node function
add notify: 'http://localhost:5000' to your flags object where you instantiate your watch.
Add the script to your layout (normally /layouts/theme.liquid) just before the </body> tag.
<script src="https://unpkg.com/@weareeight/renew/dist/client.js" defer="defer"></script>
We do have this as a file and function if you would prefer to load this to assets, ./node_modules/@weareeight/renew/dist/client.js the CLI will have some tools shortly to do this for you.
You will need to start the renew:server and your themekit watch along side each other, you can do these in seperate terminals or make use of a great tool like npm-run-all to run these in parallel in a single terminal.
Start Themekit
your themelit watch command - make sure it includes the notify above
start the renew server
npm run renew:server
Open up your theme on the front end or the customizer and build awesome things, while the page hot swaps or reloads depending on the changes you are making. Check the console on the site or the terminal for feedback of what renew is up to.
The renew client can be included as a module, using one of two methods.
Default, starts the socket client with default values
import {start} from '@weareeight/renew'
// start it up based on your criteria
start()
Configurable
import {renew} from '@weareeight/renew'
// start it up based on your criteria
// reference the Advanced config for the params
renew(5050, 'ws://localhost', 4000)
Both of these options will start the client, one with defaults and one ytou can configre to align with a custom server config.
We assume that you have some understanding of how to configure webpack. We are not going to unpack this in depth, but a common approach would be to include the zero config client or a custom inclusion as an entry into your bundle if it is in dev mode.
const entries = isDev ? ['./src/theme.js', './node_modules/@weareeight/renew/dist/client.js'] : ['./src/thheme.js'];
Where is dev looks at the current environment to detirmine if the bundle includes the client, EG in dev but not in production.
Instructions will be available soon.
Further examples will be available shortly.
The server accepts a few arguments when starting it from the cli:
--server - Start the server with defaults
--serverport={NUMBER} - Default: 5000 specifies the port the server runs on
--socketPort={NUMBER} - Default: 5050 specifies the websocket port
--delay={NUMBER} - Default: 2000 miliseconds as it takes a moment to handle the files shopify side this allows you to stop reloading before the shopify servers are ready.
The client can be configured to connect to a running server by passing the following paremeters to the initialization function.
socketPortNumber - Default: 5050 - number - port number
socketPath - DefaultL ws://localhost - string - url of the server
retry - Default: 4000 - number - in milliseconds to retry to connect tot he server
These are used as params passed to the renew function when using the non instantiated version:
window.eight.renew.initRenew(5050, 'ws://localhost', 4000)
this can be usefule to surface the server connection to a tunnel such as ngrok to reloa multiple devices.
Documentation needed.
Some examples of advanced usage examples to look at ways to integrate live reloading into almost any ThemeKit theme development work flow. These will be added before this goes to v1
We are Eight, and we build products for merchants on shopify. We are commited to empowering merchants, and actively supporting the whole Shopify partner eco system, this project is open source and is the first of many we have planned.
Love using renew ? help us offset the carbon footprint of development, specifically with as large a footprint as commerce and the associated logistics.
Donate a tree https://ecologi.com/weareeightltd
(we are stocked up on coffee! so thought trees were a beter way to support the project.)
While written from the ground up, it would be off sides to not credit the awesome work by the team at ui-crooks we loved what they did in theme-lab and followed some of their thinking as far as concept and integrationm of reloading.
FAQs
Live reloading for theme development on shopify
The npm package @weareeight/renew receives a total of 11 weekly downloads. As such, @weareeight/renew popularity was classified as not popular.
We found that @weareeight/renew demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.

Security News
Lodash 4.17.23 marks a security reset, with maintainers rebuilding governance and infrastructure to support long-term, sustainable maintenance.