mendix / pluggable-widgets-tools

Moved to widget resources:
https://github.com/mendix/widgets-resources/
Apache License 2.0
8 stars 5 forks source link

fix: Added missing extension #51

Closed cliedeman closed 4 years ago

cliedeman commented 4 years ago

Allow compilation with libraries that use .native.js

Otherwise uncompiled source code ends up in the bundle

Example: https://github.com/kmagiera/react-native-screens/blob/master/src/screens.native.js

diego-antonelli commented 4 years ago

Hi @cliedeman. Thanks for your PR!!

Is there multiple cases that uses this kind of extensions? Because we at Mendix didnt see that often. You can in this case extend your current webpack configuration and make it work for your case.

cliedeman commented 4 years ago

Hi There.

It's a standard I have seen in a few projects. A quick search in a react-native project of mine got these results:

./react-relay/lib/relayUnstableBatchedUpdates.native.js
./react-native/node_modules/fbjs/lib/Promise.native.js
./react-native/node_modules/fbjs/lib/Promise.native.js.flow
./metro/node_modules/fbjs/lib/Promise.native.js
./metro/node_modules/fbjs/lib/Promise.native.js.flow
./react-native-screens/src/screens.native.js
./fbjs/lib/Promise.native.js
./fbjs/lib/Promise.native.js.flow

It does result in a pretty obscure error that is hard to track down.

In my case

Error could not resolve screens.js
Andries-Smit commented 4 years ago

See docs, https://facebook.github.io/react-native/docs/platform-specific-code#native-specific-extensions-ie-sharing-code-with-nodejs-and-web

diego-antonelli commented 4 years ago

@cliedeman I would like to inform you this will be published today over version 8.6.0 of the tools

cliedeman commented 4 years ago

Thanks!