Skip to content

Upgrade typescript, react, jest, & enzyme#1583

Merged
chandlerprall merged 16 commits into
elastic:masterfrom
chandlerprall:typescript-v3
Feb 25, 2019
Merged

Upgrade typescript, react, jest, & enzyme#1583
chandlerprall merged 16 commits into
elastic:masterfrom
chandlerprall:typescript-v3

Conversation

@chandlerprall
Copy link
Copy Markdown
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

Comment thread src/components/i18n/__snapshots__/i18n.test.tsx.snap
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@thompsongl
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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.

Comment thread scripts/dtsgenerator.js Outdated
Comment thread scripts/dtsgenerator.js Outdated
@chandlerprall
Copy link
Copy Markdown
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" />

Copy link
Copy Markdown
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