-
Notifications
You must be signed in to change notification settings - Fork 808
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[added] Build step for compiling to CommonJS modules #417
Conversation
Couldn't get this to merge properly so leaving it in both places
.babelrc
Outdated
"presets": ["react"], | ||
"env": { | ||
"commonjs": { | ||
"plugins": [ |
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.
Supposedly the env and non-env configs should merge, but I was seeing the below issue when I tried to consolidate. Any help is appreciated.
Tried this:
{
"presets": ["react"],
"plugins": [
"transform-class-properties",
"transform-object-rest-spread"
],
"env": {
"commonjs": {
"presets": ["env"]
},
"es": {
"presets": [
["env", { "modules": false }]
]
}
}
}
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 we can use the old .babelrc
to fix v2.0.0
. I think we need to use latest
instead of stage-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.
latest
isn't enough for this. 'stage-2` should work.
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.
Actually after some tests, .babelrc
is working as expected, but the main
in package.json is pointing to the non-compiled version. Your change to compile from src
to lib
should fix without to much change (I believe).
Will wait to squash commits until I address any review comments |
.babelrc
Outdated
"presets": ["react"], | ||
"env": { | ||
"commonjs": { | ||
"plugins": [ |
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 we can use the old .babelrc
to fix v2.0.0
. I think we need to use latest
instead of stage-2
.
|
.babelrc
Outdated
"presets": ["react"], | ||
"env": { | ||
"commonjs": { | ||
"plugins": [ |
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.
Actually after some tests, .babelrc
is working as expected, but the main
in package.json is pointing to the non-compiled version. Your change to compile from src
to lib
should fix without to much change (I believe).
package.json
Outdated
@@ -55,14 +56,13 @@ | |||
"react-addons-test-utils": "^15.0.0", | |||
"react-dom": "^15.0.0", | |||
"rf-release": "0.4.0", | |||
"rimraf": "^2.5.4", | |||
"rimraf": "^2.6.1", |
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.
rimraf
dependency can be removed.
.gitignore
Outdated
|
||
## Built folders | ||
es | ||
lib |
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 lib
can't be ignored. You can remove es
.
@diasbruno I can remove, but wouldn't you want the yarn.lock to be up-to-date for development as well? I'll wait for the documentation updates 馃槃 |
The new pipeline will guarantee that what has been changed on |
@diasbruno I've merged your PR with mine and addressed the outstanding comments 馃憤 |
@diasbruno everything is passing CI now 馃憤 |
I think we are ready to ship! Thank you so much @ajfuller. |
Released |
This repeats [the work][0] done on [@JonAbrams 's fork][1] of [reactjs/react-modal][2]. However, it replays the work on top of the latest `master` of `reactjs/react-modal`, so it should stop the PropTypes warnings that it has been generating for quite a while now: ``` Warning: Accessing PropTypes via the main React package is deprecated, and will be removed in React v16.0. Use the latest available v15.* prop-types package from npm instead. For info on usage, compatibility, migration and more, see https://fb.me/prop-types-docs ``` This also brings the fork under the Hired GitHub organization, rather than on a former employee's personal GitHub, so that should be good, too. [0]: JonAbrams@53139fa [1]: https://github.com/JonAbrams/react-modal [2]: https://github.com/reactjs/react-modal
Ran into an issue today while trying to update to version 2.0 with errors throwing because of the the static property on the class. Would like to avoid running babel against anything in node_modules, so ideally we'd have a transpiled
main
field and amodule
field that points to an ES module build.The following changes are based on the build steps from Redux repo: https://github.com/reactjs/redux/blob/master/package.json
Changes proposed:
src
so thatlib
andes
can be used for the built filesindex.js
is now an ES exportMoveNow removed entirelycreate-react-class
to dev dependency as it appears to be no longer necessary in the main libraryI've tested this locally with
npm link
and everything seems to be working as expected.Note that there are more build changes that we could make as well, but this solves the initial issue I was seeing 馃樃
Upgrade Path (for changed or removed APIs):
Acceptance Checklist:
CONTRIBUTING.md
.