-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 build tools to latest versions #1350
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not do an extensive review but looks good in general. A few comments and questions
expect(value).toBe('autocomplete'); | ||
}); | ||
}); | ||
|
||
describe('With different props', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these tests add any value or can they be safely deleted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think can be deleted
babel.config.js
Outdated
plugins: [ | ||
'@babel/plugin-proposal-class-properties', | ||
'@babel/plugin-transform-property-literals', | ||
'@babel/plugin-transform-member-expression-literals' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need @babel/plugin-transform-runtime
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added that in now
] | ||
}, | ||
{ | ||
test: /\.css$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the CSS file be extracted using https://github.com/webpack-contrib/mini-css-extract-plugin?
@@ -0,0 +1,6 @@ | |||
ie 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the examples page load fine on IE11 and do the polyfills load correctly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They do
@@ -23,45 +23,12 @@ describe('ContainerEditorWrapper', () => { | |||
it('should create a new ContainerEditorWrapper instance wrapping the passed in component', () => { | |||
// ACT | |||
let ConnectedContainerEditorWrapper = ContainerEditorWrapper(FakeContainer); | |||
const renderedComp = Enzyme.mount(<ConnectedContainerEditorWrapper />); | |||
const renderedComp = mount(<ConnectedContainerEditorWrapper />); | |||
|
|||
// ASSERT | |||
expect(renderedComp).toBeDefined(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(renderedComp).toBeDefined();
can deleted as it will always be true
@@ -1,6 +1,5 @@ | |||
import getScrollbarSize from '../getScrollbarSize'; | |||
const rewire = require('rewire'); | |||
const ColumnMetrics = rewire('../ColumnMetrics'); | |||
const ColumnMetrics = require('../ColumnMetrics'); | |||
const Immutable = window.Immutable = require('immutable'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think const Immutable = window.Immutable = require('immutable');
can be deleted because of this change.
@@ -352,7 +352,7 @@ class InteractionMasks extends React.Component { | |||
const next = this.getNextSelectedCellPositionForKeyNavAction(keyNavAction, currentPosition, cellNavigationMode); | |||
this.checkIsAtGridBoundary(keyNavAction, next); | |||
|
|||
const { changeRowOrColumn, ...nextPos } = next; | |||
const { ...nextPos } = next; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? If this needs to be cloned then this.selectCell({ ...next})
be used directly
expect(selectedRange.bottomRight).toEqual({ idx: 3, rowIdx: 2 }); | ||
expect(selectedRange.cursorCell).toEqual({ idx: 3, rowIdx: 2 }); | ||
expect(selectedRange.startCell).toEqual({ idx: 2, rowIdx: 2 }); | ||
expect(selectedRange.topLeft).toEqual(objectMatching({ idx: 2, rowIdx: 2 })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the object being tested changed? Just figuring out the need for objectMatching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It now has a changeRowOrColumn
property that it is expecting. Not sure why the tests didnt fail before. Since I'm only interested in the cell position I used objectContaining
@@ -363,7 +363,7 @@ class InteractionMasks extends React.Component { | |||
const next = this.getNextSelectedCellPositionForKeyNavAction(keyNavAction, currentPosition, cellNavigationMode); | |||
this.checkIsAtGridBoundary(keyNavAction, next); | |||
|
|||
const { changeRowOrColumn, ...nextPos } = next; | |||
const { ...nextPos } = next; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
website/yarn.lock
Outdated
@@ -0,0 +1,10202 @@ | |||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this file need to be checked it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Committed by mistake. Have removed now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍 Just needs catchup. Once this is merged we can look into migrating to ES modules so we can set modules: false
so webpack can treeshake. One more thing I noticed, when debug is set to true in babel env, I get the following warning message
`import '@babel/polyfill'` was not found.
Not sure if it needs to be imported or not but we can work on it in a separate PR
module.exports = { | ||
presets: [ | ||
['@babel/env', { | ||
useBuiltIns: 'entry'}], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default behavior of modules
property is auto
. I did not find a good explanation but seems like auto
defaults to false
https://github.com/babel/website/pull/1856/files
I think in our case it defaults to CJS
as we still have commonjs
code along with ES
code. When it is set to false then webpack complains so we are good it seems but something to be aware of
'react-data-grid/dist/react-data-grid.min': ['./packages/react-data-grid/src'], | ||
'react-data-grid-addons/dist/react-data-grid-addons.min': ['./packages/react-data-grid-addons/src'], | ||
'react-data-grid-examples/dist/index': './packages/react-data-grid-examples/src' | ||
'react-data-grid/dist/react-data-grid': [path.resolve('packages/react-data-grid/src')], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Babel 7 upgrade * Fix lint error * fix lint error * Upgrade to Webpack 4 * Fix tests after Webpack and karma upgrade * Fix tests failing in production mode * import local * Fix failing IE tests * Fix lint errors * Add babel polyfill to tests * Add babel ployfill to dependencies * corejs dependency * Adress PR comments * Fix Data.Selectors to export correct module name * remove package.json * Commit package0lock.json
Description
Build tools upgrade
rewire
from tests after upgrading to Babel 7