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

docs: optimize build #20260

Merged
merged 24 commits into from
Aug 13, 2024
Merged

docs: optimize build #20260

merged 24 commits into from
Aug 13, 2024

Conversation

userquin
Copy link
Member

@userquin userquin commented Jul 31, 2024

Description

This PR includes:

  • add type: module to the docs package.json file
  • use moduleResolution: Bundler in tsconfig.json file
  • update @mdi/js and @mdi/svg to latest version 7.4.47
  • updates plugins/icons.ts module to include missing mdiDiscord , mdiFormatTextdirectionLToR and mdiFormatTextdirectionRToL svg icons from v6 version and removes mdiCreationOutline included in 7.4.47
  • include a vite virtual module for mdi js names and aliases from @mdi/svg/meta.json
  • added mdi-js-es to allow tree shaking mdi icons used for mdi icon set (plugins/icons.ts module): now vuetify plugin will include only mdi icons used and not the full barrel
  • update Vite to 5.4.0-beta.1 to allow use new sass modern api and enable css.preprocessorMaxWorkers: this will reduce ~4s starting dev server
  • updates components/docs/IconList.vue sfc:
    • use dynamic import to load @mdi/svg and @mdi/js: this change reduces ~3MB the index.js entry point, creating 2 new js assets that are loaded only on features/icon-fonts page: @mdi/svg moved to vite plugin
    • update logic to filter icons using iterators
    • fix small bug when including spaces and deleting them: the browser hangs
    • add clearable and loading attributes to the autocomplete: using primary color for loading using color from the autocomplete, ping me if you want loading progress with primary color

TODO: Maybe we need to use overrides or pnpm.overrides in docs package.json and dedupe dependencies.

From this:

imagen

to this:

imagen

Markup:

NA

@userquin userquin marked this pull request as ready for review July 31, 2024 21:51
@userquin

This comment was marked as outdated.

@userquin
Copy link
Member Author

userquin commented Jul 31, 2024

Tmr (in another PR) I'll remove @mdi/js from vuetify icon set and create a new icon set using unocss preset icons: unocss-mdi.

This way we can remove @mdi/js from the index assets and all mdi icons will go to css: once done, I'll change components/docs/IconList.vue to load @mdi/js also with dynamic import.

johnleider
johnleider previously approved these changes Aug 1, 2024
@userquin

This comment was marked as outdated.

@userquin

This comment was marked as outdated.

@userquin
Copy link
Member Author

userquin commented Aug 1, 2024

Now it is ready @johnleider @MajesticPotatoe

If you want to play with the Node Profiler:

  • pnpm vite dev --profile --open
  • await page loaded then back to the terminal: press p + enter (stops node profiler) and finally press q + enter
  • then go to speedscope.app and upload generated vite-profile-0.cpuprofile in docs root folder

You can compare results adding and removing css entry in the Vite config file.

@KaelWD

This comment was marked as outdated.

@KaelWD
Copy link
Member

KaelWD commented Aug 4, 2024

Can probably get this down to like 300K gzip with a bit more effort
Screenshot_20240805_013419

Preview deployment: https://vuetify-3-9wna33g7f-vuetifyjs1.vercel.app/
Before: https://www.webpagetest.org/result/240804_AiDcR3_5K9/
After: https://www.webpagetest.org/result/240804_AiDc1W_6WK/

@KaelWD
Copy link
Member

KaelWD commented Aug 4, 2024

unplugin/unplugin-vue-components#788 Will replace the patch

cosmicjs/cosmic-sdk-js#36 gets rid of axios too.

I think all the vuetify/one stuff has to go to one.vuetifyjs.com only, keep the login menu but management and subscribing can just be a separate page.

@userquin

This comment was marked as resolved.

@KaelWD KaelWD force-pushed the userquin/docs-optimize-build branch from c60659e to b068585 Compare August 7, 2024 05:42
@KaelWD KaelWD force-pushed the userquin/docs-optimize-build branch from b039cea to 482d0aa Compare August 7, 2024 14:08
@KaelWD
Copy link
Member

KaelWD commented Aug 7, 2024

New preview, 320K index: https://vuetify-3-deihws1i1-vuetifyjs1.vercel.app/

Now (52):
Screenshot_20240808_015530

Live (34):
Screenshot_20240808_015541

@KaelWD KaelWD merged commit 8962a00 into master Aug 13, 2024
17 of 18 checks passed
@KaelWD KaelWD deleted the userquin/docs-optimize-build branch August 13, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants