Skip to content

Prerender the first 300 tag pages#400

Open
shilman wants to merge 3 commits intomainfrom
shilman/tag-pages-ssg-limit
Open

Prerender the first 300 tag pages#400
shilman wants to merge 3 commits intomainfrom
shilman/tag-pages-ssg-limit

Conversation

@shilman
Copy link
Copy Markdown
Member

@shilman shilman commented Mar 27, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 27, 2026 06:36
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 27, 2026

Deploy Preview for storybook-addon-catalog failed. Why did it fail? →

Name Link
🔨 Latest commit 5774b8f
🔍 Latest deploy log https://app.netlify.com/projects/storybook-addon-catalog/deploys/69c639f97b167b4aaa9b8d0e

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 27, 2026

Deploy Preview for storybook-frontpage ready!

Name Link
🔨 Latest commit 5774b8f
🔍 Latest deploy log https://app.netlify.com/projects/storybook-frontpage/deploys/69c62ac70557965e3915d8f5
😎 Deploy Preview https://deploy-preview-400--storybook-frontpage.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@chromatic-com
Copy link
Copy Markdown

chromatic-com bot commented Mar 27, 2026

Important

Testing in progress…

🟢 UI Tests: web/frontpage: 37 tests unchanged
UI Review: web/frontpage: Comparing 29 stories…
Storybook icon Storybook Publish: web/frontpage: 29 stories published

@chromatic-com
Copy link
Copy Markdown

chromatic-com bot commented Mar 27, 2026

Tip

All tests passed and all changes approved!

🟢 UI Tests: web/frontpage: 37 tests unchanged
🟢 UI Review: web/frontpage: 29 stories published -- no changes
Storybook icon Storybook Publish: web/frontpage: 29 stories published

@chromatic-com
Copy link
Copy Markdown

chromatic-com bot commented Mar 27, 2026

Important

Testing in progress…

🟢 UI Tests: web/ui: 11 tests unchanged
UI Review: web/ui: Comparing 11 stories…
Storybook icon Storybook Publish: web/ui: 11 stories published

@chromatic-com
Copy link
Copy Markdown

chromatic-com bot commented Mar 27, 2026

Tip

All tests passed and all changes approved!

🟢 UI Tests: web/ui: 11 tests unchanged
🟢 UI Review: web/ui: 11 stories published -- no changes
Storybook icon Storybook Publish: web/ui: 11 stories published

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the addon-catalog tag details route to pre-generate a larger set of tag pages at build time by expanding the static params list.

Changes:

  • Added a cached tag list loader that combines category tags with a capped subset of non-category tags.
  • Updated generateStaticParams() to use the new cached tag list (instead of only category tags).
  • Minor formatting fix in generateMetadata().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +37 to +41
const getCachedTags = unstable_cache(
async () => [
...(await fetchTagsData({ isCategory: true })),
...(await fetchTagsData()).slice(0, 300),
],
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getCachedTags returns all category tags plus the first 300 non-category tags. That means generateStaticParams() can pre-render more than 300 pages (categories + 300), which seems to conflict with the PR goal of prerendering “the first 300 tag pages”. If the intent is an overall cap, apply the limit after combining (or otherwise clarify/encode the intended cap in code).

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +41
async () => [
...(await fetchTagsData({ isCategory: true })),
...(await fetchTagsData()).slice(0, 300),
],
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In getCachedTags, (await fetchTagsData()).slice(0, 300) still fetches the full non-category tag list and only then truncates it. If the tags list is large, this can unnecessarily increase build time/memory and network usage for prerendering. Consider adding a server-side limit (e.g., query arg/variable) or a dedicated data function that only retrieves the needed N tag names.

Copilot uses AI. Check for mistakes.
@shilman shilman closed this Mar 27, 2026
@shilman shilman reopened this Mar 27, 2026
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.

3 participants