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 typescript, react, jest, & enzyme #1583

Merged
merged 16 commits into from
Feb 25, 2019

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Feb 21, 2019

Summary

Closes #1383

This is a breaking change
None of the changes should have downstream effects but our minimum dependency versions have changed.

Kibana & Cloud have updated to React 16.8 and most recent @types/* libraries, this brings EUI up to date and continues supporting these projects the best we can.

  • React minimum version bumped from 16.3 to 16.8 - EUI no longer needs to support original getDerivedStateFromProps implementation
  • Enzyme supports Portals (woohoo!) and has better support for fragments
  • Typescript now at latest, bringing support for static defaultProps in class components.

Checklist

- [ ] This was checked in mobile

  • This was checked in IE11
    - [ ] This was checked in dark mode
  • Any props added have proper autodocs
    - [ ] Documentation examples were added
  • A changelog entry exists and is marked appropriately
  • This was checked for breaking changes and labeled appropriately
  • Jest tests were updated or added to match the most common scenarios
    - [ ] This was checked against keyboard-only and screenreader scenarios
    - [ ] This required updates to Framer X components

Copy link
Contributor

@pugnascotia pugnascotia left a comment

Choose a reason for hiding this comment

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

Looks fine for the most part. There's no CHANGELOG entry though.

How would you feel about replacing SFC with FunctionComponent throughout the codebase? The former is deprecated now (along with StatelessFunctionalComponent or whatever it is).

@chandlerprall
Copy link
Contributor Author

Thanks for the reminder! Have been looking forward to changing SFC -> FunctionalComponent

@thompsongl
Copy link
Contributor

Seeing an error on initial docs load:

Warning: Failed prop type: You provided a value prop to a form field without an onChange handler. This will render a read-only field. If the field should be mutable use defaultValue. Otherwise, set either onChange or readOnly.

Coming from the context example. New version of react or react-dom must be more strict with controlled form elements

@chandlerprall
Copy link
Contributor Author

@pugnascotia converted SFC -> FunctionComponent
@thompsongl updated context example to fix that warning

Copy link
Contributor

@pugnascotia pugnascotia left a comment

Choose a reason for hiding this comment

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

Still no CHANGELOG?

You have conflicts now too.

scripts/dtsgenerator.js Outdated Show resolved Hide resolved
scripts/dtsgenerator.js Outdated Show resolved Hide resolved
@chandlerprall
Copy link
Contributor Author

Still no CHANGELOG?

I'll changelog at the very end. I'd prefer merging this on its own release so less changes ship in the breaking change, and that means any changelog now will conflict then.

You have conflicts now too.

Updated!

@@ -2,7 +2,6 @@ import { CommonProps, Omit } from '../common';
/// <reference path="../button/index.d.ts" />
/// <reference path="../focus_trap/index.d.ts" />

import { FocusTarget } from 'focus-trap';
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for this

@chandlerprall chandlerprall merged commit 6f9afe3 into elastic:master Feb 25, 2019
@chandlerprall chandlerprall deleted the typescript-v3 branch February 25, 2019 16:39
@nreese nreese mentioned this pull request Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to TypeScript v3
4 participants