Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for concurrent rendering + server components #497

Open
dougg0k opened this issue Oct 28, 2022 · 8 comments
Open

Support for concurrent rendering + server components #497

dougg0k opened this issue Oct 28, 2022 · 8 comments
Labels
discussion help needed Issues where help from the community is needed

Comments

@dougg0k
Copy link

dougg0k commented Oct 28, 2022

https://beta.nextjs.org/docs/styling/css-in-js

https://react.dev/blog/2022/03/29/react-v18#what-is-concurrent-react

reactwg/react-18#70

https://react.dev/blog/2022/03/08/react-18-upgrade-guide#new-apis-for-libraries

reactwg/react-18#110

@cristianbote
Copy link
Owner

Would love to add support for this. Would be really huge.

@dougg0k dougg0k changed the title Support for concurrent rendering + nextjs 13 server components Support for concurrent rendering + server components Oct 29, 2022
@AlexandruRoman
Copy link

Any plan on this one? I'm willing to help.

@AlexandruRoman
Copy link

Meanwhile, can we use extractCss with this approach proposed by Next.js?

https://nextjs.org/docs/app/building-your-application/styling/css-in-js#configuring-css-in-js-in-app

@cristianbote
Copy link
Owner

hey @AlexandruRoman any help is greatly appreciated! That's interesting approach. I think it should work with goober as well. Have you tried it? It might be that we just need to return a <style> tag not a registry.

@cristianbote cristianbote added discussion help needed Issues where help from the community is needed labels Jun 28, 2023
@AlexandruRoman
Copy link

@cristianbote I'll give it a try for sure!

@lxsmnsyc
Copy link

lxsmnsyc commented Aug 29, 2023

Since there's not much activity here. Some frameworks are already recommending streaming SSR and async SSR and libraries like Goober, which has a single, global state for containg sheets, doesn't work well in this environment. Vue calls this the Cross-request state pollution.

My proposal here is for Goober to have virtual sheets, something along the lines of:

const sheets = createGooberSheet();

// Usage
<GooberRegistry sheets={sheets}>
  <App />
</GooberRegistry>

// SSR, can be anytime in the future, be it immediate or async
const css = renderSheets(sheets);

Some CSS-in-JS libraries has this and I believe it definitely works as a solution.

I really like Goober (because of the size and speed), but the lack of concurrency is the only thing that's holding me back from using it.

@davedbase
Copy link

davedbase commented Aug 29, 2023

I really like Goober (because of the size and speed), but the lack of concurrency is the only thing that's holding me back from using it.

If Goober is going to remain relevant in the new RSC landscape, it needs to handle concurrent rendering. I'd also love to see this fully resolved so we can continue using Goober.

@cristianbote
Copy link
Owner

Since there's not much activity here

hehe! Thanks for the trigger 😅

As I said up here, I am super open to external or any kind of contributions 😬. Adding this sounds like a major version bump so the change in API contract would be warranted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion help needed Issues where help from the community is needed
Projects
None yet
Development

No branches or pull requests

5 participants