๐บ๏ธ Use the remix
package
#7823
Replies: 16 comments 8 replies
-
Absolutely love the introspection here and movement towards simplicity. With many of the recent RFCs, its been refreshing to see the project adapt and move away from old decisions/patterns with the focus on delivering a quality framework. Big thumbs up from me, and keep them coming! |
Beta Was this translation helpful? Give feedback.
-
Love it! |
Beta Was this translation helpful? Give feedback.
-
I've been using a script that re-exports the Remix API, so this will eliminate the need for that. |
Beta Was this translation helpful? Give feedback.
-
This is great, we've been importing from |
Beta Was this translation helpful? Give feedback.
-
As a package developer, this will be much appreciated, right now I need to import from the server-runtime package and that means things like createCookie doesn't work because they're not exported from there, even if they work the same. And because the internal nature of the package sometimes there are breaking changes on exported types and functions that I have to work with and become breaking changes for my packages. This will help solve that. |
Beta Was this translation helpful? Give feedback.
-
This makes a lot of sense. Love it! |
Beta Was this translation helpful? Give feedback.
-
This will greatly simplify things. Sometimes I'm unsure which package to import for a certain method/type (I didn't know that some things were the same regardless of the package). |
Beta Was this translation helpful? Give feedback.
-
What does this imply about the potential for a Preact adapter, or the "Remix sans-React" framework that Ryan talks about on Twitter sometimes? Are those not even possibilities in the future? |
Beta Was this translation helpful? Give feedback.
-
I think you could probably also collapse runtime-specific packages into |
Beta Was this translation helpful? Give feedback.
-
This is a great initiative, it will make it much easier to find the correct API's and simplify the documentation.
This is true but I don't think anything is as solid, regarding data revalidation + aborting ongoing requests as remix ๐ฅฒ |
Beta Was this translation helpful? Give feedback.
-
Is this RFC being moved forward? |
Beta Was this translation helpful? Give feedback.
-
This is a really great improvement, especially for newbies. |
Beta Was this translation helpful? Give feedback.
-
I have a question about this, at the moment there are duplicate exports in How will this be handled, will it be something like redirect/clientRedirect? |
Beta Was this translation helpful? Give feedback.
-
Like it. Assuming this would also help the "remix" weekly downloads more closely reflect adoption? The flat ~20k weekly downloads for "remix" on npm trends isn't as compelling to folks making framework comparisons as the steadily increasing ~300k downloads for the @remix-run/* packages. |
Beta Was this translation helpful? Give feedback.
-
I really appreciate the way that the Remix community discusses and welcomes public conversations about big strategic topics like this. I know Iโm late to this thread, and it sounds like this is a final decision that will improve the maintainer-experience, but I wanted to chime in with a friendly dissenting experience as a Remix user, in case thatโs helpful. The possibility of being able to one day switch to using I love the other parts of Remix, too. Itโs transformed and sped up my work, and made it much easier to maintain the applications I work on. React was also a huge lift when I started using it. But Iโm still anchored on one day using a UI library that centers web components, and I want to share a few qualities I value about web components:
I think these qualities also mean web components are more indie than other component systems, a concept which was heavy in Remix's branding when I first started using it. I am very sympathetic to the improvements that it sounds like a doubling down on React will make to maintainer experience. Iโm not suggesting that Remix needs to continue to keep the door for an "indie", non-React future open. Far be it from me to say how or what Remix should maintain. I just want to be clear about some of the qualities of Remix that I value. I would love to hear about any ways yโall think a non-React future might still be possible with Remix, or about any recommendations for other tools or frameworks that might serve this purpose. I also hope it goes without saying that Iโm very grateful for all the amazing work that the Remix maintainers, and community package makers and maintainers do. Y'all have brought joy into my development workflow that I had only previously dreamt of. Thank you so much for that. |
Beta Was this translation helpful? Give feedback.
-
I've now caught up on Merging Remix and React Router, and your React conf 2024 talk @ryanflorence, and I see that I'm really late to this thread. The move to React Router makes a lot of sense to me. I appreciate the incremental upgrade philosophy a lot. I'm going to leave my prior post up because I think the spirit of what I'm saying is still relevant. Maybe the only thing I would add now that I'm caught up is: would a web componentier Remix v4 be something we'd be open to talking about while Remix is taking a nap? Is there already a Remix v4 conversation happening somewhere where it would be more appropriate to talk about this? No rush of course, I'm sure you have your hands full with React Router v7. I'd be interested in talking more about this if/when there is bandwidth. |
Beta Was this translation helpful? Give feedback.
-
Background
When importing from
@remix-run/{runtime}
(@remix-run/node
, etc.), you're often importing the same code regardless of the runtime. This complicates the docs, third party package development, and shared code across an organization deploying Remix multiple places.When Remix first started we had never seen anybody create adapters for multiple hosting platforms around the Web Fetch Request/Response APIs. We originally designed it so that the
@remix-run/{runtime}
packages were responsible for polyfilling the environment with the web APIs needed, which led to apps importing server things from@remix-run/{runtime}
. We anticipated the types and implementations would all be dependent on the specific polyfill so it seemed reasonable.Through the course of building Remix, we started moving shared runtime things into the internal dependency
@remix-run/server-runtime
. By the time we were done, the types did not actually end up being the types for the polyfill due to TS constraints, and the majority of a runtime packages were just re-exporting from@remix-run/server-runtime
.This not only makes upgrading, documenting, and using Remix more complicated than it needs to be, it makes building third-party packages for Remix more complicated too.
Fast forward three years and lots of runtimes now have the fetch API. Polyfilling isn't as needed and may soon not be needed at all. In v2 we took advantage of this and moved the responsibility to polyfill to the app, rather than the
@remix-run/{runtime}
packages.In the beginning of Remix, we also wanted to leave the door open for making the rendering library pluggable, hence
@remix-run/react
.Fast forward three years again and we've seen nearly every rendering lib implement their own remix-like framework with loaders, actions, adapters, nested routes, etc. We were interested in collaborating as a shared framework, but not interested in competing directly (we wish them well, they've done great work).
We also really like the core ideas behind RSC in React. Making the rendering lib pluggable would prove to be a huge challenge and make Remix with React vs. something else very different. This is no longer a goal of the project.
Considering all of this, we can now move all shared code from both
@remix-run/server-runtime
and@remix-run/react
toremix
and simplify the package structure for apps and third party packages.Proposal
@remix-run/server-runtime
toremix
@remix-run/react
toremix
@remix-run/server-runtime
and simply declareremix
as apeerDependency
.This means the vast majority of imports in an app will be from
"remix"
because they work everywhere:Only runtime specific things will be imported from a runtime or adapter package:
In practice, some apps won't even need a runtime package if they don't use anything specific to that runtime.
Strategy
Moving a bunch of code around at once would basically force a code freeze and invalidate every PR we've got. We'll take an iterative approach instead:
remix
package will simply re-export everything from@remix-run/react
and all runtime agnostic APIs from@remix-run/server-runtime
(just like runtime packages do today)remix
package to not disrupt the codebase too much. At this point the runtime package will re-export it from the "remix" package. We may need a third, temporary and silly internal package to avoid circular dependencies.@remix-run/server-runtime
and@remix-run/react
, for organizational reasons, but they would not be dependencies of a Remix app, but internal dependencies ofremix
.Beta Was this translation helpful? Give feedback.
All reactions