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

Use Vite instead of CRA #663

Merged
merged 4 commits into from
Jul 9, 2023
Merged

Use Vite instead of CRA #663

merged 4 commits into from
Jul 9, 2023

Conversation

VaiTon
Copy link
Member

@VaiTon VaiTon commented Jul 8, 2023

What

  • Use Vite instead of Create React App for faster dev iteration.

Depends on

@VaiTon VaiTon requested a review from a team as a code owner July 8, 2023 14:19
@@ -46,7 +46,7 @@ const Donate = () => {
{t("settings.text1")}
<br />
<br />
<Typography variant="h6">{t("settings.thank_you")} ❤️</Typography>
Copy link
Member Author

Choose a reason for hiding this comment

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

This was necessary as React was throwing "h6 cannot be nested inside p"

@VaiTon
Copy link
Member Author

VaiTon commented Jul 8, 2023

@alexfauquette we still have very big chunks :)

$ vite build
vite v4.4.2 building for production...
transforming...
✓ 1758 modules transformed.
rendering chunks...
computing gzip size...
dist/index.html                              1.65 kB │ gzip:   0.86 kB
dist/assets/logo-fd5c26e0.png               15.06 kB
dist/assets/home_ecoscore-d89a02cd.png      18.24 kB
dist/assets/home_logos-aa34f71f.png         33.72 kB

dist/assets/home_questions-7538a1ab.png     76.81 kB
(!) Some chunks are larger than 500 kBs after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
dist/assets/web-vitals-3f87554c.js           6.57 kB │ gzip:   2.46 kB
dist/assets/index-b86fd876.js            1,616.25 kB │ gzip: 487.78 kB
✓ built in 9.79s

