oney / react-native-gcm-android

GCM for React Native Android
MIT License
172 stars 76 forks source link

use any available version of react-tools #5

Closed eranbes closed 8 years ago

eranbes commented 8 years ago

to avoid naming collision .

oney commented 8 years ago

Naming collision still happened in my test.

My steps are

git clone https://github.com/oney/TestGcm

Edit package.json

"react-native-gcm-android": "eranbes/react-native-gcm-android#patch-1"
npm install
react-native run-android

Get

React packager ready.

[13:55:22] <END>   Crawling File System (986ms)
[13:55:22] <START> Building in-memory fs for JavaScript
[13:55:23] <END>   Building in-memory fs for JavaScript (1451ms)
[13:55:23] <START> Building Haste Map
Error building DepdendencyGraph:
 Error: Naming collision detected: /Users/one/repos/TestGcm/node_modules/react-native-gcm-android/node_modules/react-tools/src/browser/ui/React.js collides with /Users/one/repos/TestGcm/node_modules/react-native/Libraries/ReactNative/React.js
    at HasteMap._updateHasteMap (/Users/one/repos/TestGcm/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:123:13)
    at /Users/one/repos/TestGcm/node_modules/react-native/packager/react-packager/src/DependencyResolver/DependencyGraph/HasteMap.js:95:28
    at tryCallOne (/Users/one/repos/TestGcm/node_modules/react-native/node_modules/promise/lib/core.js:37:12)
    at /Users/one/repos/TestGcm/node_modules/react-native/node_modules/promise/lib/core.js:103:15
    at flush (/Users/one/repos/TestGcm/node_modules/react-native/node_modules/promise/node_modules/asap/raw.js:50:29)
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)
Process terminated. Press <enter> to close the window
ghost commented 8 years ago

But at least it is different collision; the previous one was between two copies of react-tools, now it if between different things (though I really cannot imagine how to fix this... except to try talk to react people and ask them what solution they would use. OTOH, the problem is using internal pieces of react in your module. You should just use Map without require (as react includes babel which should polyfill it as it is part of ES2015), and ask fb people to if they cannot make invariant public in a clearer way).

ghost commented 8 years ago

Not relevant any more.

EDIT: with 0.0.6+, there are no name collisions, as react-tools is not used at all