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

Detect hot-reload issues and fix them #1401

Merged
merged 13 commits into from
Apr 18, 2023
Merged

Detect hot-reload issues and fix them #1401

merged 13 commits into from
Apr 18, 2023

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented Apr 15, 2023

Fixes #1393

https://parceljs.org/recipes/react/#fast-refresh

Export only React components – If a file exports a mix of React components and other types of values, its state will be reset whenever it changes. To preserve state, only export React components and move other exports to a different file if possible.


I'm not sure if this is inherited from React's fast-refresh limitation https://reactnative.dev/docs/fast-refresh#limitations The module you're editing might have other exports in addition to a React component or from https://github.com/parcel-bundler/parcel/blob/4fb6cd9/packages/runtimes/hmr/src/loaders/hmr-runtime.js#L179

@github-actions
Copy link

github-actions bot commented Apr 15, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 41 0 0.16s
✅ JAVASCRIPT eslint 1 0 0 5.0s
✅ JSON eslint-plugin-jsonc 1 0 0 1.06s
✅ JSON jsonlint 1 0 0.22s
✅ JSON npm-package-json-lint yes no 0.69s
✅ JSON prettier 1 0 0 0.61s
✅ JSON v8r 1 0 5.6s
✅ REPOSITORY checkov yes no 23.36s
✅ REPOSITORY git_diff yes no 0.01s
✅ TSX eslint 27 0 0 10.63s
✅ TYPESCRIPT eslint 8 0 0 7.26s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov
Copy link

codecov bot commented Apr 15, 2023

Codecov Report

Merging #1401 (fd663a3) into master (2c43fc7) will decrease coverage by 0.26%.
The diff coverage is 92.04%.

❗ Current head fd663a3 differs from pull request most recent head e91f8f0. Consider uploading reports for the commit e91f8f0 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1401      +/-   ##
==========================================
- Coverage   83.65%   83.39%   -0.26%     
==========================================
  Files         146      154       +8     
  Lines        3988     3999      +11     
  Branches      726      726              
==========================================
- Hits         3336     3335       -1     
- Misses        652      664      +12     
Flag Coverage Δ
cypress 50.92% <72.34%> (+0.07%) ⬆️
jest 78.78% <85.22%> (-0.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/app/pages/FiatOnramp/index.tsx 0.00% <ø> (-48.15%) ⬇️
...ls/eslint-test-noGoogleTranslateCrashingSyntax.tsx 0.00% <ø> (ø)
src/commonRoutes.tsx 20.00% <33.33%> (-1.06%) ⬇️
.../app/pages/AccountPage/validateAccountPageRoute.ts 57.14% <57.14%> (ø)
src/app/components/Modal/ModalContainer.tsx 88.88% <88.88%> (ø)
src/app/components/BuildPreviewBanner/index.tsx 100.00% <100.00%> (ø)
src/app/components/DateFormatter/index.tsx 100.00% <100.00%> (ø)
...app/components/DateFormatter/intlDateTimeFormat.ts 100.00% <100.00%> (ø)
src/app/components/Footer/index.tsx 96.77% <100.00%> (+0.10%) ⬆️
...rc/app/components/MobileFooterNavigation/index.tsx 97.14% <100.00%> (ø)
... and 18 more

... and 1 file with indirect coverage changes

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Apr 18, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: e91f8f0
Status: ✅  Deploy successful!
Preview URL: https://11d66d4a.oasis-wallet.pages.dev
Branch Preview URL: https://lw-fix-hot-reload.oasis-wallet.pages.dev

View logs

@lukaw3d lukaw3d merged commit 5964845 into master Apr 18, 2023
@lukaw3d lukaw3d deleted the lw/fix-hot-reload branch April 18, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix hot-reloading without losing state
2 participants