4 ms·
Library support is pretty lousy. Next 13's app directory and React Server Components is killing library support in React, so that's not such a big problem.
by onion2k 3y ago
Library support is pretty lousy.
Next 13's app directory and React Server Components is killing library support in React, so that's not such a big problem.
- Kiro 3y agoWhat does that mean?
- onion2k 3y agoIt means that library maintainers are having to make changes to their libraries to get them to work on the serverside, and a lot of them aren't not really doing that very quickly.Consequently moving to RSC reduces the number of libraries that work with your React code. It's a short term problem because most popular libraries will get updated eventually, but some won't and they'll only ever work on the client side. In the case of Next, maintainers need to package their libraries differently to support ESM modules, or you need to configure your project to use the experimental.esmModules=false flag. Again, it's not a particularly big problem but it does reduce the size of the available ecosystem a bit.
- reducesuffering 3y agoBefore, there was only client-side. Server-side is opt-in. So all the libraries you used client-side, you can still use client-side by using client-side components
- yunohn 3y agoBut that doesn’t mean React will /break/ existing libraries? It’s just a new feature that they need to start supporting, as you described.
- yunohn 3y agoI don’t know much about the former, but it’s not clear why React server components are going to kill library support.
- siquick 3y agoPretty much every library I have tried to use with Next App Router (and therefore RSC) doesn’t work with RSC. I’m sure it will change but we’ll be sticking for Next Pages for a while yet.
- solarkraft 3y agoI think you may have missed that you can circumvent all of this by declaring your components to be client components.
- flagrant_taco 3y agoWhat's the point of using RSC if you have to mark everything as client components? At best you're getting SSR support since client components actually run on the sever as well, but there are already cleaner solutions for SSR react components that rehydrate in the browser.
- solarkraft 3y agoYou're not using RSC if you're marking everything as a client component. The point is that you can do that and continue to use your old components while also able to use the new app router infrastructure.
- flagrant_taco 3y agoIs there that much benefit to just the file structure and router? That feels like a ton of refactoring just to have the same and result for a user, but maybe I'm missing some important gains of the app directory.