Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

[RN 0.40] Update iOS header imports #223

Closed
jpgarcia opened this issue Jan 6, 2017 · 20 comments
Closed

[RN 0.40] Update iOS header imports #223

jpgarcia opened this issue Jan 6, 2017 · 20 comments

Comments

@jpgarcia
Copy link

jpgarcia commented Jan 6, 2017

The headers are now under a directory called "React" that is in the compiler's include path.

This is a RN breaking change as described here so consider this to bump a new version.

@wkh237
Copy link
Owner

wkh237 commented Jan 6, 2017

@jpgarcia , Thanks for the heads up, have also noticed this change and considering if there's a better way to make the change backward compatible 😏

@jpgarcia
Copy link
Author

jpgarcia commented Jan 6, 2017

Great!

I forked the repo to perform the update (at least to be able to update the package on my side for now) but it was a PITA to get it running I think that could be related with the 0.10 dev status of the package :( will wait your update then.

@wkh237
Copy link
Owner

wkh237 commented Jan 6, 2017

Have already published a release 0.10.2-beta.2 to npm, upgrade the package

$ npm install --save [email protected]
$ react-native link

The fix should make RNFB compatible to 0.40 and existing projects, please verify if it works as expected 👍

@binchik
Copy link
Contributor

binchik commented Jan 7, 2017

@wkh237 Thanks for the patch! It works if only you remove double quotes from every import with "<...>"

wkh237 added a commit that referenced this issue Jan 8, 2017
@wkh237
Copy link
Owner

wkh237 commented Jan 8, 2017

@binchik , thanks for the remind, have fixed and published 0.10.2-beta.3 to npm, please help verify the fix.

@mrKlar
Copy link

mrKlar commented Jan 8, 2017

Hi, I tested the beta 3, but no luck, it does not work for me.

Duplicate interface definition for class 'RCTBridge'

nevermind, just commented the def line

wkh237 added a commit that referenced this issue Jan 8, 2017
wkh237 added a commit that referenced this issue Jan 8, 2017
@wkh237
Copy link
Owner

wkh237 commented Jan 8, 2017

@mrKlar , thanks for the test, just applied a fix and tested on 0.40 project, please try use the latest version on npm 0.10.2-beta.4

wkh237 added a commit that referenced this issue Jan 10, 2017
wkh237 added a commit that referenced this issue Jan 10, 2017
wkh237 added a commit that referenced this issue Jan 10, 2017
wkh237 added a commit that referenced this issue Jan 10, 2017
wkh237 added a commit that referenced this issue Jan 10, 2017
@mgiachetti
Copy link
Contributor

It's working fine for me but only when commented the def line like mrklar said.
You should leave that line commented for next version.

@leesolway
Copy link

leesolway commented Jan 13, 2017

Tested with "react-native-fetch-blob": "0.10.2-beta.4" and react-native 0.40.0

/node_modules/react-native/React/Base/RCTBridge.h:65:1: Duplicate interface definition for class 'RCTBridge'

@wkh237
Copy link
Owner

wkh237 commented Jan 13, 2017

@leesolway , thanks for the feedback. I have tested the on pure RN 0.40 project for several times and it's working good on my end.

$ react-native init rn040
$ npm install --save react-native-fetch-blob@beta
$ react-native link

If you have installed previous versions before, please remove it ( both react-native-fetch-blob folder in node_modules and the entry in package.json ). If there's another good way to make it backward compatible please let me know, thanks 👍

@mgiachetti
Copy link
Contributor

@wkh237 thanks.
I removed the folder and called react-native link again and it worked.

@mgiachetti
Copy link
Contributor

mgiachetti commented Jan 13, 2017

@wkh237 it's working fine.
But with this change we'll have to call react-native link every time we update this library or after a clean install. This is something we are not doing. We only call react-native link once for new libraries.
I think you could change the code replacing OLD_IMPORT to NEW_IMPORT then in prelink.js you check the version <40 not >= 40 and remove NEW_IMPORT in the same way as now.
Doing this you have backward compatibility without breaking the new versions of react native.

@wkh237
Copy link
Owner

wkh237 commented Jan 14, 2017

@mgiachetti , thanks for the advice, sounds pretty reasonable 👍 I'll change this part and release another version.

wkh237 added a commit that referenced this issue Jan 17, 2017
@wkh237
Copy link
Owner

wkh237 commented Jan 17, 2017

I have changed the prelink script in 0.10.2-beta.6 please verify the fix, thanks.

@bitcoinvsalts
Copy link

bitcoinvsalts commented Jan 18, 2017

I still get /RCTBridge.h:65:1: Duplicate interface definition for class 'RCTBridge' with 0.10.2-beta.6

To make it work, I removed a React Native related reference from Header Search Paths like specified in:
Ref: facebook/react-native#11725

@mgiachetti
Copy link
Contributor

@wkh237 In 0.10.2-beta.6 you still need to call react-native link every time you update the library.
please check if #235 works for you.

@DylanVann
Copy link

DylanVann commented Jan 22, 2017

For projects with multiple team members requiring a call to react-native link on every install is an issue.

I think:

  1. Checkout project.
  2. yarn or npm install
  3. react-native run-ios

Is a common workflow that should be supported.

@wkh237
Copy link
Owner

wkh237 commented Jan 27, 2017

Already published to npm, please upgrade the packge to 0.10.2-beta.8 and verify if it works, thanks !

@wkh237
Copy link
Owner

wkh237 commented Jan 27, 2017

0.10.2-beta.7 is broken, please use 0.10.2-beta.8 instead

@plougsgaard
Copy link

@wkh237 having no issues with beta8 on 0.40 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants