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 15.6.1 #13672

Merged
merged 8 commits into from
Aug 28, 2017
Merged

Update react 15.6.1 #13672

merged 8 commits into from
Aug 28, 2017

Conversation

sorenlouv
Copy link
Member

@sorenlouv sorenlouv commented Aug 23, 2017

React was recently upgraded to 15.6.1 for x-pack and this PR ensures the version in Kibana matches.
Closes #13610

Breaking changes between 15.4.2 and 15.6.1:

Changes made:

Plugins affected:

Further reading:

@sorenlouv sorenlouv added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v6.1.0 labels Aug 23, 2017
Copy link
Member

@weltenwort weltenwort left a comment

Choose a reason for hiding this comment

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

Awesome, almost there. There are just a few uses of React.PropTypes remaining in ui_framework/src/components, which produces deprecation warnings.

@sorenlouv
Copy link
Member Author

sorenlouv commented Aug 24, 2017

@weltenwort Good catch. I only ran the codemod on the src folder, so missed the ui-framework files.

@epixa
Copy link
Contributor

epixa commented Aug 24, 2017

@sqren Can you add prop-types to the package.json? I'm not really sure how this is working at the moment, but I assume it just happens to be installed due to being a dependency of one of our dependencies.

@epixa
Copy link
Contributor

epixa commented Aug 24, 2017

Scratch that, I see it now. I must have typo'd my grep.

@epixa
Copy link
Contributor

epixa commented Aug 24, 2017

I'm still seeing 3 warnings about PropTypes usage in the jest tests:

 PASS  ui_framework/src/components/color_picker/color_picker.test.js
  ● Console

    console.warn node_modules/react/lib/lowPriorityWarning.js:40
      Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in  React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs

 PASS  ui_framework/src/components/popover/popover.test.js
 PASS  ui_framework/src/components/button/submit_button.test.js
 PASS  ui_framework/src/components/collapse_button/collapse_button.test.js
 PASS  ui_framework/src/components/tool_bar/tool_bar_search_box.test.js
 PASS  ui_framework/src/components/table/table.test.js
 PASS  ui_framework/src/components/accessibility/screen_reader.test.js
 PASS  src/core_plugins/kibana/public/dashboard/top_nav/clone_modal.test.js
  ● Console

    console.warn node_modules/react/lib/lowPriorityWarning.js:40
      Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in  React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs

 PASS  ui_framework/src/components/modal/confirm_modal.test.js (8.63s)
  ● Console

    console.warn node_modules/react/lib/lowPriorityWarning.js:40
      Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in  React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs

 PASS  ui_framework/src/components/button/button_icon/button_icon.test.js

Edit: node scripts/jest by the way

@sorenlouv
Copy link
Member Author

sorenlouv commented Aug 24, 2017

I'm still seeing 3 warnings about PropTypes usage in the jest tests:

@epixa Yes, I'm not sure where those are coming from - I'm fairly certain it's not from the Kibana. Could be a dependency that we have to bump.

@weltenwort
Copy link
Member

I couldn't find the source either, so I think a third-party dependency is the probable cause too.

Copy link
Member

@weltenwort weltenwort left a comment

Choose a reason for hiding this comment

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

I would be fine with tackling those warnings in a separate PR.

@cjcenizal
Copy link
Contributor

I think these warning are coming from the enzyme dependency. Looked like they were addressed in 2.8.1 (enzymejs/enzyme#876, enzymejs/enzyme@75d1390).

@cjcenizal
Copy link
Contributor

Oh wait, we upgraded enzyme in this PR... odd.

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

LGTM! I think I've narrowed down the source of these warnings to be our react-color dependency, which we use in the KuiColorPicker component here: https://github.com/elastic/kibana/blob/master/ui_framework/src/components/color_picker/color_picker.js#L4.

Removing this line and updating this component to not depend upon it makes all of the warnings go away. Which is weird because I don't see the relationship between this component and the modals.

Bumping react-color to 2.11.7 should fix this: casesandberg/react-color#346.

@weltenwort
Copy link
Member

wow, thanks for taking the time to dig into this, @cjcenizal

@sorenlouv
Copy link
Member Author

sorenlouv commented Aug 27, 2017

@cjcenizal Great finding, thanks! I've bumped react-color and it now passes without warnings locally. If it passes CI I'll merge it in.

@sorenlouv
Copy link
Member Author

jenkins test this

@sorenlouv sorenlouv merged commit 52552a9 into elastic:master Aug 28, 2017
@sorenlouv sorenlouv deleted the update-react-15.6.1 branch August 28, 2017 08:27
@weltenwort
Copy link
Member

awesome, thanks again!

sorenlouv added a commit to sorenlouv/kibana that referenced this pull request Aug 28, 2017
sorenlouv added a commit that referenced this pull request Aug 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v6.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade react to 15.6.1
4 participants