Content pfp
Content
@
0 reply
0 recast
0 reaction

shahruz pfp
shahruz
@shahruz
has anyone come across examples of RSC component packages in the wild yet? meaning frontend components that are bundled with node.js logic, and dont require setting up any api endpoints manually
2 replies
0 recast
5 reactions

‍‍ pfp
‍‍
@git
What's the relation between api endpoint and RSC?
1 reply
0 recast
0 reaction

shahruz pfp
shahruz
@shahruz
the lack of a need for one… for example importing a react component for Stripe checkout in a nextjs app usually involves setting up a stripe catchall endpoint to go with it. RSC components might be able to simplify that over time
1 reply
0 recast
0 reaction

‍‍ pfp
‍‍
@git
Like this? https://rehype-pretty-code.netlify.app/#react-server-component
1 reply
1 recast
0 reaction

shahruz pfp
shahruz
@shahruz
sort of, this is an RSC but the main benefit for this one is to optimize for the client (less work and less js in the bundle) i wasnt specific in my original post but i was thinking more about RSCs that also involve interacting with third-party API from the backend
1 reply
0 recast
0 reaction

shahruz pfp
shahruz
@shahruz
async server-side rendering for the component plus server actions seem like they could enable a new form for react-based sdks on npm
1 reply
0 recast
0 reaction

shahruz pfp
shahruz
@shahruz
another example: adding "Upload to S3" functionality to an app right now using just npm packages would involve installing a node sdk and setting up an api endpoint, and separately finding or creating a UI component to communicate with it. RSCs can have the same thing live 100% in just a UI component lib
1 reply
0 recast
1 reaction

dinislam pfp
dinislam
@dinislam.eth
this is a great example, because something similar already exists i think the minimum work for an integration like that is re-exporting the "sdk" from an api route though here's how uploadthing does it in Next: https://github.com/pingdotgg/uploadthing/blob/main/examples/minimal-appdir/src/app/api/uploadthing/route.ts
0 reply
0 recast
1 reaction