react-router icon indicating copy to clipboard operation
react-router copied to clipboard

🗺 Loader+Action Context (Middleware)

Open ryanflorence opened this issue 2 years ago • 5 comments

Progress

  • [ ] RFC #9564
  • [ ] PR

ryanflorence avatar Nov 07 '22 23:11 ryanflorence

This is exciting! 🔥

tigerabrodi avatar Nov 11 '22 13:11 tigerabrodi

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 😅).

kentcdodds avatar Nov 12 '22 16:11 kentcdodds

Nice! 😄

Our use case also includes auth, getting the user through the context, in both the actions and loaders. 🔥

tigerabrodi avatar Nov 12 '22 19:11 tigerabrodi

Thanks guys, you are the best 👍

AMoktar avatar Nov 16 '22 18:11 AMoktar

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.

runarj avatar Nov 18 '22 12:11 runarj

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

ryanflorence avatar Jan 31 '23 19:01 ryanflorence

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.

brophdawg11 avatar Apr 27 '23 14:04 brophdawg11