Merge pull request #1346 from realm/ap/rn49_bundler_fix

Workaround for RN >= 0.49 metro-bundler check for single string liter…
This commit is contained in:
Ashwin Phatak 2017-09-26 13:17:56 +05:30 committed by GitHub
commit c550105b2c
3 changed files with 8 additions and 3 deletions

View File

@ -8,6 +8,7 @@ X.Y.Z Release notes
### Bug fixes
* Fixed port conflict between RN >= 0.48 inspector proxy and RPC server used for Chrome debugging (#1294).
* Workaround for RN >= 0.49 metro-bundler check for single string literal argument to `require()` (#1342)
1.12.0 Release notes (2017-9-14)

View File

@ -18,9 +18,11 @@
'use strict';
const require_method = require;
// Prevent React Native packager from seeing modules required with this
function nodeRequire(module) {
return require(module);
return require_method(module);
}
function getContext() {
@ -91,7 +93,7 @@ switch(getContext()) {
var pkg = path.resolve(path.join(__dirname,'../package.json'));
var binding_path = binary.find(pkg);
realmConstructor = require(binding_path).Realm;
realmConstructor = require_method(binding_path).Realm;
break;
case 'reactnative':

View File

@ -21,8 +21,10 @@
const AuthError = require('./errors').AuthError;
const permissionApis = require('./permission-api');
const require_method = require;
function node_require(module) {
return require(module);
return require_method(module);
}
function checkTypes(args, types) {