Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Update Codebase to use React 16 - DO NOT MERGE #1175

Closed
wants to merge 10 commits into from

Conversation

JakeLaCombe
Copy link
Contributor

@JakeLaCombe JakeLaCombe commented Jan 24, 2018

Resolves #658

Testing Branch for SD's to test terra core against.

You can find React 16 here: https://terra-core-deployed-pr-1175.herokuapp.com/static/#/site

ghfilter

  • .*.md

@bjankord bjankord temporarily deployed to terra-core-deployed-pr-1175 January 24, 2018 22:36 Inactive
@StephenEsser
Copy link
Contributor

image

@JakeLaCombe
Copy link
Contributor Author

@StephenEsser more to come as well! Almost all the wdio snapshots need to be updated :O

@mhemesath
Copy link
Contributor

We need to fix all the screenshots that were just on the element and now are full page. Those waste size and less sensitive to visual diffs.

@bjankord
Copy link
Contributor

bjankord commented Jan 25, 2018

@mhemesath Yeah I'm gonna sync with Jake with he's back in the office to get these updated. Should cut the file diff down a ton.

@bjankord
Copy link
Contributor

bjankord commented Jan 25, 2018

Seeing a few console errors on different pages. Mainly just minor prop-type stuff.

Error
warning.js:33 Warning: Failed prop type: Invalid prop `selected` of type `string` supplied to `DatePicker`, expected `object`.
Error
warning.js:33 Warning: Received `true` for a non-boolean attribute `fill`.
If you want to write it to the DOM, pass a string instead: fill="true" or fill={value.toString()}.
Error
warning.js:33 Warning: Each child in an array or iterator should have a unique "key" prop.

Check the render method of `PropsTable`. See https://fb.me/react-warning-keys for more information.
Error
Warning: React does not recognize the `isDisabled` prop on a DOM element. 
If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase 
`isdisabled` instead. If you accidentally passed it from a parent component, remove it from the 
DOM element.
Error
warning.js:33 Warning: React does not recognize the `placeholderSrc` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `placeholdersrc` instead. If you accidentally passed it from a parent component, remove it from the DOM element.

@bjankord bjankord closed this Jan 25, 2018
@bjankord bjankord reopened this Jan 25, 2018
@bjankord bjankord had a problem deploying to terra-core-deployed-pr-1175 January 25, 2018 23:30 Failure
@bjankord bjankord had a problem deploying to terra-core-deployed-pr-1175 January 26, 2018 19:16 Failure
@bjankord bjankord had a problem deploying to terra-core-deployed-pr-1175 January 26, 2018 19:32 Failure
@bjankord
Copy link
Contributor

Need to look into the branch deployment for this. It is currently failing out when trying to run webpack. It looks like its calling webpack before maybe npm install has run?

 > webpack --config webpack.prod.config --progress
       
module.js:538
    throw err;
    ^
Error: Cannot find module 'postcss-assets-webpack-plugin'

<DatePicker
name="date-input"
/>
<div>
Copy link
Contributor

@emilyrohrbough emilyrohrbough Jan 30, 2018

Choose a reason for hiding this comment

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

Oops. I think something happened here 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Totally forgot about this!

I had issues using popper, and so I created a large scroll page to test scrolling with popper. This can all be undone.

