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

fix(create-pages): layouts missing with more nesting #1077

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

tylersayshi
Copy link
Contributor

Adds tests for layouts with nesting and slugs

fixes #1055

Adds tests for layouts with nesting and slugs

fixes dai-shi#1055
Copy link

vercel bot commented Dec 18, 2024

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

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Dec 18, 2024 4:29am

Copy link

codesandbox-ci bot commented Dec 18, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@tylersayshi tylersayshi marked this pull request as ready for review December 18, 2024 04:19
@tylersayshi tylersayshi marked this pull request as draft December 18, 2024 04:22
Copy link
Owner

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +35 to +40
// /nested/foo is defined as a staticPath of /nested/[id] which matches this layout
await page.goto(`http://localhost:${port}/nested/foo`);
await expect(
page.getByRole('heading', { name: 'Deeply Nested Layout' }),
).toBeVisible();

Copy link
Owner

Choose a reason for hiding this comment

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

That was my bad too, but it's actually not a good idea to rely on examples. This is kind of historical reason, but we now have some standalone spec with fixtures.

Let's revisit it with a different PR later.

Comment on lines -138 to +139
path: PathWithoutSlug<Path>;
path: Path;
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure about this change, but count on you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

without this change there is a type error if we attempt to define a layout for /foo/[id] which I think would be valid.

the fs router equivalent would be pages/foo/[id]/_layout.tsx

@dai-shi dai-shi merged commit fae4d15 into dai-shi:main Dec 18, 2024
26 checks passed
@dai-shi dai-shi mentioned this pull request Dec 18, 2024
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.

Non-root layouts not loaded in v0.21.8
2 participants