Feature request: React4xp - let watch work properly


For the react4xp starter it would be nice to have the watch work more consistently across the different view modes in Content Studio, and based on if we render the component client- or server-side.

I tried out the React4xp starter, and followed the first 7 chapters from the guide: Setting up your project - Enonic Developer Portal .
I ran the deploy and started the server with enonic project deploy --dev.

Then I wanted to try out npm run watch. After a discussion in your Slack I got it to run locally, and Espen Norderud collected issues here https://github.com/enonic/lib-react4xp/issues/344.

There are still some things that do not run as expected (and I was asked by Thomas Sigdestad to create this feature request). Files in the CHUNK_DIRS and ENTRY_DIRS are most of the times not updated in the browser. I found that changing a file in the CHUNK_DIRS and ENTRY_DIRS gives different behavior based on if it is loaded with server-side rendering or not, or if it is in preview or edit mode. I have summarized my findings in a pdf, which was sent in the original question in your Slack, but I can’t seem to find a way to add it here.

In the original discussion in your Slack, I also received a tip to try running β€œContinous building”, so I tried this by running enonic project gradle deploy --continuous . This helps, but not for SCSS files in CHUNK_DIRS and ENTRY_DIRS if we are in edit mode. I have also added these findings in the pdf mentioned above.


Hi Vigdis, we are ramping up efforts related to React4XP, and this is one of the items we will investigate. Thank you for your patience.

1 Like