The game-changing RSC framework #9
grahammendick
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
|
I'm not familiar with scene-based UI architectures so I can't speak much to that. What makes this a spec-compliant RSC framework? I haven't seen mention of |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm the author of the Navigation router, a fully spec-compliant RSC framework that's completely different to any other. You can get a taste by running the master-details sample from the repo. It has a people listing page where you can filter by name and selecting a person takes you to their details page.
The pages or scenes are composed of views. The 'active' prop determines which view is shown based on the URL. You can see that it looks like a traditional React app from the pre-RSC days.
Each scene view is itself made up of scene views. The people view renders a separate view for the list. It also renders the name input which triggers a navigation whenever the filter changes.
These scene views refetch independently. You specify the URL data that a view is dependent on and, whenever that data changes, the view refetches its RSC content. The list needs to update whenever the name filter changes.
With the list view updating itself, the people view never needs to update at all. We turn off refetching by passing in an empty array.
But the name filter doesn't
useOptimisticso isn't typing in the input next to impossible? Won't the user have to wait for the list to render before the URL updates and the new keystroke appears in the input?Nope. Any navigation that stays on the same scene will
useDeferredinstead ofuseTransition(only navigation that changes the scene willuseTransition). So the person view sees the up-to-date URL instantly, because it doesn't refetch, and the list view sees the old URL while it refetches.There are many other differences which you'll see by running the sample.
Beta Was this translation helpful? Give feedback.
All reactions