Commit Graph

29 Commits

Author SHA1 Message Date
Scott Kyle 46bee3c867 Add beta licenses to Chrome JS modules 2015-10-28 10:37:17 -07:00
Ari Lazier ec87281cc1 don't convert undefined to null in rpc requests 2015-10-27 12:13:57 -07:00
Scott Kyle 2e592bc101 Sprinkle some const inside ES6 JS code
React Native 0.13.0 fixes the bug we experienced by using const.
2015-10-21 13:57:34 -07:00
Scott Kyle 725e9855fe Update RPC JS to use originalXMLHttpRequest
React Native now leaves the original object accessible when it "polyfills" objects. So we check for that, but still have the previous logic in place in case they change their minds.
2015-10-21 13:57:34 -07:00
Scott Kyle 34b84759c8 Fix crash when reloading app during Chrome debugging
Added a session ID, that actually tracks the Realm constructor in our RPC server's JS context. This conveniently let us remove the special casing for defaultPath as well as letting us call the Realm constructor with JSObjectCallAsConstructor.

Fixes #68
2015-10-20 15:10:52 -07:00
Scott Kyle 3439b4c455 Add getter/setter for defaultPath to RPC 2015-10-19 16:59:04 -07:00
Scott Kyle 03751c35b4 Handle passing dates through RPC 2015-10-19 16:46:56 -07:00
Scott Kyle b07aa72a55 Move all constants into a single JS file 2015-10-19 16:19:43 -07:00
Scott Kyle 57778ce878 Improve calling object methods through RPC 2015-10-19 16:15:38 -07:00
Scott Kyle 1b7653206a Generalize getting/setting properties through RPC 2015-10-19 15:46:00 -07:00
Scott Kyle 4c0cc578d5 Generalize calling methods through the RPC 2015-10-19 12:46:31 -07:00
Scott Kyle 5f52d07154 Add support for Results methods in Chrome
Which only consists of sortByProperty
2015-10-19 12:18:09 -07:00
Scott Kyle 78ec67cd6c Hacky support for adding notifications in Chrome
Since notifications are called synchronously after a write, we fake it by calling them manually for now. The future plan will be more involved, so some of that is stubbed out.
2015-10-19 12:09:14 -07:00
Scott Kyle 44eea1e036 Minor syntax improvements to JS shim 2015-10-19 12:07:50 -07:00
Ari Lazier 5ccc03eeb7 rename some methods for clarity - try to cleanup js objects 2015-10-15 18:48:13 -07:00
Ari Lazier eb598a2408 fix for in chrome 2015-10-15 17:07:10 -07:00
Scott Kyle 7a79ac8803 Make Xcode tests run in React environment
The deleteTestFiles() function is now added to the Realm object, so that it's easy for the RPC module to handle this as well. We can only do this in testing environments in the future.
2015-10-15 03:26:56 -07:00
Scott Kyle 94521b73bb Properly serialize args to create Realm through RPC
An exception was thrown when parsing the JSON when only a string was passed. This is better and no longer uses the Objective-C API for converting the dictionary to a JSValue.
2015-10-15 03:00:13 -07:00
Ari Lazier afa974ccc6 serialize Results like other types, use common method rpc call for objects() 2015-10-08 11:04:50 -06:00
Ari Lazier ed3cf01432 consolidate realm methods, code cleanup/remove some duplication 2015-10-08 10:43:38 -06:00
Scott Kyle 3c9fb1a323 Fix for setting properties through RPC 2015-10-08 02:00:10 -07:00
Scott Kyle ebb400ed41 Support delete and deleteAll from RPC 2015-10-08 01:53:22 -07:00
Scott Kyle 31fc14d602 Support (de)serialization of objects in RPC
Everything is a dictionary with either a `value` key or an `id` key. If it's a value, then it will recursively be (de)serialized.
2015-10-08 01:53:01 -07:00
Scott Kyle 141ce2cb6d Pass realmId for all calls to convert() in rpc.js 2015-10-07 18:40:09 -07:00
Scott Kyle 41ba3b62b8 JS implementation for Results from RPC 2015-10-07 17:08:31 -07:00
Scott Kyle f35d83a07d Account for overridden XMLHttpRequest in rpc module 2015-10-07 17:08:31 -07:00
Ari Lazier 131123ff9a first end to end rpc call 2015-10-06 14:52:49 -06:00
Ari Lazier 476b3623bb partial rpc server implemenation 2015-10-06 13:36:56 -06:00
Scott Kyle bf1ecfbb07 Initial concept of JS for Chrome debugging
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.
2015-10-01 22:56:47 -07:00