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

This is a crude POC to test performance improvements until yarn build works #313

Closed
wants to merge 13 commits into from
Closed

This is a crude POC to test performance improvements until yarn build works #313

wants to merge 13 commits into from

Conversation

apz-gh
Copy link
Contributor

@apz-gh apz-gh commented Dec 13, 2023

What does this PR do?

  • Implements lazy loading for components not required on first load

Bundle Analysis (all sizes are for gzipped js files)


This preview dep. doesn't include posthog as it was disabled. But I consider that it also contributes a similarly large JS bundle which is imported on first load.


Web Vitals:

19-12-2023 18:51

-(https://earn.superteam.fun): https://pagespeed.web.dev/analysis/https-earn-superteam-fun/l03rm29hda?form_factor=mobile

CleanShot 2023-12-19 at 18 58 16@2x

CleanShot 2023-12-19 at 19 00 28@2x

Search Console Report:

(Updated on: 18-12-2023)

Mobile:

Severity Issue Validation URLs
Need improvement CLS issue: more than 0.1 (mobile) Not Started 19
Need improvement LCP issue: longer than 2.5s (mobile) Not Started 19

Desktop:

Severity Issue Validation URLs
Need improvement CLS issue: more than 0.1 (desktop) Not Started 19

Copy link

vercel bot commented Dec 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
earn ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2023 0:26am

@apz-gh
Copy link
Contributor Author

apz-gh commented Dec 13, 2023

CleanShot 2023-12-14 at 04 51 23@2x

  • Quite a good spot this landed at.
    • Caveats: not consistent though. pagespeed shows variations. lighthouse shows variations. need to investigate.

How — Get JS out of the render path:

  • Moved GTM (google tag manager) to a worker
  • Replaced axios with fetch (nextjs fetch, which adds a few things like caching on top of native fetch)
  • Replaced router push state with Link (router import added a lot of js weight)
  • Removed nprogress (and the router import that it was using) — there might be a css alternative or something lightweight this can be replaced with.
  • PostHog was disabled — it was being instantiated in the critical rendering path (this is a ::todo::, bringing posthog back with next/script worker and dynamic imports would probably help it stay out of the rendering path)
  • Does optmizePackageImports work with pages router — i have no idea. yarn build + webpack bundle analyzer might help.

@apz-gh apz-gh changed the title *DO NOT MERGE* — Poor man's build process. Trying to get preview URL to test bundle coverage. *DO NOT MERGE* — This is a test to see if my assumptions about what is causing the large execution / render block without webpack analyzer to aid Dec 13, 2023
@apz-gh apz-gh changed the title *DO NOT MERGE* — This is a test to see if my assumptions about what is causing the large execution / render block without webpack analyzer to aid *DO NOT MERGE* — This is to test my assumptions about what is causing the large execution / render block without webpack bundle analyzer to aid Dec 13, 2023
@apz-gh apz-gh changed the title *DO NOT MERGE* — This is to test my assumptions about what is causing the large execution / render block without webpack bundle analyzer to aid *do not merge* — This is a POC to test performance improvements until `yarn build Dec 14, 2023
@apz-gh apz-gh changed the title *do not merge* — This is a POC to test performance improvements until `yarn build *do not merge* — This is a crude POC to test performance improvements until yarn build works Dec 14, 2023
@apz-gh apz-gh marked this pull request as draft December 20, 2023 09:22
@apz-gh apz-gh changed the title *do not merge* — This is a crude POC to test performance improvements until yarn build works This is a crude POC to test performance improvements until yarn build works Dec 20, 2023
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.

1 participant