svobik7 / next-roots

Next.js utility to generate i18n routes in the new APP directory.
https://next-roots-svobik7.vercel.app/
MIT License
178 stars 12 forks source link

feat(templates): support: passing params to `generateStaticParams` #256

Closed zto-sbenning closed 1 month ago

zto-sbenning commented 1 month ago

Description

In order to support the "Generate params from the top down" pattern of nextjs, we now pass the params received by generateStaticParams to the origin function generateStaticParamsOrigin

fix #242

Question

I'm unsure about the modification required for the test "should create page for [dynamic] route with generate static params and generateMetadata functions" in src/cli/templates/page-tpl.test.ts.

The actual test is targeting both generateMetadata and generateStaticParams. And so, I just changed the expected parameter for generateStaticParams.

Should we consider splitting this test to be more isolated ? Any guidance would be appreciated.

Note: This PR is marked as a draft until I receive feedback on the test modification.

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-roots-wcmb ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2024 7:16am
svobik7 commented 1 month ago

Should we consider splitting this test to be more isolated ? Any guidance would be appreciated.

IMO this time we can keep it as it is. The reason I previously asked for isolation was that you created test called should create layout with generate static params but included even metadata into it. This time the test already says that it expects both static params and metadata to be included. So overall it is more about DX that if test fails and we look in a description/test name it matches what is actually done inside the test.

svobik7 commented 1 month ago

@zto-sbenning LGTM thank you 👍 once you publish this we can merge it.

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 3.10.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: