Uh oh!
There was an error while loading. Please reload this page.
[do not merge] Wait for feature element - #1461
Conversation
gaearon
commented
Jan 27, 2017
Interesting: it seems to fail for a different reason now. |
Timer
commented
Jan 27, 2017
Interesting indeed ... perhaps react is mounting div and then child components on different ticks -- which would make sense for performance reasons, and we're grabbing it too soon now (10ms vs 100ms). |
23773d4 to
1825169CompareTimer
commented
Jan 28, 2017
#1274 causes the annoying errors in console. There is a bug in |
@Timer Maybe dispatch event at fixtures/kitchensink/integration/initDOM.js: setFeature(feature){this.setState({ feature },()=>window.dispatchEvent(newEvent('fixture')));} |
@tuchk4 I'm not sure if that works because the component that is set to the state sets its own state on mount. initDOM will set state to the feature, then feature will render -- after its first render it calls set state again, however, I believe initDOM's set state will be called after the first render, not the re-render caused by set state in componentDidMount in the feature. |
Not everything ends up firing the event -- not sure if this is by test code design or jsdom flaw... Need to investigate more, what do you think, @EnoahNetzach? |
yesterday I was fiddling around with the events idea: classBuiltEmitterextendsReact.Component{componentDidMount(){document.dispatchEvent(newEvent('ReactFeatureDidMount'));}render(){return<div>{this.props.children}</div>}}// ...classAppextendsReact.Component{// ...render(){constFeature=this.state.feature;returnFeature ? <BuiltEmitter><Feature/></BuiltEmitter> : null;}}but I wasn't able to produce a consistent output between the Today I'm dedicated to investigate this, but if this PR's solution is sound, I'd say to accept it. |
EnoahNetzach
commented
Jan 28, 2017
@Timer here the results EnoahNetzach/e2e-jsdom-fix. TL;DR; it works. It's not completely clear to me why in |
EnoahNetzach
commented
Jan 28, 2017
...aaaand I spoke too early. Just to validation, using the |
no, ok, now the problem (I don't have while running the suite locally) appears to be that promises (and await/async) are resolved too late. |
Timer
commented
Jan 28, 2017
I'm running into the same problem ... puzzling. 🤔 |
Should fix CI.