Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs][Proposal] Enable react-refresh in docs development #5475

Merged
merged 3 commits into from
Dec 16, 2021

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Dec 15, 2021

Summary

Enables react-refresh, which builds on top of hot module replacement, to reload components during development instead of requiring a whole page refresh for some changes.

From testing, this prevents a full page reload when modifying components in src. Utility files, service functions, etc, and documentation in src-docs still trigger a reload. But when it applies, the state retention is very nice:

react-refresh

  • switch to page 3
  • shift Location column to the left
  • update component
  • page & column order is retained

Error overlay

This also enables webpack's error overlay when there are compilation issues:

Screen Shot 2021-12-15 at 1 10 12 PM

### Checklist

@chandlerprall chandlerprall added documentation Issues or PRs that only affect documentation - will not need changelog entries skip-changelog labels Dec 15, 2021
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5475/

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5475/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

This looks great! I think it's worth it for the error overlay alone.

The results of my very unscientific testing show this doesn't add any discernible time to dev server startup or recompilation. Thanks for the comment clean up, as well.

Co-authored-by: Greg Thompson <thompson.glowe@gmail.com>
@chandlerprall chandlerprall enabled auto-merge (squash) December 16, 2021 16:36
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5475/

@chandlerprall chandlerprall merged commit fe9649e into elastic:main Dec 16, 2021
@chandlerprall chandlerprall deleted the docs/hot-reload branch December 16, 2021 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues or PRs that only affect documentation - will not need changelog entries skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants