-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
refactor: fs-router to use new_createPages & fix staticPaths #1003
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
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. |
@dai-shi the e2e test is failing because it seems like the 401 error is no longer caught correctly. Is this meant as a responsibility of Or do I need to try/catch the |
I'm not sure what broke it. Can you look into it? It's probably my oversight somewhere. |
8d2ed27
to
8232409
Compare
@dai-shi for the error boundary issue here... this screenshot shows in order:
The test fails because the error is being thrown from here: https://github.com/dai-shi/waku/blob/main/packages/waku/src/minimal/client.ts#L208 The Root is a parent of the With all of this, I am not sure how we should adjust: |
Do you mean |
|
I think the test should pass without modifying. This feels like a bug in new_defineRouter or NewRouter. 🤔 |
oh, yea that makes sense to me. I think I just misunderstood something you said on discord then. I follow this though now, thanks. Are you ok with not passing the |
This is technically a breaking change. Can you check README and all examples and see if we describe/use the current capability? |
Even if we are okay with the breaking change, we should change it in a different PR in advance. It means the new_createPages lies its types. |
I think dynamic layout should receive |
I can add the |
I think static layout works too from testing. Would you double check though? |
Yeah.
No, it shouldn't work. We need to use different slotId for different path. Let me try an example. |
Try this: diff --git a/examples/21_create-pages/src/components/HomeLayout.tsx b/examples/21_create-pages/src/components/HomeLayout.tsx
index 55e77435..d63ea21a 100644
--- a/examples/21_create-pages/src/components/HomeLayout.tsx
+++ b/examples/21_create-pages/src/components/HomeLayout.tsx
@@ -16,8 +16,9 @@ const Pending = ({ isPending }: { isPending: boolean }) => (
</span>
);
-const HomeLayout = ({ children }: { children: ReactNode }) => (
+const HomeLayout = ({ path, children }: { path: string, children: ReactNode }) => (
<div>
+ <h1>Path: {path}</h1>
<ul>
<li>
<Link Aaaand, I found there's a bug in the current |
Or, change the spec as it's not working correctly anyways. |
what is the bug? also I see what you mean with it not working for static layouts. |
converted to draft while we discuss what to do with Layout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Huge thanks to your effort.
Changes:
Promise.all