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

Hotfix: Revert all UNSAFE_ lifecycle methods #4078

Merged
merged 2 commits into from
Jun 15, 2018
Merged

Hotfix: Revert all UNSAFE_ lifecycle methods #4078

merged 2 commits into from
Jun 15, 2018

Conversation

danielrob
Copy link
Collaborator

The addition of the UNSAFE_ lifecycle methods broke React 15 compatibility. Those methods are not intended for libraries still supporting React 15.

The only way to remove the React 16.4+ StrictMode warnings about cWM, cWRP, and cWU in a React 15 compatible way is to migrate these methods to the new lifecycle methods and use react-lifecycles-compat for backwards compatibility. The UNSAFE_ methods were to support application authors with a known target version of React (16.3+) from having to migrate every component before upgrading. Unfortunately we can't do that trick.

Additional Testing

Since the automated tests are all run against React 16, I've confirmed this locally by building my fork, and copying the lib folder to node_modules/redux-form of a download of this sandbox which is against 15.6, and confirming that the initialValues (as per #4069) are now showing. That's the only test I've run.

Should fix

#4069, #4070, #4072

@danielrob danielrob changed the title Hotfix: Revert all UNSAFE_ lifecycle methods Hotfix: Revert all UNSAFE_ lifecycle methods Jun 15, 2018
@danielrob danielrob requested a review from erikras June 15, 2018 09:10
@erikras
Copy link
Member

erikras commented Jun 15, 2018

This is because I'm an idiot and didn't use the polyfill properly. I made the same mistake in another library.

@erikras
Copy link
Member

erikras commented Jun 15, 2018

I'll fix this immediately.

@codecov
Copy link

codecov bot commented Jun 15, 2018

Codecov Report

Merging #4078 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #4078   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          72      72           
  Lines        1666    1661    -5     
======================================
- Hits         1666    1661    -5
Impacted Files Coverage Δ
src/createReduxForm.js 100% <ø> (ø) ⬆️
src/createFields.js 100% <ø> (ø) ⬆️
src/Form.js 100% <ø> (ø) ⬆️
src/createField.js 100% <ø> (ø) ⬆️
src/createFieldArray.js 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 647a21f...a65f26c. Read the comment docs.

@erikras
Copy link
Member

erikras commented Jun 15, 2018

Published fix in v4.7.1.

@danielrob
Copy link
Collaborator Author

Sorry, I should have looked more deeply into the polyfill, they didn't mention on the front page it also supported the UNSAFE_ methods... I should have dug deeper! Thanks Erik!

@danielrob
Copy link
Collaborator Author

Wait... it doesn't...

@erikras erikras reopened this Jun 15, 2018
@erikras
Copy link
Member

erikras commented Jun 15, 2018

Misunderstanding on my part, apparently. 🤦‍♂️

@erikras erikras merged commit b50136c into redux-form:master Jun 15, 2018
@erikras
Copy link
Member

erikras commented Jun 15, 2018

Published in v7.4.2.

@lock
Copy link

lock bot commented Jul 15, 2018

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 Jul 15, 2018
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

2 participants