React Native Packager Compatibility Tip#750
Open
MikeShi42 wants to merge 1 commit intorethinkdb:nextfrom
Open
Conversation
The issue is most likely how the packager resolves dependencies as the nested babel dependency isn't used. It's odd behavior that is hard to track down the root issue but this workaround seems to be pretty good for now.
This was referenced Aug 19, 2016
|
FWIW I'm using this under // Remove babel dependencies from horizon to make React Native happy
const fs = require('fs');
const filename = 'node_modules/@horizon/client/package.json';
const fileContent = fs.readFileSync(filename);
const json = JSON.parse(fileContent);
delete json.babel;
fs.writeFileSync(filename, JSON.stringify(json, null, 2)); |
|
@benjick : where did you write those script?? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant to client 2.0.0-beta-4
Right now Horizon client is broken for React Native straight out of the box (through NPM). React Native tries to package all of a project's dependencies with its own packager. The packager checks all packages for babel configs and will try to use the package's babel config to pack the files properly. However, something seems to be wrong with it trying to use
es2015-loose. The best workaround I found so far is to just remove the babel configs so that way React Native will try to package it with its own default settings (which works out well). I'm submitting this PR so that anyone else trying to work with RN on horizon v2 beta can at least start experimenting.It's extremely hacky, if there's something is in the works to fix this permanently that would be great. Would also be awesome if someone else could validate this indeed fixes it and isn't some weird coincidence. Perhaps it would be also good to note that the current stable is not compatible with RN.
This change is