-
-
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
[Core] Remove the deprecated API of v0.14.x #3108
[Core] Remove the deprecated API of v0.14.x #3108
Conversation
|
Looks good so far. I'll have a deeper look tomorrow. We should be careful with this one 😅 😅 |
@newoga Thanks for doing https://gist.github.com/newoga/1a604b642fd6a52e03a4. I have done a second commit to remove the missing deprecated API. |
No problem, I'm going to check this PR out now. Thanks for doing this! 😄 |
Additional notes:
|
} | ||
}, | ||
|
||
setValue(newValue) { |
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.
This component's clearValue()
method uses this function. We'll either have to remove that function too or implement it manually. Ideally we can just remove it but we never formally deprecated that function.
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.
Good catch!
Ideally we can just remove it but we never formally deprecated that function.
It was deprecated, calling clearValue
was throwing the warning of setValue
.
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.
True! That makes sense, be gone clearValue()
!
@oliviertassinari Alright, I gave this a quick over. I think we're close. After we tidy up the remaining issues, I'll test all the affected components one more time and then we should be done. I'm excited for removing code and cleaning up! Certainly should make it easier on contributors. |
const menuItemElements = React.Children.map(children, (child) => { | ||
const clone = React.cloneElement(child, { | ||
onTouchTap: this._onMenuItemTouchTap.bind(this, index, child.props.value), | ||
}, child.props.children); |
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.
That seems absurd to pass the children parameter. I'm gonna remove it, we will save some CPU cycles: https://github.com/facebook/react/blob/v0.14.7/src/isomorphic/classic/element/ReactElement.js#L252.
Thanks for your feedback guys! I think that I have tackled all your points in my second commit. |
* Callback function that is fired when the open state of the `LeftNav` is | ||
* requested to be changed. The provided open argument determines whether | ||
* the `LeftNav` is requested to be opened or closed. Also, the reason | ||
* argument states why the `LeftNav` got closed or opend. It can be either | ||
* `'clickaway'` for menuItem and overlay clicks, `'escape'` for pressing the | ||
* `'clickaway'` for overlay clicks, `'escape'` for pressing the | ||
* escape key and 'swipe' for swiping. For opening the reason is always `'swipe'`. |
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.
Nit: Not your fault, but just noticed 'swipe' on this line also doesn't have the 'swipe'
back ticks. Maybe we can just get it fixed here.
This commit removes the import of `mergeStyles` and `prepareStyles` from `utils/styles` for most components and files. The use of `mergeStyles` has been replaced with `Object.assign` and the `prepareStyles` function that is imported has been replaced with the `prepareStyles` implementation stored in context. As of this commit, there are only two files importing from `utils/styles`: 1. `menus/menu-divider.jsx` (which is planned for removal in PR mui#3108) 2. `mixins/style-propable.js` (which many components are still using, but the removal of this mixin is tracked in mui#2852) Signed-off-by: Neil Gabbadon <[email protected]>
@alitaheri I haven't had another full look at this since the first time. I can review again when I wake up but I remember feeling good about this from before. If you review and feel like its ready, you and @oliviertassinari can merge without me 👍 |
Looking good @oliviertassinari. Thanks a lot 👍 👍 Feel free to merge this piece of art 😍 😍 |
Awesome, I will rebase and merge 🚀. Thanks again for your feedbacks. |
[Core] Remove the deprecated API of v0.14.x
Awesome 👍 👍 🎈 🎉 🎈 😍 |
Agreed 👍 👍 I pulled this immediately. 😆 |
Same here, all my tests are green 🎉. |
This commit removes the import of `mergeStyles` and `prepareStyles` from `utils/styles` for most components and files. The use of `mergeStyles` has been replaced with `Object.assign` and the `prepareStyles` function that is imported has been replaced with the `prepareStyles` implementation stored in context. As of this commit, there are only two files importing from `utils/styles`: 1. `menus/menu-divider.jsx` (which is planned for removal in PR mui#3108) 2. `mixins/style-propable.js` (which many components are still using, but the removal of this mixin is tracked in mui#2852) Signed-off-by: Neil Gabbadon <[email protected]>
This PR is in preparation for the next
0.15.0
release.Edit by @newoga:
0.14.0 Deprecations
This is a list of deprecations that were added in version
0.14.0
. I recommend that we remove these in our first0.15.0
release candidate.Deprecated components
menu/menu
(including related components)lists/list-divider
(Remove list-divider export from lists/index.js)menus/menu-divider
drop-down-icon
(PR #2994) (There is still logic checking forDropDownIcon
intoolbar-group.jsx
)Deprecated imperative methods
_getAction()
DropDownMenu:Needed by thegetInputNode()
TextField
component.toggle()
,open()
,close()
show()
,dismiss()
setErrorText()
,setValue()
(Need to figure out what to do withclearValue()
)Deprecated props
actionFocus
,width
displayMember
,labelMember
,menuItems
,selectedIndex
,valueLink
,valueMember
labelMember
,menuItems
,selectedIndex
closeOnItemTouchTap
(not deprecated in docs)header
,menuItemClassName
,menuItemClassNameLink
,menuItemClassNameSubheader
,menuItems
,onChange
,onNavClose
,onNavOpen
,selectedIndex
onDismiss
,onShow
,openOnMount