@@ -139,7 +139,7 @@ module.exports = resizeTo(['tiny', 'huge'], {

browser.expect.element('.react-datepicker').to.be.present;

browser.click('.react-datepicker__today-button');
browser.click('[aria-label="day-10"]');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this mapped to the same button?

@@ -67,6 +67,7 @@ const defaultProps = {
const contextTypes = {
/* eslint-disable consistent-return */
intl: (context) => {
console.log('Intl Checking');
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs removed

const banner = shallow(<IntlProvider locale={locale} messages={messages}><DemographicsBanner /></IntlProvider>);
expect(banner).toMatchSnapshot();
});

it('renders the banner wrapper with all props', () => {
xit('renders the banner wrapper with all props', () => {
Copy link
Contributor

@emilyrohrbough emilyrohrbough Jan 30, 2018

Choose a reason for hiding this comment

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

uncomment

@@ -8,12 +8,12 @@ import messages from '../../translations/en-US.json';

const locale = 'en-US';

it('renders a blank banner wrapper', () => {
xit('renders a blank banner wrapper', () => {
Copy link
Contributor

@emilyrohrbough emilyrohrbough Jan 30, 2018

Choose a reason for hiding this comment

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

uncomment

@@ -51,12 +51,12 @@ describe('Heading', () => {
// Prop Tests
it('should have all props including customProps set correctly', () => {
const heading = shallow(<Heading level={1} id="id" size="small" color="#f00" weight={200} isItalic isVisuallyHidden>All props and custom attrs</Heading>);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a snapshot test here instead? All of this could be removed then

@@ -7,7 +7,7 @@ it('should shallow a default component', () => {
expect(hookshot).toMatchSnapshot();
});

it('should render a default component', () => {
xit('should render a default component', () => {
Copy link
Contributor

@emilyrohrbough emilyrohrbough Jan 30, 2018

Choose a reason for hiding this comment

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

uncomment

@@ -81,7 +81,7 @@ const IconBase = ({

attributes.height = height;
attributes.width = width;
attributes.focusable = focusable;
attributes.focusable = focusable.toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

What did we make this change?

@@ -3,6 +3,8 @@ Changelog

Unreleased
----------
### Changed
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't needed

@@ -3,6 +3,8 @@ Changelog

Unreleased
----------
### Changed
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't needed

@@ -11,7 +11,7 @@ it('should mount an open modal', () => {
expect(modal).toMatchSnapshot();
});

it('should render an open modal', () => {
xit('should render an open modal', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

uncomment

@@ -7,7 +7,7 @@ it('should shallow a default component', () => {
expect(popup).toMatchSnapshot();
});

it('should render a default component', () => {
xit('should render a default component', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

uncomment

@@ -15,7 +15,6 @@ class DefaultPopup extends React.Component {
this.overlayStyle = document.documentElement.style.overflow;
this.overlayId = document.documentElement.id;
document.documentElement.id = 'popup-overlay-test';
document.documentElement.style.overflow = 'auto';
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this removed?

@@ -114,8 +114,9 @@
"postcss-loader": "^2.0.6",
"postcss-rtl": "^1.1.2",
"raw-loader": "^0.5.1",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"raf": "^3.4.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

What is raf?

@@ -23,6 +23,7 @@ const threadLoaderRule = {

module.exports = {
entry: {
raf: 'raf/polyfill',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we using two polyfills now? Will this be required by all consumers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

React 16 requires request animation frame. https://reactjs.org/blog/2017/09/26/react-v16.0.html

@@ -38,9 +38,9 @@ it('should render a arrange with status and customProps', () => {
it('should have all props including customProps set correctly', () => {
const arrangeWithStatus = <Status color="green" id="id" >{arrange}</Status>;
const wrapper = shallow(arrangeWithStatus);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can update this to a screenshot & jest will do this comparison for us

@@ -18,12 +18,6 @@ export default class TimeInputElement extends React.Component {
}
}

componentWillUnmount() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a 16 change? Should this be moved else where?

@@ -21,9 +21,11 @@ describe('Toggle', () => {
// Prop Tests
it('should have all props set correctly', () => {
const toggle = shallow(<Toggle isAnimated isOpen>All props</Toggle>);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can update this to a screenshot & jest will do this comparison for us

@emilyrohrbough
Copy link
Contributor

We shouldn't need to check in the DEPENDENCIES.md files. That'll get updated during postpublish

@bjankord bjankord temporarily deployed to terra-core-deployed-pr-1175 January 31, 2018 02:33 Inactive
@bjankord bjankord temporarily deployed to terra-core-deployed-pr-1175 January 31, 2018 02:43 Inactive
@terra-bot
Copy link

terra-bot commented Jan 31, 2018

Warnings
⚠️

❗ Big PR. Consider breaking this into smaller PRs if applicaple

Generated by 🚫 dangerJS

@JakeLaCombe
Copy link
Contributor Author

I'll close this soon and put out a more throughouh review. I wanted a link for functional testing, and also wanted to test the Travis CI builds. I'll be sure to address the comments in this review.

@JakeLaCombe
Copy link
Contributor Author

Closing. I think I have enough info to verify my next pull request will operate. I'll make sure all comments here are addressed.

@bjankord bjankord deleted the React-16-Upgrade branch February 27, 2018 20:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants