remix-run / react-router

Declarative routing for React
https://reactrouter.com
MIT License
52.76k stars 10.21k forks source link

Change react-router to use export maps to remove the server deep import #11643

Open ryanflorence opened 2 months ago

ryanflorence commented 2 months ago

PR: https://github.com/remix-run/react-router/pull/11675

We want to keep this working:

import {} from "react-router/server"

But not have to copy the ./dist/server.js file out of dist into the root ./server.js

markdalgleish commented 2 months ago

I've started looking into this as part of https://github.com/remix-run/react-router/issues/11646 since I'm moving @react-router/server-runtime to react-router/server (TBD).

markdalgleish commented 2 months ago

PR: https://github.com/remix-run/react-router/pull/11675

jrestall commented 1 month ago

Would you accept a PR to export createRemixRequest and sendRemixResponse from @react-router/express?

These are the only deep imports we use. We use them for our custom express adapter that automatically commits the session cookie as in @sergiodxa's article:

Note: The createRemixRequestHandler, createRemixRequest, handleRequest and sendRemixResponse are all exported from @remix-run/express/dist/server. https://sergiodxa.com/tutorials/automatically-commit-session-on-remix