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

perf: ⚡ generate static params from registry.json #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lloydrichards
Copy link
Contributor

@lloydrichards lloydrichards commented Jan 24, 2025

Goals/Scope

After getting the routing working and taking a look at the build I realised there are some optimisations that could be done with generating the params using the registry.json. This should turn the routes into SSG instead of Dynamic which will save some CPU time on edge functions and reduce potential costs.

Description

Just added the generateStaticParams to fetch the registry.json and map out all the item names. The result:

Route (app)                              Size     First Load JS
┌ ○ /                                    9.28 kB         114 kB
├ ○ /_not-found                          982 B           106 kB
└ ● /registry/[name]                     135 B           105 kB
    ├ /registry/complex-component
    ├ /registry/example-form
    └ /registry/hello-world
+ First Load JS shared by all            105 kB
  ├ chunks/4bd1b696-1e3aa08efae9c30b.js  53 kB
  ├ chunks/517-44104b656c9b8dc3.js       50.3 kB
  └ other shared chunks (total)          1.84 kB


○  (Static)  prerendered as static content
●  (SSG)     prerendered as static HTML (uses generateStaticParams)

@lloydrichards lloydrichards changed the title perf: ⚡ generate static params from registry.json perf: ⚡ generate static params from registry.json Jan 25, 2025
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