Update react transition group (WIP)#557
Conversation
virgofx
left a comment
There was a problem hiding this comment.
Looks good and simplied much of the code. I think if we just had more clear cut documentation on the default timeouts and if changing them, what variables need to be set that would be my only suggestion.
| transitionEnter: true, | ||
| transitionLeave: true | ||
| baseClassActive: 'show', | ||
| timeout: 150, |
There was a problem hiding this comment.
It appears bootstrap default is 300ms
We should definitely comment this (briefly here and more thoroughly in the example/documentation) as the timeout here also requires updating $modal-transition in custom bootstrap builds as this is important for syncing the CSS UI with the timeouts here.
EDIT: I apologize. I referenced the Modal timeouts against the Fade here. Bootstrap's Fade components are all 150 so this is correct. The modal is separate which uses 300ms/150ms. Could we at least add documentation in both these locations in source and in documentation examples as its real important that these sync otherwise there will be huge jumps where the transition end timeouts prior or the CSS transition is still continuing.
- Modal timeout changes need to update:
$modal-transition - Fade component changes (e.g. Alert) need to update:
$transition-fade
|
I think this is almost done. Only Carousel doesn't work ATM. I do have a few questions
|
|
@amikhalev Thanks a ton for tackling this.
|
| {children} | ||
| </div> | ||
| <Transition | ||
| in={true} |
There was a problem hiding this comment.
Do we want expose Transition props and spread them here? If so, can you also check for the existance of a user provided onExited and onExiting (via props) and call them in your callbacks (to not clobber the user's callbacks)
|
Best practice is to not cherry pick. We don't do that anywhere. Why was that changed?
Use proper ES imports. |
| > | ||
| {(status) => { | ||
| const { direction } = this.context; | ||
| console.log("altText: ", altText, ", status: ", status, ", direction: ", direction); |
|
@amikhalev |
|
@virgofx Ok, I wasn't aware that individual imports was preferred |
|
@mkalish @TheSharpieOne I should be able to fix Carousel (and the rest of your issues), I just made some temp commits for now. I'll probably get it done some time this weekend |
|
@amikhalev Thanks. :) |
|
@amikhalev I don't want to mess with your flow, but I have some large commits ready to be merged into v5 (such as the popper branch). I had to update react-scripts which updated eslint and jest which changed the test API (the jest 19/20 stuff) and eslint rules. Everything is working in the popper branch and test coverage have been improved (back to 99.66%), but I had to touch lots of test files, including ones you have touched. I also had to fix new linter issues which touched some of the code you have touched. |
|
@TheSharpieOne Go ahead and merge the updates, I can deal with any merge conflicts |
|
I think I fixed most of your issues. Here are the issues that I think I still need to address
|
1a67cbf to
12937d2
Compare
|
@TheSharpieOne It looks like |
|
I was thinking the same thing. I believe we could just wrap around Transition and the Collapse component itself should be much smaller code-wise as we should re-use much of the transition logic/props, etc. So the closer we can keep inline with transition would be my vote. |
|
In that case, what should I name props? |
|
I think we should probably keep |
Removed global 'react-transition-group' from both rollup and webpack configs
Also updated props related to transitions in order to better match updated react-transition-group props
This meant adding FadePage, plus adding to routes and navigation. I also updated prism to add the autolinker plugin to enable links in the docs for proptypes
76948b2 to
21413f5
Compare
|
When is this branch getting merged? I'm getting a lot of issues with react-transition-group. |
|
I've also been watching this thread. I've been holding off on a few things waiting for react-transition-group to be updated. It would be nice to know the timeline. |
|
All of the code is done. The only thing that it needs is updated tests (a lot of which is just removing tests because the code was simplified a lot). I'll probably get it done later today |
|
Ok, looks like all tests pass now. I'm pretty sure all docs are updated too. I think this is ready for final review |
TheSharpieOne
left a comment
There was a problem hiding this comment.
Docs could use some work, but I don't know how much the existing docs fit into the WIP docs eddywashere is working on. Other than that there are just a few things which can be addressed after it's merge (I'll make the tweaks).
| return delay; | ||
| onExiting(node) { | ||
| // getting this variable triggers a reflow | ||
| const _unused = node.offsetHeight; // eslint-disable-line no-unused-vars |
There was a problem hiding this comment.
I wonder if the minifier will remove this or not
| }, this.getDelay('hide')); | ||
| } | ||
| // else: do nothing. | ||
| ['onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited'].forEach((name) => { |
There was a problem hiding this comment.
Interesting. Maybe CarouselItem could do the same.
|
Awesome job @amikhalev. Thanks a ton! |
|
Thanks! It was my pleasure. reactstrap is a great library, glad to contribute! |
|
Nice. Thanks. |
* Updated rollup and webpack configs Removed global 'react-transition-group' from both rollup and webpack configs * Updated Alert for [email protected] Also updated props related to transitions in order to better match updated react-transition-group props * Updated AlertPage.js docs for new transition props * Fixed Alert tests for new transition props * Fixed lint issues related to Alert changes * Almost fixed Fade and Modal to work with [email protected] * Fixed Modal exit transition * Fixed lint issues * Fixed Fade test * Fixed Modal test; removed use of setImmediate * Fixed Modal.spec.js formatting * Updated install docs to remove react-transition-group * Updated modal documentation * Almost got carousel to work * Fixed fade props passing * Changed the way Carousel works; still not quite fixed * More attempts at fixing Carousel * Changed Alert to use Fade * Fixed all react-transition-group imports to not cherry pick * Now modal is broken :/ Fixing this * Some mork work * Changed Transition uses to use constants instead of strings * Made Carousel work! Plus added Carousel slide prop * Minor change to Fade test * Removed debug logging from CarouselItem * Fixed Modal and siplified logic * Extracted transition timeouts to utils * Simplified CarouselItem transition logic * Removed unnecessary noop props (they exist in Transition.defaultProps) * Removed CarouselItem status field * Added docs for Fade This meant adding FadePage, plus adding to routes and navigation. I also updated prism to add the autolinker plugin to enable links in the docs for proptypes * Updated Alert and Modal docs to point to Fade docs * Added mountOnEnter for Modal backdrop * Updated carousel proptypes doc * Fixed eslint issues * Updated Collapse to use Transition * Removed confusing callbacks from Modal. The callbacks on modalTransition can be used instead * Updated react-transition-group in package.json * Fixed collapse tests * Fixed eslint issues * Fixed Collapse callback issue, updated test, updated examples * Updated Collapse Docs * Added some Alert tests * Updated Collapse and Collapse tests * Updated Carousel tests * Updated Fade tests * Fixed modal tests
No description provided.