Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please remove unused imports. Problems with upgrade to RN 0.57.0 #412

Closed
kesha-antonov opened this issue Sep 13, 2018 · 11 comments
Closed

Comments

@kesha-antonov
Copy link

kesha-antonov commented Sep 13, 2018

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: iOS 12.0
  3. Version: ViroReact 2.10.0 and React Native 0.57.0
  4. Device(s): iPhone SE

Description

import normalizeColor from "react-native/Libraries/StyleSheet/normalizeColor"
causes fail to build
I needed to comment out those lines.

Also I've seen few unused imports. Please remove them.
Or maybe you have open source repo for Viro so I can create a PR?

@dam00n
Copy link
Collaborator

dam00n commented Sep 13, 2018

Thanks for the heads up. The latest ViroReact release is compatible with RN 0.55.1 but this information will help others who are on 0.57

@davidruisinger
Copy link

Looking forward to RN 0.57.0 support. I'm relying on the latest RN release since it fixes a critical bug in my app.

@kesha-antonov
Copy link
Author

Looking forward to RN 0.57.0 support. I'm relying on the latest RN release since it fixes a critical bug in my app.

You can add this

"fixReactViro": "find ./node_modules/react-viro/components -type f -exec sed -i '' 's#^import normalizeColor from \"react-native/Libraries/StyleSheet/normalizeColor\"#// import normalizeColor from \"react-native/Libraries/StyleSheet/normalizeColor\"#g' {} \\;",
"postinstall": "yarn run fixReactViro",

in your package.json for now

@Jnguy142
Copy link

@kesha-antonov would you mind explaining what that line does? or point me to some docs about how you came up with that?

@achuvm
Copy link
Collaborator

achuvm commented Sep 27, 2018

@Jnguy142 it's a simple bash command that uses the find command to access all the Viro components and uses the sed command to replace the old import with the new one. You'll want to add this to your package.json under the scripts: key/section.

@davidruisinger
Copy link

@kesha-antonov How did you solve the issue of resolving vrx files? I tried this but now I'm getting an error from babel ("Unexpected character").

@kesha-antonov
Copy link
Author

@kesha-antonov How did you solve the issue of resolving vrx files? I tried this but now I'm getting an error from babel ("Unexpected character").

I've had no errors with vrx files. It just works

@oOMoeOo
Copy link

oOMoeOo commented Oct 15, 2018

Hi,

i had to upgrade to react-native 0.57 too. Here is a list of all components with the unused normalizeColor import:

  • ViroDirectionalLight.js
  • ViroSkyBox.js
  • ViroAmbientLight.js
  • ViroOmniLight.js
  • ViroSpotLight.js

A fix for the next release would be great.

@manbod
Copy link
Collaborator

manbod commented Oct 16, 2018

Hi,

We've removed references to unused normalizeColor internally. That should reflect in our next release. In the meantime please use the bash command put together by @kesha-antonov here. Will update here once the next release is out.

@kesha-antonov
Copy link
Author

It's fixed in latest release

@ducsilva
Copy link

Looking forward to RN 0.57.0 support. I'm relying on the latest RN release since it fixes a critical bug in my app.

You can add this

"fixReactViro": "find ./node_modules/react-viro/components -type f -exec sed -i '' 's#^import normalizeColor from \"react-native/Libraries/StyleSheet/normalizeColor\"#// import normalizeColor from \"react-native/Libraries/StyleSheet/normalizeColor\"#g' {} \\;",
"postinstall": "yarn run fixReactViro",

in your package.json for now

How to fix it on Android?

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

No branches or pull requests

8 participants