-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
[theme] Rename createMuiTheme
to createTheme
#25992
Conversation
This is for v4. I believe it's no longer relevant anymore cc @eps1lon. It looks like another breaking change we should do. |
Let's keep it for now since there are more StrictMode changes coming in React core. We can make it a no-op though or rather just an alias for |
29c2fb6
to
1d69eb5
Compare
Actually, should we do the same with |
I would rename it, but keeping |
@@ -44,7 +44,7 @@ yarn add @material-ui/core@next | |||
```tsx | |||
import '@material-ui/lab/themeAugmentation'; | |||
|
|||
const theme = createMuiTheme({ |
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.
I don't think we are supposed to do changes to the translated files. @oliviertassinari ?
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's best to avoid it as it add noises in the pull requests. But since this one is already very noisy, no strong preferences.
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.
Got ya!
packages/material-ui/test/umd/run.js
Outdated
@@ -47,7 +47,7 @@ async function createApp() { | |||
|
|||
let index = await fse.readFile(path.join(rootPath, 'examples/cdn/index.html'), 'utf8'); | |||
index = index.replace( | |||
'https://unpkg.com/@material-ui/core@latest/umd/material-ui.development.js', | |||
'https://unpkg.com/@material-ui/core@next/umd/material-ui.development.js', |
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.
how is this related?
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 replace
was doing nothing, because the path in examples/cdn/index.html
uses the next
tag. Since I had removed createMuiTheme
it broke the e2e tests. Now that we have createMuiTheme
back it could be reverted, or we leave it but once v5 becomes stable we have to update it back to latest
.
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.
Got it, thanks! Let’s leave it I’d say
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.
I would personally keep latest so we don't forget to update it.
On this CDN aspect, I was also eager to replace/complement this example with something more modern https://trello.com/c/8QGmlDLH
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.
I've scanned all files, this is the only non related change I could spot - #25992 (comment) I am going to create lots of conflicts with the PRs that removes the @material-ui/styles
utils from core, so I'd say it's better if we can merge this soon :)
This reverts commit 1d69eb5.
I am merging this one, not keep on resolving merge conflicts in 100+ files :D |
* migrate to emotion * make styleProps optional * remove lint and add fn name * use yearButton from styles * revert types * [docs] Document all the colors available (#26015) * [Timeline] Add support for position override on items (#25974) * [core] Remove deprecated innerRef prop (#26028) [core] Remove deprecated innerRef prop (#26028) * [theme] Rename `createMuiTheme` to `createTheme` (#25992) * [pickers] Remove redundant aria-hidden (#26014) * [internal][pickers] Remove unused styles (#26023) * [pickers] Toggle mobile keyboard view in the same commit as the view changes (#26017) * [DateRangePicker] Fix not being opened on click (#26016) * Inline classes * type -> interface * sort asc * default props are private * remove uneccesary type casting * follow convention * trigger pipeline Co-authored-by: Anshuman Pandey <[email protected]> Co-authored-by: simonecervini <[email protected]> Co-authored-by: Matheus Wichman <[email protected]> Co-authored-by: Sebastian Silbermann <[email protected]> Co-authored-by: Olivier Tassinari <[email protected]>
Depreciations
Developers only need one theme in their application. A prefix would suggest a second theme is needed. It's not the case.
createMuiTheme
will be removed in v6.Part of #20012.
Sorry for the huge PR. 😅 I did a search & replace for
createMuiTheme
ignoring everything from the blog, CHANGELOG and migration guides of previous versions. I didn't rename variables names:muiTheme
->theme
.Should we rename
unstable_createMuiStrictModeTheme
?