Commit Graph

1861 Commits

Author SHA1 Message Date
Scott Kyle d3cf748dc1 Rename RealmRPC.mm -> RealmRPC.cpp 2015-10-26 01:20:14 -07:00
Scott Kyle 0843d69a4f Expose RealmJS API as C functions
We're still using Objective-C to delete test files, so we can't rename the implementation file quite yet.
2015-10-26 01:14:33 -07:00
Scott Kyle 4d73c13466 Merge branch 'sk-chrome-xcode-tests'
* sk-chrome-xcode-tests:
  Actually report test failures when running in Chrome
  Change RealmReactTests to run with both executors
  Fix RealmReactTests to work through Chrome
  Use a default to override Chrome debugging setting
  Change ReactTests project to 4 space indentation
2015-10-23 16:38:17 -07:00
Scott Kyle 1ede355b78 Actually report test failures when running in Chrome
Turns out Chrome doesn't report back exceptions, but instead does pass back an array of five empty arrays (I am not kidding).
2015-10-23 14:13:38 -07:00
Scott Kyle e7b05d2dc6 Change RealmReactTests to run with both executors
A new approach was needed for this. The RCTDevMenu is disabled so that it doesn't interfere with us changing the executor class. A suffix is added to the name of test cases that are run in Chrome.
2015-10-23 14:12:35 -07:00
Ari Lazier ad47da8c09 Merge pull request #93 from realm/al-rpc-cpp
Rewrite rpc server in c++ so it can be used on android
2015-10-22 18:10:21 -07:00
Ari Lazier 28e21041bc bugfix and move gcd out of rpc 2015-10-22 18:06:11 -07:00
Ari Lazier 8b5a8a731c fix naming 2015-10-22 17:59:05 -07:00
Ari Lazier c3c9cee0ee make it work 2015-10-22 16:49:32 -07:00
Ari Lazier 92a9113ef6 get it to compile 2015-10-22 15:31:26 -07:00
Ari Lazier 418d6dfc1c partial port of rpc server to cpp 2015-10-22 10:44:10 -07:00
Ari Lazier 33edd04897 Merge pull request #89 from realm/al-null
Test/fix setting all primitive types to null/undefined
2015-10-22 06:24:08 -07:00
Scott Kyle 2fe1f0d26e Fix RealmReactTests to work through Chrome
The key idea was the cycle the runloop once after receiving the RCTJavaScriptDidLoadNotification so that the RCTDevMenu could also handle that notification and setup the bridge properly, as well as not block the main thread by spinning the runloop instead.
2015-10-22 02:49:15 -07:00
Scott Kyle 6a8fa75a37 Use a default to override Chrome debugging setting
This is done in a way that does not override the persistent user defaults. You set this default when launching the app by supplying `-RealmReactEnableChromeDebugging YES/NO` launch arguments.
2015-10-22 02:47:10 -07:00
Scott Kyle 56ad4faa19 Change ReactTests project to 4 space indentation
Also changed copyright notice.
2015-10-22 02:34:46 -07:00
Ari Lazier 6c3bfef73d Merge pull request #90 from realm/al-cordova-update
Update version/Fix cordova example
2015-10-21 23:07:42 -07:00
Ari Lazier 1be81205d0 check for undefined was already covered 2015-10-21 23:06:39 -07:00
Ari Lazier ac544205a1 test setting all primitive types to null/undefined throw 2015-10-21 23:06:39 -07:00
Ari Lazier ce682c3f70 Merge pull request #88 from realm/al-project
Make ReactTests runnable from RealmJS project
2015-10-21 23:05:04 -07:00
Ari Lazier a94e14cb70 update cordova to latest version/fixex 2015-10-21 20:52:18 -07:00
Ari Lazier 08a84bd8e9 cleanup scheme and target names 2015-10-21 19:20:45 -07:00
Ari Lazier 5d78670802 make ReactTests a subproject of RealmJS 2015-10-21 19:17:22 -07:00
Ari Lazier 290a595259 update to latest core 2015-10-21 19:12:36 -07:00
Scott Kyle 9cbc695fd7 Skip throwing an exception inside ResultsSetProperty 2015-10-21 15:59:11 -07:00
Scott Kyle bd2d1559d1 Error when assigning to Result index or length
Added some tests. Turns out our Chrome layer already did this too, so no changes were needed there.

