Skip to content

Conversation

@alexjoverm
Copy link
Contributor

@alexjoverm alexjoverm commented Oct 23, 2025

After investigating, testing and playing with it it, seems adding the peer dep was all needed.

At the same time, I took the chance to rename the playgrounds and fix a few minor things:

  • next13-app-router -> next-e2e-testing (it was the one used for it, so now it's clearer that it's the one used for testing, and should be changed only when automated tests change, not for manual testing - just as we have it in the Nuxt SDK)
  • next15 -> next-latest (so we don't need to rename it in every major release. Also, upgraded to Next 16)
  • next15-static -> next-latest-static (same)

Closes #360

@alexjoverm alexjoverm self-assigned this Oct 23, 2025
@alexjoverm alexjoverm added the react [Package] `storyblok-react` related issues. label Oct 23, 2025
Copy link
Contributor

@maoberlehner maoberlehner left a comment

Choose a reason for hiding this comment

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

I very much like the new naming for the latest Next version! But not quite sure about the change for the Next 13 playground.

Ideally, I think we should have a light e2e test suite for all playground apps at some point to ensure they keep working.
Additionally, it makes sense to keep old versions around to test stuff in case people on legacy versions report issues.

So maybe we should always keep the latest + n versions around (n depends on the versioning policies of the framework).

After writing this, if we decide we want to keep n versions, maybe we should keep the version name after all? And with each new version, we delete the oldest playground and add a new one?

@alexjoverm
Copy link
Contributor Author

@maoberlehner those are great points! Also @edodusi shared similar feedback. I pretty much agree with it, specially for the test suite would be great to keep n-versions. Personally, I feel we need a distinction between the playgrounds used as part of the test suite, and the ones merely intended to play around and manual testing (or maybe we don't, I'd like to know your thoughts on that).

To clarify, this was intended as small "leave it better than you found it" improvement. I think, as part of the test suite revamp project, we could upgrade the setup, add multi-version testing playgrounds, etc, to all SDKs playgrounds. What do you think?

If so, maybe in the scope of this PR we can:

  • Rename next-e2e-testing to next-13-e2e-testing (actually, it was just renamed, but the playground is untouched. Is still in Next 13)
  • Add another testing playground: next-latest-e2e-testing
  • Keep the others (the ones for manual testing) as they are.

Thoughts?

@maoberlehner
Copy link
Contributor

To clarify, this was intended as small "leave it better than you found it" improvement.

Hehe, always coming after one, such improvements! 😅
I think playgrounds can serve a double role here, and having them part of the test suite would ensure that the playgrounds remain in a working condition. Otherwise, they might end up in a state where you need to debug them before you can start working on what you intended to work on. But let's talk about this separately!

LGTM

@cursor
Copy link

cursor bot commented Oct 23, 2025

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@cursor
Copy link

cursor bot commented Oct 23, 2025

Bug: Client Component Wraps Document Tags

The StoryblokProvider is a Client Component incorrectly wrapping the <html> and <body> elements in the root layout. Next.js requires these document-level tags to be rendered by a Server Component, which can lead to a runtime error or hydration mismatches.

Additional Locations (1)

Fix in Cursor Fix in Web

@alexjoverm
Copy link
Contributor Author

@maoberlehner I see your point, and that makes sense. If we intend them to be doubled-role, then let's remove the testing part 😄 .

I went ahead and renamed them to -13 and -latest. I also added the latest to the test suite, so now we have both 13 and 16 in the test suite. Let me know what you think

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 23, 2025

Open in StackBlitz

@storyblok/astro

npm i https://pkg.pr.new/@storyblok/astro@361

storyblok

npm i https://pkg.pr.new/storyblok@361

@storyblok/eslint-config

npm i https://pkg.pr.new/@storyblok/eslint-config@361

@storyblok/js

npm i https://pkg.pr.new/@storyblok/js@361

storyblok-js-client

npm i https://pkg.pr.new/storyblok-js-client@361

@storyblok/management-api-client

npm i https://pkg.pr.new/@storyblok/management-api-client@361

@storyblok/nuxt

npm i https://pkg.pr.new/@storyblok/nuxt@361

@storyblok/react

npm i https://pkg.pr.new/@storyblok/react@361

@storyblok/region-helper

npm i https://pkg.pr.new/@storyblok/region-helper@361

@storyblok/richtext

npm i https://pkg.pr.new/@storyblok/richtext@361

@storyblok/svelte

npm i https://pkg.pr.new/@storyblok/svelte@361

@storyblok/vue

npm i https://pkg.pr.new/@storyblok/vue@361

commit: b9f0ec7

@cursor
Copy link

cursor bot commented Oct 23, 2025

Bug: StoryblokProvider Wraps Root Elements Incorrectly

The StoryblokProvider client component wraps the <html> and <body> elements in the root layout. In Next.js App Router, these root elements must be rendered directly by a server component, not within a client component boundary. This violates the architecture and can cause runtime errors or hydration mismatches.

Fix in Cursor Fix in Web

@@ -1,9 +1,6 @@
import { storyblokEditable } from '@storyblok/react/rsc';
import { headers } from 'next/headers';
Copy link
Contributor Author

@alexjoverm alexjoverm Oct 23, 2025

Choose a reason for hiding this comment

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

@maoberlehner note for the review:

I'm unsure about what was the intention of this here. It made the playground break (both Next 15 and 16) as soon as you wanted to use the bridge for live editing, as for that you need the StoryblokProvider pattern, and that makes the component a client component.

I also realized that the playground didn't include StoryblokProvider, and bridge wasn't enabled. I updated to include that, according to how it's documented https://www.storyblok.com/docs/guides/nextjs

@storyblok storyblok deleted a comment from cursor bot Oct 23, 2025
Copy link
Contributor

@maoberlehner maoberlehner left a comment

Choose a reason for hiding this comment

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

LGTM

@alexjoverm alexjoverm merged commit 4b36ac9 into main Oct 23, 2025
5 checks passed
@alexjoverm alexjoverm deleted the fix/wdx-187-update-peerdep-next16 branch October 23, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

react [Package] `storyblok-react` related issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 [Bug]: Next.js v16 peer dependency error

2 participants