react-router
react-router copied to clipboard
🗺️ Split out client loaders/actions
PR: https://github.com/remix-run/react-router/pull/11871
When a link to a route with a client loader is clicked the browser has to first fetch the JS module for the route before it can call the client loader.
If a client loader is small, and the component is large, this slows down the transition because the loader is blocked by the size of the component.
get module: |---------------|
call loader: |--------|
render ^
By splitting out the clientLoader to its own bundle we can do these in parallel:
get component: |-----------|
get loader: |----|
call loader: |--------|
render ^
This is one that that makes remix remix. Why do we want to split them out ?
@mbsyaswanth the idea is to split the clientLoader and clientAction code from the route code, no to remove them from Remix itself
This is the Roadmap Planning video where it was discussed and explained https://www.youtube.com/live/7kdulqXtPII?t=2570&si=v8Xhz62QJFSVF0Rg.
@mbsyaswanth like @sergiodxa said. It's not going anywhere. Today they run in series. Tomorrow they'll run in parallel. Faster renders.