Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Adjust settings so fast refresh works in development #1284

Merged
merged 1 commit into from Mar 16, 2021

Conversation

jwalgran
Copy link
Contributor

@jwalgran jwalgran commented Mar 15, 2021

Overview

After upgrading to CRA 4 and craco hot module reloading was not working. We referenced another project that was using fast refresh and copied in settings to match.

We removed the environment variables from the start script in package.json because they duplicate variable set in docker-compose.yml.

Within docker-compose.yml we reduced CHOKIDAR_INTERVAL, set working_dir, and switched to node 12 to match another project using fast refresh.

On other projects we have kept the versions of react and react-dom in sync, so we updated the version on react-dom in package.json.

Connects #1252

Demo

2021-03-15 11 05 21

Testing Instructions

  • Stop any running services
  • Run ./scripts/update and ./scripts/server
  • Browse the site, edit a JSX file, and verify that fast refresh works.

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

Copy link
Contributor

@TaiWilkin TaiWilkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job getting this working! It's running beautifully.

@TaiWilkin TaiWilkin assigned jwalgran and unassigned TaiWilkin Mar 15, 2021
After upgrading to CRA 4 and craco hot module reloading was not working. We
referenced another project that was using fast refresh and copied in settings to
match.

We removed the environment variables from the `start` script in `package.json`
because they duplicate variable set in docker-compose.yml.

Within `docker-compose.yml` we reduced `CHOKIDAR_INTERVAL`, set `working_dir`,
and switched to node 12 to match another project using fast refresh.

On other projects we have kept the versions of react and react-dom in sync, so
we updated the version on `react-dom` in `package.json`.
@jwalgran
Copy link
Contributor Author

Thanks for the review.

@jwalgran jwalgran merged commit a0742b7 into develop Mar 16, 2021
@jwalgran jwalgran deleted the feature/jcw/fast-refresh branch March 16, 2021 15:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants