* Update test app to RN 0.39.0
* Fix getContext in index.js
* Add dependency on invariant
* Add some comments to getContext
* Make invariant a devdependency rather than a dependency
* Add user file
* Clean up initialization and add error message
* Revert "Add user file"
This reverts commit 2948f4cfc2dfd2d5d75594307b1e89806b817eb7.
* Make index.js more robust
* Fix review comments
Electron is a combination of a node and
Chromium processes. Chromium processes
can have node bindings enabled and can
therefore run most npm modules seamlessly.
The current `lib/index.js` bootstrapping
logic results in a ReferenceError on the
following statement:
typeof Realm != 'undefined'
Thus, checking whether running under node
first allows realm-js to run inside the
Electron renderer (Chromium) process.
Since Code runs in Node, rather than Chrome, we need to require the `sync-request` module. The global `__debug__` object was exposed by the vscode-react-native plugin v0.1.5 for us to be able to do that.
Resolves#374
Turns out the JSC included with React Native on Android includes a buggy implementation of ArrayIterator that is missing an exposed next() method, so we implement it ourselves instead.
The idea is that we will have an NPM module that should always be required to use the Realm JS API. It will handle the underlying implementation details depending on which environment it is being run in (i.e. JavaScriptCore, Chrome, Node).
The focus here was on stubbing out the machinery required to get React Native Chrome debugging working with the Realm API by leveraging synchronous requests. The app itself will need to run a web server that responds to these requests.