Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Use React.lazy for loading components #158

Merged
merged 2 commits into from Oct 5, 2019

Conversation

antoinechalifour
Copy link
Contributor

Type: Refactor

The following has been addressed in the PR: Use React.Lazy for loading components

  • There is a related issue? Nop
  • Unit or Functional tests are included in the PR None changed

@codecov
Copy link

codecov bot commented Oct 5, 2019

Codecov Report

Merging #158 into master will increase coverage by 0.12%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #158      +/-   ##
==========================================
+ Coverage   83.15%   83.27%   +0.12%     
==========================================
  Files          98       97       -1     
  Lines         944      933      -11     
  Branches      165      148      -17     
==========================================
- Hits          785      777       -8     
- Misses        142      144       +2     
+ Partials       17       12       -5
Impacted Files Coverage Δ
src/router.tsx 82.35% <100%> (ø) ⬆️
src/components/DetailSidebar/styles.ts 100% <0%> (ø) ⬆️
src/components/Header/Header.tsx 89.47% <0%> (ø) ⬆️
src/components/Install/Install.tsx 83.33% <0%> (ø) ⬆️
...mponents/RegistryInfoDialog/RegistryInfoDialog.tsx 66.66% <0%> (ø) ⬆️
src/components/DetailSidebar/DetailSidebar.tsx 89.47% <0%> (+4.47%) ⬆️
src/components/Dist/Dist.tsx 100% <0%> (+11.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f1f8f8a...e4f494e. Read the comment docs.

@juanpicado
Copy link
Member

juanpicado commented Oct 5, 2019

Could you share any analysis that prove the impact of this changes in the bundle size? chunks etc etc ? master vs this PR

@antoinechalifour
Copy link
Contributor Author

I'll try to give you some numbers tomorrow but here's the short version :

  • using React.lazy is the idiomatic way of doing code splitting in react land
  • it removed the asyncComponent file so the bundle should be lighter

@priscilawebdev
Copy link
Contributor

@antoinechalifour Well done! 👏 Maybe you could also remove the file "asynComponent", because it is not being used anymore

@antoinechalifour
Copy link
Contributor Author

I think it's already been removed ! I'll check tomorrow

Copy link
Member

@juanpicado juanpicado left a comment

Choose a reason for hiding this comment

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

@antoinechalifour thanks for bring the router and code splitting to the next level 👏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants