yihong0618 / running_page

Make your own running home page
https://running-page.vercel.app
MIT License
3.41k stars 978 forks source link

Reduce svg size & lzay load github.svg and grid.svg #580

Closed vlin closed 6 months ago

vlin commented 6 months ago
  1. fix: remove all unnecessary React imports Declare plugin:react/jsx-runtime in .eslintrc.js, no longer have to import React to write JSX.
  2. perf: reduce SVG file size during build
 Use 'vite-plugin-svgr' to optimize all the SVG files, make them smaller.

    Both github.svg and grid.svg are packed in the index.js
 Before: distassetsyear_2012-cdd7baf2 js After: distassetsyear_2012-e71b5e80 js Here(https://react-svgr.com/playground/) are more info about svgr.

  3. Split out github.svg and grid.svg from index.js into separate packages during the build. Only import them asynchronously when rendering the Total view, in order to reduce resources loaded on the initial page. screen
vercel[bot] commented 6 months ago

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

Name Status Preview Comments Updated (UTC)
running-page ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 21, 2023 4:21am
yihong0618 commented 6 months ago

@frostming did something similar but seems will break some vercel preview

orionna319 commented 6 months ago

Is there anything else you need my help with? I can’t see the error details during Vercel deployment, It should be because I don’t have permission.

vlin commented 6 months ago

@yihong0618 Would you share the Vercel deployment logs? That would help troubleshoot the cause of the failure.

yihong0618 commented 6 months ago

@yihong0618 Would you share the Vercel deployment logs? That would help troubleshoot the cause of the failure.

image

maybe vercel problem, will also check it

orionna319 commented 6 months ago

Cannot install with "frozen-lockfile" on build Maybe pnpm error, can you deleting the old lockfile(pnpm-lock.yaml) and running pnpm install to generate a new one. @vlin

vlin commented 6 months ago

Cannot install with "frozen-lockfile" on build Maybe pnpm error, can you deleting the old lockfile(pnpm-lock.yaml) and running pnpm install to generate a new one. @vlin

@orionna319 thx~

@yihong0618 all checks have passed. let's go ahead.

yihong0618 commented 6 months ago

nice