Skip to content

Commit

Permalink
feat: migrate to react hooks, close #722, close #762 and close #760
Browse files Browse the repository at this point in the history
During this process, react-styleguidist and other dev deps have been upgraded to latest.

BREAKING CHANGE:

React '>= 16.8' is required.

`{getDataTransferItems}` property has been renamed to `{getFilesFromEvent}`.
  • Loading branch information
rolandjitsu committed Mar 5, 2019
1 parent 4d74cd1 commit 5398f44
Show file tree
Hide file tree
Showing 39 changed files with 9,019 additions and 32,549 deletions.
19 changes: 0 additions & 19 deletions .babelrc

This file was deleted.

28 changes: 28 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// https://babeljs.io/docs/en/configuration
const presets = ['@babel/preset-react']
if (process.env['BABEL_ENV'] === 'es') {
presets.unshift(['@babel/preset-env', { modules: false }])
} else {
presets.unshift('@babel/preset-env')
}

const plugins = [
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-proposal-logical-assignment-operators',
['@babel/plugin-proposal-optional-chaining', { loose: false }],
['@babel/plugin-proposal-pipeline-operator', { proposal: 'minimal' }],
['@babel/plugin-proposal-nullish-coalescing-operator', { loose: false }],
'@babel/plugin-proposal-do-expressions',
'add-module-exports'
]

module.exports = {
presets,
plugins,
env: {
test: {
presets,
plugins: [...plugins, '@babel/plugin-transform-runtime', 'dynamic-import-node']
}
}
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist/
coverage/
typings/*
!.babelrc.js
Loading

1 comment on commit 5398f44

@shamas
Copy link

@shamas shamas commented on 5398f44 May 1, 2019

Choose a reason for hiding this comment

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

Great work. Thank you for this.

Please sign in to comment.