remix-run / react-router

Declarative routing for React

Home Page:https://reactrouter.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ—Ί Loader+Action Context (Middleware)

ryanflorence opened this issue Β· comments

Progress

This is exciting! πŸ”₯

This will be super helpful so I can ditch express and just rely on remix-serve πŸ”₯

My specific use case includes auth (of course), but also I'm working on implementing this: https://fly.io/docs/litefs/files/#using-txid-to-handle-consistency

So, basically, when a user makes a mutation in a non-primary region, I need to force them to wait until that data has been propagated to their region before they can read their local db.

Things get kinda funny when you distribute your data, but want to make sure there's consistency as well as availability & partition tolerance (pick two, add one πŸ˜…).

Nice! πŸ˜„

Our use case also includes auth, getting the user through the context, in both the actions and loaders. πŸ”₯

Thanks guys, you are the best πŸ‘

Great work!

I am unsure if this is relevant, but how will beforeLoader traverse the route hierarchy? If you, for example, choose a "Pre-order Traversal," are you sure it will fit all future uses of the hook?

Also, would it be better to add this as a plugin so that projects could add additional hooks themselves? I guess that this will make things too complicated, but I could be wrong.

@jacob-ebey and @brophdawg11 to try to wrap up the adapter/bundling questions, then bring in @ryanflorence and @mjackson for an API review

Closing this temporarily since we put this on hold while we finalize Remix v2. This is early on the roadmap once v2 is out so will re-open then.