Skip to content

[mui-plugin-rtl] fix RTL does not work with CSS layer with a new package #46230

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

Merged
merged 17 commits into from
May 31, 2025

Conversation

siriwatknp
Copy link
Member

@siriwatknp siriwatknp commented May 29, 2025

Preview: https://deploy-preview-46230--material-ui.netlify.app/material-ui/getting-started/

Issue

The current docs RTL is broken.

Screen.Recording.2568-05-29.at.10.50.01.mov

The root cause comes from stylis-plugin-rtl does not work with CSS Layer.

Fix

There is no response from the PR I open to fix the issue (last commit on the repo was 4 yrs ago) so I copy the source code and put it under our repo using package name @mui/plugin-rtl.

I also update all the docs to point to the new package instead.

Screen.Recording.2568-05-29.at.11.09.46.mov

@siriwatknp siriwatknp added docs Improvements or additions to the documentation scope: docs-infra Specific to the docs-infra product labels May 29, 2025
@mui-bot
Copy link

mui-bot commented May 29, 2025

@siriwatknp siriwatknp requested review from Janpot and a team May 29, 2025 04:12
@Janpot
Copy link
Member

Janpot commented May 29, 2025

Would it make sense to just take the plugin code and test and put it as a file straight in the docs? Feels quite overkill and harder to maintain to create a whole package for these 60 LOC.

@siriwatknp
Copy link
Member Author

siriwatknp commented May 29, 2025

Would it make sense to just take the plugin code and test and put it as a file straight in the docs? Feels quite overkill and harder to maintain to create a whole package for these 60 LOC.

I thought of it as well but our docs is mentioning the package that does not work with one of our feature. That's the main reason I came up with a new package.

Would it make sense to just take the plugin code and test and put it as a file straight in the docs?

I feel it's much more work to do:

  • need to update the docs to use the dependencies of the package (e.g. cssjanus)
  • the existing tests would not work with our test infra

harder to maintain to create a whole package for these 60 LOC

The process is simple, I just fork and change the package name, finally run yarn publish. I think MUI could own the repo so that anyone can merge a bug fix if needed in the future.

@Janpot
Copy link
Member

Janpot commented May 29, 2025

I don't think we should adopt this repository. If we're going to maintain a fork then we should adopt it as a package in this repo and update the build and tests to work with our setup. That should be quite straightforward to do, we've done it with some babel plugins as well. Sure setting this up is quick and easy. Having repos for packages of 60LOC in our org is not a maintenance burden we should take on.

@siriwatknp
Copy link
Member Author

I don't think we should adopt this repository. If we're going to maintain a fork then we should adopt it as a package in this repo and update the build and tests to work with our setup. That should be quite straightforward to do, we've done it with some babel plugins as well. Sure setting this up is quick and easy. Having repos for packages of 60LOC in our org is not a maintenance burden we should take on.

I'll try it out under packages/mui-plugin-rtl folder.

@siriwatknp siriwatknp force-pushed the docs/fix-rtl-layer branch from 4186ee5 to 7eb5e40 Compare May 30, 2025 03:59
@siriwatknp
Copy link
Member Author

@Janpot Ready for review. I put it under @mui/plugin-rtl package name with folder packages/mui-plugin-rtl/*.

Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me overall, just seeing it now, I feel like this should be called @mui/stylis-plugin-rtl 🤔

@siriwatknp
Copy link
Member Author

Looks good to me overall, just seeing it now, I feel like this should be called @mui/stylis-plugin-rtl 🤔

I'm good with the name. Updating

Copy link
Member

@Janpot Janpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as far as I'm concerned. @DiegoAndai any thoughts?

Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@siriwatknp siriwatknp changed the title docs: fix RTL does not work with CSS layer [mui-plugin-rtl] fix RTL does not work with CSS layer with a new package May 31, 2025
@siriwatknp siriwatknp merged commit 65e7dac into mui:master May 31, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation scope: docs-infra Specific to the docs-infra product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants