Conversation
davidyuk
left a comment
There was a problem hiding this comment.
I don't think that all environments will support es6 imports, classes, and arrow functions, so proposing to pass button-react through webpack.
dee983f to
08db3a4
Compare
|
@shapkarin Any response to the first comment about es6 features and webpack? |
@davidyuk I will add |
08db3a4 to
1913fef
Compare
1913fef to
99acccc
Compare
davidyuk
left a comment
There was a problem hiding this comment.
Document this feature in the README, please.
Added basic version. |
f04111c to
ff038ad
Compare
| "prop-types": "^15.7.2", | ||
| "react": "^17.0.0" |
There was a problem hiding this comment.
Currently, these dependencies are inlined into the bundle, let's use externals to keep them extracted.
There was a problem hiding this comment.
I hope that will help with that, I will add it
externals: {
'prop-types': 'prop-types',
'react': 'react'
},There was a problem hiding this comment.
The general idea is not to hope but to test it using a bundle analyzer and trying to use it in different environments
There was a problem hiding this comment.
I will check it at Monday's morning
7f2c602 to
b94c723
Compare
|
@davidyuk squashed into one commit, please check this PR |
davidyuk
left a comment
There was a problem hiding this comment.
Not all issues from the last review are resolved
davidyuk
left a comment
There was a problem hiding this comment.
In general, this PR looks fine, but there is one thing related to the documentation that I would like to check before merging this. I will come back later to this PR.
|
@davidyuk fixed and I clean build folder and run it once again, looks that all is fine. I will change commits history today. |
Update webpack.config.js Co-authored-by: Denis Davidyuk <denis_davidyuk@hotmail.com> again temporary commit just to track fix README.md anchor links fix genConfig option name
Co-authored-by: Denis Davidyuk <denis_davidyuk@hotmail.com>
3884062 to
8d69c79
Compare
| super(props); | ||
| this.button = React.createRef(); | ||
| this.componentDidMount = this.componentDidUpdate = () => | ||
| createButton(this.button.current, this.props); |
There was a problem hiding this comment.
While working on #38 I have found that the replacement of the DOM node breaks subsequent component updates. I have fixed it there by using a different API.
| target: 'web', | ||
| externals: { | ||
| 'prop-types': 'prop-types', | ||
| 'react': 'react' |
There was a problem hiding this comment.
Actually, this is not working if imported using the script tag because React exposes itself there as React, it is fixed in #38
closes #21