day8 / re-frame-10x

A debugging dashboard for re-frame. X-ray vision as tooling.
MIT License
634 stars 68 forks source link

New conflict with react? #248

Closed rberger closed 5 years ago

rberger commented 5 years ago

Is there some new conflict with react-dom or am I doing something wrong?

I'm running cli version: 2.8.48 node: v12.7.0 npm: 6.10.3 on macOS Mojave 10.14.6

I just did:

lein new re-frame mytest +10x

Didn't change anything from the output of the template.

Then ran:

npm install
npx shadow-cljs watch app

And the Chrome console is spewing messages like the following every time I do anything in the re-frame-10x window:

react-dom.development.js:11495 Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: day8.re_frame_10x.devtools_outer, day8.re_frame_10x.utils.re_com.box, day8.re_frame_10x.utils.re_com.button, day8.re_frame_10x.utils.re_com.gap_f, day8.re_frame_10x.utils.re_com.h_box, day8.re_frame_10x.utils.re_com.label, day8.re_frame_10x.utils.re_com.line, day8.re_frame_10x.utils.re_com.v_box, day8.re_frame_10x.view.app_db.no_pods, day8.re_frame_10x.view.app_db.panel_header, day8.re_frame_10x.view.app_db.pod_section, day8.re_frame_10x.view.app_db.render, day8.re_frame_10x.view.container.devtools_inner, day8.re_frame_10x.view.container.event_name, day8.re_frame_10x.view.container.right_hand_buttons, day8.re_frame_10x.view.container.tab_button, devtools outer

react-dom.development.js:11495 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: FlipMove
superstructor commented 5 years ago

Thanks for raising this @rberger and apologies for any inconvenience this has caused you.

In short, this is now fixed with a new release of the Leiningen re-frame template so if you try again you will no longer get this issue.

The long story is there are few things going on.

1) I recently migrated the Leiningen re-frame template to use shadow-cljs and made the mistake of using caret ^ version ranges in package.json which includes any newer minor or patch level version. Unfortunately this is the default of npm install --save ....

2) Subsequently, React 16.9.0 has been released which contains a change that now prints warnings to the JS console about deprecated unsafe lifecycle methods - https://reactjs.org/blog/2019/08/08/react-v16.9.0.html#new-deprecations

3) Due to 1. when using the Leiningen re-frame template React 16.9.0 has been installed incorrectly instead of 16.8.6.

4) Now I have removed the ^ from the versions in package.json in the Leiningen re-frame template so that React 16.8.6 will used again.

5) @Deraen has been doing good work on the upcoming reagent 0.9.0, which looks like it will include React 16.9.0 - https://github.com/reagent-project/reagent/pull/443

6) Once reagent 0.9.0 is released I'll upgrade re-frame and re-frame-template to use reagent 0.9.0 (thus React 16.9.0) and due to the above pull request in 5. you should not see these warnings again.

Thanks again for the bug report.