Yomguithereal / baobab-react

React integration for Baobab.
MIT License
309 stars 38 forks source link

2.0.0-rc1: es2015 preset dependency #102

Closed magus closed 7 years ago

magus commented 8 years ago

Looks like there is a dependency on es2015 preset in the latest release from npm?

Seeing an error in baobab-react/mixins.js Couldn't find preset "es2015" relative to directory...

Yomguithereal commented 8 years ago

Hello @magus. That's strange indeed. The library doesn't need dependencies (except from your own Baobab and react, obviously) to be used and the released files are transpiled. Can you try to install 2.0.0-rc2 and tell me whether the problem persists please?

mcharytoniuk commented 8 years ago

It persists with React Native 0.25.1.

Yomguithereal commented 8 years ago

Does React Native installs relies on dev dependencies even if this is not needed?

mcharytoniuk commented 8 years ago

It's hard to say. It builds dependency graph based on node_modules require calls before running and it's possible that it parses package.json and interprets this: https://github.com/Yomguithereal/baobab-react/blob/cfa1ec5796079fdf2f5adad887fe1259244c1d01/package.json#L52 . It's only a guess though.

Yomguithereal commented 8 years ago

That's not impossible indeed but this would be quite strange for him to do so. Can you point me toward a library written in ES6 and used with react-native somewhere so I can try to find a solution?

magus commented 8 years ago

This popped up for me again...moment is ES6 but not using babel.

magus commented 8 years ago

After installing babel-preset-es2015 I'm seeing a new error...

TransformError: /node_modules/baobab-react/dist-modules/mixins.js: [BABEL] /node_modules/baobab-react/dist-modules/mixins.js: Unkown option: /node_modules/react/react.js.Children

magus commented 8 years ago

Had to install all the babel-preset dependencies to get things to build properly. Not sure I fully understand why or have the bandwidth to investigate.

"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-1": "^6.5.0",
Yomguithereal commented 8 years ago

I am a bit lost here and don't know how I can help you further. Is your project open source somehow so I can try to reproduce the issue on my end?

mcharytoniuk commented 8 years ago

It would be enough to create an empty react-native project and use baobab-react inside. It crashes during library require call.

Yomguithereal commented 8 years ago

The issue seems to be related to react-native. See this issue for instance, or this one also. It would mean I need to put Babel configuration out of the package.json and ensure the config is not in the released package but this is quite annoying. Let me check the evolution of the problem on react-native's side.