tibudiyanto / jakarta-vax-availability

jakarta-vax-availability.vercel.app
100 stars 46 forks source link

perf(bundle): reduce 2kb with next dynamic import #77

Closed r17x closed 2 years ago

r17x commented 3 years ago

Hello @tibudiyanto @pveyes @resir014

I'm just try to optimize bundle size by https://github.com/tibudiyanto/jakarta-vax-availability/issues/70 with small changes and just use next/dynamic import.

This is difference (before/after) when we build this project

Before

image

Page                                Size     First Load JS
┌ ● / (ISR: 60 Seconds)             5.2 kB          184 kB
├   /_app                           0 B             115 kB
├ ○ /404                            1.36 kB         116 kB
└ ● /map (ISR: 60 Seconds)          245 kB          423 kB
    └ css/860a9187c04c9cdfa896.css  4.58 kB
+ First Load JS shared by all       115 kB
  ├ chunks/framework.923004.js      42 kB
  ├ chunks/main.362039.js           20.4 kB
  ├ chunks/pages/_app.64e722.js     51.6 kB
  └ chunks/webpack.9fc9ab.js        857 B

See lighthouse report

After

image

Page                                Size     First Load JS
┌ ● / (ISR: 60 Seconds)             3.04 kB         127 kB
├   /_app                           0 B             108 kB
├ ○ /404                            1.36 kB         110 kB
└ ● /map (ISR: 60 Seconds)          303 kB          427 kB
    └ css/860a9187c04c9cdfa896.css  4.58 kB
+ First Load JS shared by all       108 kB
  ├ chunks/framework.d23658.js      42.2 kB
  ├ chunks/main.588261.js           20.3 kB
  ├ chunks/pages/_app.408987.js     44 kB
  └ chunks/webpack.9431a6.js        1.68 kB

See lighthouse report

Thank you

vercel[bot] commented 3 years ago

Someone is attempting to deploy a commit to a Personal Account owned by @tibudiyanto on Vercel.

@tibudiyanto first needs to authorize it.

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tibudiyanto/jakarta-vax-availability/2UGqAg41CpfSbFt4Fae5YLjGfJq3
✅ Preview: https://jakarta-vax-availability-git-fork-ri7nz-fix-cec69b-tibudiyanto.vercel.app

resir014 commented 3 years ago

@ri7nz Merge conflicts, please resolve.

r17x commented 3 years ago

@resir014 Done & resolved conflict.