src/const.js Show resolved Hide resolved
@@ -56,7 +56,7 @@ const OpenFoodFacts = () => {
<Box>
{socialMedia.map((media) => {
return (
<IconButton href={media.link} target="_blank">
<IconButton key={media.link} href={media.link} target="_blank">
Copy link
Member

Choose a reason for hiding this comment

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

Thanks, I spent some time wondering where was missing key 😁

@VaiTon
Copy link
Member Author

VaiTon commented Jul 9, 2023

After merging #656 the chunks are smaller!

vite v4.4.2 building for production...
✓ 1757 modules transformed.
dist/index.html                                        1.65 kB │ gzip:   0.86 kB
dist/assets/logo-fd5c26e0.png                         15.06 kB
dist/assets/home_ecoscore-d89a02cd.png                18.24 kB
dist/assets/home_logos-aa34f71f.png                   33.72 kB
dist/assets/home_questions-7538a1ab.png               76.81 kB
dist/assets/shouldSpreadAdditionalProps-05a02b92.js    0.08 kB │ gzip:   0.10 kB
dist/assets/KeyboardArrowRight-008c556d.js             0.26 kB │ gzip:   0.19 kB
dist/assets/useFormControl-498f4b14.js                 0.26 kB │ gzip:   0.21 kB
dist/assets/Done-cce93eed.js                           0.28 kB │ gzip:   0.23 kB
dist/assets/index-e83a90d6.js                          0.30 kB │ gzip:   0.23 kB
dist/assets/DeleteOutline-1de71940.js                  0.33 kB │ gzip:   0.27 kB
dist/assets/matomoEvents-373cfd0d.js                   0.35 kB │ gzip:   0.26 kB
dist/assets/Edit-32e89188.js                           0.37 kB │ gzip:   0.28 kB
dist/assets/Link-449e5838.js                           0.44 kB │ gzip:   0.32 kB
dist/assets/Visibility-e386fe6f.js                     0.45 kB │ gzip:   0.31 kB
dist/assets/externalApi-37dab2d3.js                    0.48 kB │ gzip:   0.27 kB
dist/assets/Flag-0faf9ff1.js                           0.50 kB │ gzip:   0.31 kB
dist/assets/index-63a89687.js                          0.55 kB │ gzip:   0.36 kB
dist/assets/Card-2e8dca28.js                           0.58 kB │ gzip:   0.39 kB
dist/assets/CardContent-02344682.js                    0.63 kB │ gzip:   0.40 kB
dist/assets/CheckCircleOutline-dfb62411.js             0.81 kB │ gzip:   0.42 kB
dist/assets/useUrlParams-b54fcffe.js                   1.07 kB │ gzip:   0.56 kB
dist/assets/AnnotateLogoModal-e459b4f1.js              1.15 kB │ gzip:   0.60 kB
dist/assets/index-0a410117.js                          1.15 kB │ gzip:   0.65 kB
dist/assets/CardMedia-90595da2.js                      1.25 kB │ gzip:   0.68 kB
dist/assets/TableHead-f03f8dde.js                      1.25 kB │ gzip:   0.57 kB
dist/assets/useFilterSearch-fbb9475b.js                1.33 kB │ gzip:   0.70 kB
dist/assets/CardActionArea-9b737eb3.js                 1.43 kB │ gzip:   0.70 kB
dist/assets/Stack-43936847.js                          1.49 kB │ gzip:   0.83 kB
dist/assets/LabelFilter-2b799130.js                    1.59 kB │ gzip:   0.92 kB
dist/assets/useDispatch-655344e3.js                    1.71 kB │ gzip:   0.81 kB
dist/assets/DialogContent-72c1f09e.js                  1.80 kB │ gzip:   0.78 kB
dist/assets/LogoSearch-c6aca944.js                     1.83 kB │ gzip:   0.99 kB
dist/assets/SwitchBase-229c869f.js                     2.07 kB │ gzip:   1.07 kB
dist/assets/LogoSearchForm-785a276f.js                 2.23 kB │ gzip:   0.89 kB
dist/assets/FormControlLabel-8f59aaf2.js               2.29 kB │ gzip:   1.07 kB
dist/assets/Checkbox-e9d57550.js                       2.44 kB │ gzip:   1.14 kB
dist/assets/LogoUpdate-8bbb7193.js                     2.63 kB │ gzip:   1.20 kB
dist/assets/robotoff-07c13387.js                       2.74 kB │ gzip:   1.33 kB
dist/assets/utils-072e398f.js                          2.78 kB │ gzip:   1.23 kB
dist/assets/TableCell-4dc32cf6.js                      2.81 kB │ gzip:   1.30 kB
dist/assets/index-467e288d.js                          3.08 kB │ gzip:   1.48 kB
dist/assets/Skeleton-2a5032a0.js                       3.12 kB │ gzip:   1.47 kB
dist/assets/LogoGrid-63eaf8e7.js                       3.20 kB │ gzip:   1.57 kB
dist/assets/Divider-23a4717f.js                        3.48 kB │ gzip:   1.28 kB
dist/assets/ProductLogoAnnotations-c7de9bc2.js         3.87 kB │ gzip:   1.77 kB
dist/assets/Switch-17c8746e.js                         4.19 kB │ gzip:   1.57 kB
dist/assets/Dialog-5d0d3fb0.js                         4.32 kB │ gzip:   1.69 kB
dist/assets/LinearProgress-83072271.js                 5.33 kB │ gzip:   1.78 kB
dist/assets/LogoForm-cfaf5b13.js                       5.48 kB │ gzip:   2.02 kB
dist/assets/LogoDeepSearch-05a8513f.js                 5.51 kB │ gzip:   2.44 kB
dist/assets/web-vitals-3f87554c.js                     6.57 kB │ gzip:   2.46 kB
dist/assets/index-2b251016.js                          6.77 kB │ gzip:   2.82 kB
dist/assets/index-a98e41b0.js                          7.00 kB │ gzip:   2.37 kB
dist/assets/Badge-41b60d12.js                          7.03 kB │ gzip:   2.16 kB
dist/assets/index-4fba8031.js                          8.27 kB │ gzip:   2.96 kB
dist/assets/index-e40a15bc.js                          8.60 kB │ gzip:   2.19 kB
dist/assets/Chip-ddd148de.js                           9.22 kB │ gzip:   2.74 kB
dist/assets/LogoAnnotation-ce4dd095.js                 9.80 kB │ gzip:   4.00 kB
dist/assets/DashBoard-6b944735.js                     18.34 kB │ gzip:   6.70 kB
dist/assets/Autocomplete-8f86c8ba.js                  21.60 kB │ gzip:   7.68 kB
dist/assets/index-3fe6a1f1.js                         24.40 kB │ gzip:   7.93 kB
dist/assets/LogoQuestionValidator-5874e018.js         25.15 kB │ gzip:   8.98 kB
dist/assets/store-b5ea668f.js                         31.72 kB │ gzip:  11.76 kB
dist/assets/ZoomableImage-05070f92.js                 33.38 kB │ gzip:  11.13 kB
dist/assets/TextField-f96375ca.js                     40.60 kB │ gzip:  11.80 kB
dist/assets/index-dbf20a18.js                         86.08 kB │ gzip:  31.38 kB
dist/assets/dashboardDefinition-8a25db1a.js           92.42 kB │ gzip:  13.08 kB
dist/assets/index-5a006bcd.js                        268.51 kB │ gzip:  81.34 kB
dist/assets/index-398f29a6.js                        858.92 kB │ gzip: 271.00 kB

(!) Some chunks are larger than 500 kBs after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
✓ built in 6.97s

@VaiTon VaiTon merged commit 9160cc5 into master Jul 9, 2023
@VaiTon VaiTon deleted the vite branch July 9, 2023 13:41
@VaiTon VaiTon mentioned this pull request Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants