Skip to content

Render new Storyblok pages on demand, without a redeploy - #2024

Open
annachayn wants to merge 1 commit into
developfrom
publish-without-redeploy
Open

annachayn wants to merge 1 commit into
developfrom
publish-without-redeploy

Conversation

@annachayn

@annachayn annachayn commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What changes did you make and why did you make them?

Every content route set dynamicParams = false, so a story published after a build returned a 404 until production was redeployed. That covered new resources, courses, sessions, course resources, general pages and policies. The revalidation webhook refreshes existing pages but can't add new ones. Content editors had to ask for a redeploy after every new page, and until then a new resource's library card led to "page not found".

  • Routes: removed dynamicParams = false from the nine Storyblok content routes. Pages that exist at build time are still prerendered (generateStaticParams is unchanged). Any other slug renders on its first visit and is cached with the route's 4-hour revalidate. An address with no story still returns a 404 through the existing notFound() calls.
  • Staging previews: staging reads draft, so new general pages and policies can now be checked there before their first publish. Before, those two routes only built published stories.
  • [slug] guard: isInvalidSlugPageRequest now rejects slugs Storyblok can't produce (/wp-login.php, /favicon.png) before calling the CMS, as well as slugs of stories served by their own route. Without that, /home would render the home story as a general page now that unbuilt slugs render.
  • Rollbar: a missing story is a normal 404 and is no longer logged. Other Storyblok failures are still logged and thrown, as before.
  • Docs: removed the redeploy steps from docs/courses-sessions-and-resources.md and docs/modular-courses-plan.md.

Unchanged: the sitemap still lists only published pages, and the library search route keeps dynamicParams = false, because its locales are fixed.

Until the Storyblok revalidation webhook is set up (see docs/configure-env.md), there's one known edge case. If someone opens a page's address before it's published, that 404 can stay cached for up to 4 hours after publishing.

Did you run tests? Share screenshot of results:

yarn test: 35 suites, 313 tests pass, including a new validateSlugPageRequest.test.ts. Type-check, lint and Prettier are clean.

yarn build passes. To reproduce a story published after deploy, I built locally with one existing video (fear) temporarily left out of generateStaticParams, then ran yarn start:

Request Result
/video/fear (not prebuilt) 200, rendered on demand; second request served from cache
/tr/video/fear 200
/video/what-are-boundaries, /policies/terms-of-service 200
/video/does-not-exist, /courses/not-a-course 404
/home, /wp-login.php 404

With the default worker count, the local build hit Storyblok rate limits on draft content. It passed with experimental.cpus: 1. That's unrelated to this change.

PR CHECKLIST:

  • Answered the questions above.
  • Enabled "Allow edits and access to secrets by maintainers" on this PR (not applicable: branch is in this repo).
  • If applicable, include images in the description.

🤖 Generated with Claude Code

Content routes no longer set dynamicParams = false, so a story published
after a build renders on its first visit and is then cached. Pages that
exist at build time are still prerendered, and staging renders drafts.

The top-level [slug] route rejects addresses that can't be a page slug,
or that belong to a story with its own route, before calling Storyblok.
A missing story is a normal 404 and is no longer logged to Rollbar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
bloom-frontend Ready Ready Preview Nov 4, 2026 9:23am UTC

Request Review

@cypress

cypress Bot commented Nov 4, 2026

Copy link
Copy Markdown

Bloom frontend    Run #2267

Run Properties:  status check passed Passed #2267  •  git commit a540a8c7ce: Render new Storyblok pages on demand, without a redeploy
Project Bloom frontend
Branch Review publish-without-redeploy
Run status status check passed Passed #2267
Run duration 05m 40s
Commit git commit a540a8c7ce: Render new Storyblok pages on demand, without a redeploy
Committer annachayn
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 12
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 136
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@kabir-chayn
kabir-chayn self-requested a review November 4, 2026 14:53

This branch was successfully deployed

1 active deployment
Preview — a540a8c7 Deployed Nov 4, 2026 by vercel[bot]
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.

2 participants