4Catalyzer / found

Extensible route-based routing for React applications
https://4catalyzer.github.io/found/
MIT License
793 stars 55 forks source link

Concurrent mode #638

Open dminkovsky opened 4 years ago

dminkovsky commented 4 years ago

I am experimenting with Suspense/Concurrent Mode and am experiencing some issues with useTransition. It seems like useTransition({timeoutMs}) is not effective for suppressing route-related updates, and I am guessing that's because this library uses Redux for state management (vs. setState()). For example:

const [startTransition, isPending] = useTransition({timeoutMs: 5000})
function onClick() {
    startTransition(() => router.push('some-route'))
}

isPending is true for one or two renders, but then goes false well before the route actually transitions, and fallback UI is rendered for the route transition. The timeout is not observed for suspense boundaries that suspend during the transition.

Has anyone experienced this? If not, I could create a sandbox that demonstrates the issue.

taion commented 4 years ago

I haven't tried this yet.

My plan FWIW is to refactor this library quite a bit for concurrent mode – much of the complexity here is in rendering various loading/pending states, essentially as a user-space implementation of the functionality that suspense now provides natively.

As these problems now get handled by React proper, it seems like it would be easier to work with things if that support were factored out.

dminkovsky commented 4 years ago

Yes, I went through that exercise when I was playing with this and it was pretty fun: very little was left, concurrent mode really does handle all the heavy lifting. Looking forward to this version.

ignatevdev commented 6 months ago

A few years have passed, react-router now supports react-suspense and implements data-fetching similar to how found does it, but in the end react-router still lacks a lot of functionality, therefore I would like to ask, @taion are you planning to release a new major version of found in the near future, or maybe you could use some help with integrating suspense / concurrent mode in found?

I would love to collaborate

taion commented 6 months ago

I switched jobs a few years ago and I no longer actively use or maintain this package, sorry. This would have to be a question for whoever the current maintainer is.