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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material UI Next.js 13 Server Components Support -- Timeline? #37839

Closed
2 tasks done
zidinberu opened this issue Jul 6, 2023 · 3 comments 路 Fixed by #37656
Closed
2 tasks done

Material UI Next.js 13 Server Components Support -- Timeline? #37839

zidinberu opened this issue Jul 6, 2023 · 3 comments 路 Fixed by #37656
Assignees
Labels
core Infrastructure work going on behind the scenes duplicate This issue or pull request already exists

Comments

@zidinberu
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 馃暪

When should we expect MUI to provide full integration with Nextjs 13 Server Components? WITHOUT declaring everything "use client"! I hate/don't-know-much-about tailwindcss so MUI has to catchup!

Current behavior 馃槸

No response

Expected behavior 馃

No response

Context 馃敠

No response

Your environment 馃寧

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@zidinberu zidinberu added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 6, 2023
@mwskwong
Copy link
Contributor

mwskwong commented Jul 6, 2023

If your goal is just that we don't have to declare use client every time we import any MUI component, then the good news is a PR is already in the work: #37656

If your goal is for MUI to move away from Emotion, which only works in client component, then we have a long way to go #30660.

@zannager zannager added the package: system Specific to @mui/system label Jul 6, 2023
@samuelsycamore samuelsycamore assigned mj12albert and unassigned mnajdova Jul 6, 2023
@samuelsycamore samuelsycamore added core Infrastructure work going on behind the scenes duplicate This issue or pull request already exists and removed package: system Specific to @mui/system status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 6, 2023
@samuelsycamore
Copy link
Member

samuelsycamore commented Jul 6, 2023

Hey @zidinberu thanks for reaching out! To expand a little on @mwskwong's comment:

  • [core] Prepend "use-client" directive + add docs and examples for using MUI libraries with Next.js App Router聽#37656 will be merged ASAP (ideally before next week's release). This PR adds 'use client' to all components so you don't have to. It also includes guides on using the Next.js App Router with all MUI Core libs (Material, Joy, Base).
  • The bigger issue, as mentioned, is the reliance on Emotion for styles. Unfortunately, Emotion's way of doing things is just incompatible with the new paradigm of RSCs. We recently hired a new engineer to tackle this problem full-time, and he's making solid progress exploring POCs for an in-house zero-runtime CSS styling solution. We don't have an estimated timeline for shipping this, but I can assure you that it's one of our highest priorities right now.

I've marked this issue as a duplicate because #34905 is where this conversation is taking place. I would recommend following that issue for updates on our progress with the bigger issue described above. Cheers.

@samuelsycamore samuelsycamore closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2023
@coder-xiaotian
Copy link

coder-xiaotian commented Jul 9, 2023

Maybe you can use this SWC plugin as a temporary alternative.
https://github.com/coder-xiaotian/swc-useclient

@oliviertassinari oliviertassinari changed the title MUI Nextjs 13 Server Components Support -- Timeline? Material UI Next.js 13 Server Components Support -- Timeline? Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes duplicate This issue or pull request already exists
Projects
None yet
7 participants