Skip to content
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

Upgrade react-beautiful-dnd to v13 #3064

Merged
merged 16 commits into from
Mar 20, 2020
Merged

Conversation

LeonY1
Copy link
Contributor

@LeonY1 LeonY1 commented Mar 13, 2020

Summary

Closes #2427

I am updating the react-beautiful-dnd and @types/react-beautiful-dnd dependencies.

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in IE11 and Firefox
  • Props have proper autodocs
  • Added documentation examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@cla-checker-service
Copy link

cla-checker-service bot commented Mar 13, 2020

💚 CLA has been signed

@LeonY1
Copy link
Contributor Author

LeonY1 commented Mar 16, 2020

@chandlerprall I have now uploaded the version with the issue.

@chandlerprall
Copy link
Contributor

@LeonY1 pushed directly to your branch to get those tests fixed:

  • The code in EuiCodeBlock I referred to for testing wasn't the right section,
    describe('dynamic content', () => {
    it('updates DOM when input changes', done => {
    expect.assertions(2);
    function takeSnapshot() {
    expect(
    html.prettyPrint(appDiv.innerHTML, {
    indent_size: 2,
    unformatted: [], // Expand all tags, including spans
    })
    ).toMatchSnapshot();
    }
    // enzyme does not recreate enough of the React<->DOM interaction to reproduce this bug
    const appDiv = document.createElement('div');
    function App() {
    const [value, setValue] = useState('State 1');
    useEffect(() => {
    takeSnapshot();
    setValue('State 2');
    }, []);
    useEffect(() => {
    if (value === 'State 2') {
    takeSnapshot();
    done();
    }
    }, [value]);
    return (
    <div>
    <EuiCodeBlock language="javascript">
    const value = &apos;{value}&apos;
    </EuiCodeBlock>
    </div>
    );
    }
    ReactDOM.render(<App />, appDiv);
    });
    });
    was what I should have directed you to
  • Those tests need to use ReactDOM to mount the component into an element contained by global.document, as react-beautiful-dnd looks for them there after mount
  • resetServerContext is needed to reset dnd's internal state so the two tests can be run together or independently

@LeonY1
Copy link
Contributor Author

LeonY1 commented Mar 17, 2020

Okay thanks for the help!

@LeonY1
Copy link
Contributor Author

LeonY1 commented Mar 17, 2020

@chandlerprall This should be ready to be merged. Let me know if I need to fix anything extra

@myasonik
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3064/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

Tested functionality and everything appears to be in order.

With the move from dependencies to peerDependecies, this constitutes a breaking change. We'll need to mark it so in the changelog

@thompsongl thompsongl changed the title Upgrade react beautiful dnd Upgrade react-beautiful-dnd to v13 Mar 20, 2020
@LeonY1
Copy link
Contributor Author

LeonY1 commented Mar 20, 2020

@thompsongl I have moved it to the Breaking Changes section.

@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3064/

@thompsongl
Copy link
Contributor

After more investigation, we're not going to make RBD a peerDep.

I'll update the branch for you, @LeonY1, as I lead you down the wrong path.

@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3064/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this, @LeonY1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[a11y] Update react-beautiful-dnd to fix screen reader announcements
5 participants