Resolves #70
2015-10-21 15:25:53 -07:00
Scott Kyle d50e3ae68c Add Object.keys test for Results 2015-10-21 15:21:17 -07:00
Scott Kyle d55d42da8d Add ESLint config for JS test files
This helps the editor catch simple syntax issues before finding out about them when running a test.
2015-10-21 15:20:44 -07:00
Scott Kyle 8ba3a24eae Move RealmJSCoreTests.m to tests directory
Test failures were not pointing to the correct JS file path when it was in the src directory. This is where it belongs anyways.
2015-10-21 15:18:47 -07:00
Scott Kyle 36382ecb56 Add instanceof test for Results 2015-10-21 15:17:55 -07:00
Mark Rowe 347145b4f1 Merge pull request #8 from realm/mar-migrate-required-to-optional
Support migrating required columns to optional, preserving their contents
2015-10-21 14:40:44 -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 13617400d4 Remove libc++.tbd references from ReactExample 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 2f9c6a0727 Update ReactExample to React Native 0.13.0-rc 2015-10-21 13:57:34 -07:00
Scott Kyle 7acd4d89c1 Update ReactTests project to React Native 0.13.0-rc 2015-10-21 13:57:34 -07:00
Scott Kyle 0055d0510c Make List objects work with Object.keys in Chrome
Rather than using Object.preventExtensions to throw exceptions when setting any out-of-bounds index, we must instead compromise by only throwing for the common cases, which are -1 and list.length. Having Object.keys() support is essential for List to work with React Native ListViewDataSource.

Resolves #80
2015-10-21 13:11:41 -07:00
Mark Rowe 0b45772a0b Add a test showing our behavior when migrating from an optional column to a required column.
Optional values are not automatically migrated to required columns since it is a lossy process.

This test case revealed an issue where the number of objects can be lost if all properties of an
object were optional and are all being migrated to required. This happens because the migration
process removes the optional columns in a first pass, and recreates them as required in a second
pass. Since this results in all columns being removed, we lose track of how many objects were
stored. We avoid this by detecting the case where we are about to remove the last column and
inserting a placeholder column that we'll remove after inserting the new columns.
2015-10-20 17:52:25 -07:00
Mark Rowe 9f1702a10f Support migrating required columns to optional, preserving their contents.
Required columns are migrated to optional by creating a new nullable column,
copying the data from the required column to the optional column, then removing
the original required column.
2015-10-20 17:52:25 -07:00
Scott Kyle a8c1728502 Merge pull request #75 from realm/sk-session-id
Fix crash when reloading app during Chrome debugging
2015-10-20 16:53:29 -07:00
Ari Lazier f297a75057 Update README.md 2015-10-20 15:41:22 -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
Thomas Goyne f5b790cf87 Merge pull request #6 from realm/tg-impl
Move things which are not part of the API to an impl directory/namespace
2015-10-20 09:59:10 -07:00
Scott Kyle b98e89db22 Merge pull request #63 from realm/sk-chrome-apis
Finish implementing APIs for Chrome
2015-10-20 01:23:40 -07:00
Scott Kyle 01dc3a85d9 Add comment about usage of preventExtensions 2015-10-20 00:52:38 -07:00
Scott Kyle f2c4e7882a Make RPC lists non-extensible
Assigning to non-existent index will throw an exception and all tests pass in Chrome!
2015-10-19 17:43:51 -07:00
Scott Kyle 85e2a26b42 Make RPC Results objects auto-resize 2015-10-19 17:28:20 -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