-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[pickers] Add "use client"
directive to every public component and hook
#14562
Conversation
"use client"
directive
"use client"
directive"use client"
directive to every public component and hook
Deploy preview: https://deploy-preview-14562--material-ui-x.netlify.app/ |
I don't have strong preferences. In a ideal world, I would publish this package from the core to allow running commands such that |
But you would need to store the |
That what led me to this direction. The project config are so simple that I did not understand why copy pasting this I tried to extract the login in a If we plan to use this script in some pipeline, yes it would be nice to maintain this code in a single place. But if it's a one shot script, I don't think it is worth the effort |
I'm curious to know why the core created a standalone package for this instead of a simple script file (cc @brijeshb42 @siriwatknp). |
@mj12albert could answer that |
@alexfauquette I would argue that when we implement this, it should also have a check on CI to ensure we are using it 😅 |
I did not see such a check on the core, but I do agree that it would a nice addition |
packages/x-date-pickers-pro/src/internals/hooks/models/useRangePicker.ts
Outdated
Show resolved
Hide resolved
packages/x-date-pickers/src/dateViewRenderers/dateViewRenderers.tsx
Outdated
Show resolved
Hide resolved
@@ -29,6 +29,7 @@ | |||
"prettier:all": "prettier --write . --ignore-path .eslintignore", | |||
"prettier:check": "prettier --check . --ignore-path .eslintignore", | |||
"proptypes": "cross-env BABEL_ENV=development babel-node -i \"/node_modules/(?!@mui)/\" -x .ts,.tsx,.js ./docs/scripts/generateProptypes.ts", | |||
"rsc:build": "tsx ./packages/rsc-builder/buildRsc.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be part of CI? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not in the core, but it would be a nice addition
I'm trying to add it 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a tricky process to do in CI since you'll then want the code to be committed back.
Ideally, it should be part of the build (or did you mean build) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI reminds you to run the script locally anytime you create a new public component (if you did not add "use client" manually).
Similar to what we have for pnpm l10n
, it does not commit the localization files but it makes sure we don't forget to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brijeshb42
It is either part of the build, and we don't commit anything, or it can be a check, where if there are changes after the script is run, the CI fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👌
Thanks for taking care of it and fine-tuning the solution. 👍
Part of #9833
I copy pasted the script from the core.
@alexfauquette do you think it's worth splitting the logic and the projects on the core repo so that we could re-use the logic?