From 4346e44c72f5c258e23a4d4c77d2c3280d2d2107 Mon Sep 17 00:00:00 2001 From: Micha Date: Mon, 20 Jan 2025 11:30:32 +0100 Subject: [PATCH 1/3] Update CLI command and reference --- resources/tooling/cli/using-watchers.md | 61 +++++++++++++++++++------ 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/resources/tooling/cli/using-watchers.md b/resources/tooling/cli/using-watchers.md index 451c6384e..1d3552794 100644 --- a/resources/tooling/cli/using-watchers.md +++ b/resources/tooling/cli/using-watchers.md @@ -5,14 +5,17 @@ nav: --- -# Hot Module Reloading +# Hot Module Replacement + +## Building JS and CSS + +When developing with Shopware, you will probably notice that changes in JavaScript require commands to build the Administration or +Storefront, depending on your change using the following commands: -## Watchers -When developing with Shopware, you will probably notice that changes in JavaScript require commands to build the Administration or Storefront, depending on your change using the following commands: - + ```bash composer run build:js:admin @@ -20,7 +23,7 @@ composer run build:js:admin - + ```bash ./bin/build-administration.sh @@ -28,7 +31,7 @@ composer run build:js:admin - + ```bash composer run build:js:storefront @@ -36,7 +39,7 @@ composer run build:js:storefront - + ```bash ./bin/build-storefront.sh @@ -45,16 +48,20 @@ composer run build:js:storefront -This building process is always time-consuming. Alternatively, to speed up the process, Shopware's Production template offers composer commands to enable Hot Module Reloading/watchers to automatically reload and preview your changes. +## Watchers + +This building process is always time-consuming. Alternatively, to speed up the process. +Shopware's [Production template](https://github.com/shopware/production) and [Source code](https://github.com/shopware/shopware) offers +commands to enable Hot Module Replacement (HRM) to automatically reload and preview your changes. ::: info This procedure doesn't replace the final build process when you finish developing your feature. ::: -To enable Hot Module Reloading, use the following composer commands: +To enable Hot Module Replacement, use the following composer commands in the Shopware source code: - + ```bash composer run watch:admin @@ -62,18 +69,42 @@ composer run watch:admin - + ```bash composer run watch:storefront ``` + + + + +To enable Hot Module Reloading, use the following shell scripts in the Shopware Production template: + + + + + +```bash +./bin/watch-administration.sh +``` + + + + + + +```bash +./bin/watch-storefront.sh +``` + ### Environment variables -Using environment variables can also affect Shopware and, therefore, its watchers. Like in Unix, prefixing command calls with a variable set will run the command with the respective change. The following example will run the storefront watcher in production mode: +Using environment variables can also affect Shopware and, therefore, its watchers. Like in Unix, prefixing command calls with a variable set +will run the command with the respective change. The following example will run the storefront watcher in production mode: ```bash APP_ENV=prod composer run watch:storefront @@ -81,8 +112,10 @@ APP_ENV=prod composer run watch:storefront #### APP_ENV -When using `APP_ENV=dev`, Shopware runs in development mode and provides features for debugging - for example, the Symfony toolbar in the Storefront, while its counterpart `APP_ENV=prod` enables production mode and therefore disables any such tools. +When using `APP_ENV=dev`, Shopware runs in development mode and provides features for debugging - for example, the Symfony toolbar in the +Storefront, while its counterpart `APP_ENV=prod` enables production mode and therefore disables any such tools. #### IPV4FIRST -Starting with NodeJS v17.0.0, it prefers IPv6 over IPv4. However, in some setups, IPv6 may cause problems when using watchers. In such cases, setting `IPV4FIRST=1` reverts this behavior. +Starting with NodeJS v17.0.0, it prefers IPv6 over IPv4. However, in some setups, IPv6 may cause problems when using watchers. In such +cases, setting `IPV4FIRST=1` reverts this behavior. From fd12a04f3026fd0b7092b0e8db2d7cf196ea6e7d Mon Sep 17 00:00:00 2001 From: Micha Date: Mon, 20 Jan 2025 12:38:17 +0100 Subject: [PATCH 2/3] Fix shortcut --- resources/tooling/cli/using-watchers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/tooling/cli/using-watchers.md b/resources/tooling/cli/using-watchers.md index 1d3552794..2aeaefe81 100644 --- a/resources/tooling/cli/using-watchers.md +++ b/resources/tooling/cli/using-watchers.md @@ -52,7 +52,7 @@ composer run build:js:storefront This building process is always time-consuming. Alternatively, to speed up the process. Shopware's [Production template](https://github.com/shopware/production) and [Source code](https://github.com/shopware/shopware) offers -commands to enable Hot Module Replacement (HRM) to automatically reload and preview your changes. +commands to enable Hot Module Replacement (HMR) to automatically reload and preview your changes. ::: info This procedure doesn't replace the final build process when you finish developing your feature. From 769be06be5b28c5f8e89c1155efbd7e02ff1e0c7 Mon Sep 17 00:00:00 2001 From: Micha Date: Mon, 20 Jan 2025 16:00:03 +0100 Subject: [PATCH 3/3] Fix markdown --- resources/tooling/cli/using-watchers.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/resources/tooling/cli/using-watchers.md b/resources/tooling/cli/using-watchers.md index 2aeaefe81..41c8c273f 100644 --- a/resources/tooling/cli/using-watchers.md +++ b/resources/tooling/cli/using-watchers.md @@ -12,8 +12,6 @@ nav: When developing with Shopware, you will probably notice that changes in JavaScript require commands to build the Administration or Storefront, depending on your change using the following commands: - - @@ -91,7 +89,6 @@ To enable Hot Module Reloading, use the following shell scripts in the Shopware - ```bash