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

Update react-redux to use forwardRef syntax #4216

Closed
wants to merge 1 commit into from

Conversation

mvanlonden
Copy link

WIP DNM

Proposal for react-redux v6 contains breaking changes. This PR is a WIP to address those changes.

reduxjs/react-redux#995

cc @markerikson

@markerikson
Copy link

React-Redux 6.0 beta is now available, so this will need to be pushed forward soon. Please see https://github.com/reduxjs/react-redux/releases/tag/v6.0.0-beta.1 for our release notes, and reduxjs/react-redux#1000 for the actual changes .

@markerikson
Copy link

Hmm. The tests look to be completely busted for everything related to refs.

@mvanlonden , got time to revisit this?

@erikras
Copy link
Member

erikras commented Nov 24, 2018

I'm ready to merge when the tests pass.

Seems like package.json would need to change, no?

@markerikson
Copy link

I briefly tried cloning the repo and pulling this PR. The initial issue, as Erik said, is that the package needs to have the React-Redux version bumped.

After I did that, though, I got about 80 test failures, for a variety of reasons, and I'm not comfortable with this codebase to be able to dig into them myself.

Hopefully someone can dig into things soon.

@mvanlonden
Copy link
Author

Took a quick pass but ran into the test failures. This was for compatibility with reduxjs/react-redux#995 but might not matter since the other PR also uses forwarded refs?

I'm also not very familiar with this codebase and am migrating to a new form library.

@markerikson
Copy link

PR 1000 was what we finally went with, but they should have ultimately had the same public API.

If I upgrade the peer dep and dev dep to react-redux@6.0.0-beta.3, the test failures I'm seeing are stuff like:

  ● Fields.immutable › should rerender when sync error is cleared

    expect(jest.fn()).toHaveBeenCalledTimes(1)

    Expected mock function to have been called one time, but it was called two times.

      1400 |       // username input rendered
      1401 |       expect(usernameInput).toHaveBeenCalled()
    > 1402 |       expect(usernameInput).toHaveBeenCalledTimes(1)
           |                             ^
      1403 |
      1404 |       // username field has error
      1405 |       expect(usernameInput.mock.calls[0][0].username.meta.valid).toBe(false)

      at Object.<anonymous> (src/__tests__/Fields.spec.js:1402:29)

Lots of stuff like that.

@markerikson
Copy link

markerikson commented Nov 25, 2018

Oh. Dear.

I just realized that Redux-Form uses legacy React context internally.

That may explain why things appear to be very broken atm - I've seen a bunch of issues filed against React saying bad things happen when you mix old and new context.

Well, I tried poking around at the tests, but I think this is going to require a lot more work than I'd initially thought. @erikras , this may require some focused attention from you once you're back from your vacation.

(Also, today's lovely discovery: WebStorm doesn't recognize tests correctly when they're defined in nested functions, which is how they're done in this repo so they can be parameterized. Oops.)

@harrythedev
Copy link

I'm switching to formik. 👋

@erikras
Copy link
Member

erikras commented Dec 5, 2018

Back from vacation. Working on this...

@cereallarceny
Copy link

@erikras Do we have any rough time estimate on this?

@erikras
Copy link
Member

erikras commented Dec 6, 2018

Put in about six hours yesterday. Gonna throw some more at it today. Lots of broken tests still.

End of this week, early next week?

@pogran
Copy link

pogran commented Dec 10, 2018

@erikras , hi. The problem was fixed?

@cereallarceny
Copy link

It's not my issue @pogran 😄

@mvanlonden mvanlonden deleted the forward-ref branch December 11, 2018 16:12
@erikras
Copy link
Member

erikras commented Dec 11, 2018

Published fix in v8.0.0.

@Ogala
Copy link

Ogala commented Dec 11, 2018

Thanks @erikras. Fix works well so far! v8.0.1

@lock
Copy link

lock bot commented Jan 10, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants