Scott Kyle
301214dd39
Fix List splice method to be spec compatible
...
If the second argument is omitted, then all objects after the provided index should be removed. This is the same behavior as Array.prototype.splice.
2016-03-17 14:48:39 -07:00
Scott Kyle
5d872d6233
Remove accidentally included files in npm package
...
The 0.11.0-rc was bloated by lots of unnecessary build products and other miscellaneous files.
2016-03-16 16:48:04 -07:00
Scott Kyle
7feadb27b2
Fix ARM hook into JSGlobalContextCreateInGroup
...
We were loading into the program counter, which is not good in THUMB mode, so we now instead load into R3, since it's a temp register not used by this function (it only takes two arguments). Also, when building this module in THUMB mode itself, we needed to clear the ARM instruction cache, which wasn't needed when switching from THUMB to ARM mode.
2016-03-15 13:57:09 -07:00
Nabil Hachicha
53c28dca16
fixes gcc optimisation causing RealmCoordinator to use a empty/default path
...
fix indentation
2016-03-14 16:42:52 -07:00
Nabil Hachicha
48d8b6a2e7
fixes #329
2016-03-14 16:09:22 -07:00
Nabil Hachicha
92f3314a0b
fixes #329
2016-03-14 16:09:22 -07:00
Ari Lazier
991c25865a
fix for reload in example
2016-03-13 10:09:53 -07:00
Ari Lazier
e459194bfd
fix for reload in example
2016-03-13 10:09:53 -07:00
Ari Lazier
aa08d25ed0
Merge pull request #305 from realm/al-object-store
...
Latest object store changes and core
2016-03-10 16:03:12 -08:00
Thomas Goyne
c65d536573
Remove Realm::m_in_transaction and use the value from the SharedGroup
...
There were a bunch of places where m_in_transaction was not being updated
correctly when exceptions were thrown, and this eliminates that as a possible
problem entirely.
2016-03-07 13:18:20 -08:00
Thomas Goyne
b7283be7d1
Merge pull request #52 from realm/tg/core-0.97.0
...
Update to core 0.97.0
2016-03-07 13:13:59 -08:00
Thomas Goyne
af0db71187
Strip all trailing whitespace from files
2016-03-07 12:47:02 -08:00
Thomas Goyne
c94770be81
Update to core 0.97.0
2016-03-07 12:46:36 -08:00
Scott Kyle
1a127b425b
Merge pull request #289 from realm/sk-accept-constructor
...
Accept constructor in create() and objects() methods
2016-03-07 12:23:26 -08:00
Ari Lazier
6b523bab09
forward declare property
2016-03-04 07:28:10 -08:00
Ari Lazier
21a4e2543e
forward declare property
2016-03-04 07:28:10 -08:00
Ari Lazier
f7927f189c
use core to_string
2016-03-04 07:09:49 -08:00
Ari Lazier
42cb078a8c
use core to_string
2016-03-04 07:09:49 -08:00
Ari Lazier
eb7f213c93
pr fixes
2016-03-03 16:49:06 -08:00
Ari Lazier
987978fd4e
pr fixes
2016-03-03 16:49:06 -08:00
Ari Lazier
d07f82b3ec
fixes for android
2016-03-03 14:56:18 -08:00
Ari Lazier
641eb37b2c
fixes for android
2016-03-03 14:56:18 -08:00
Scott Kyle
17eb6bcbb5
submodule fixes
2016-03-03 14:48:41 -08:00
Ari Lazier
4923d7d953
object store fixes for js binding
2016-03-03 14:45:44 -08:00
Ari Lazier
548d700ffe
object store fixes for js binding
2016-03-03 14:45:44 -08:00
Ari Lazier
7802a9e976
merge latest object store
2016-03-03 14:15:54 -08:00
Ari Lazier
05429a8163
merge latest object store
2016-03-03 14:15:54 -08:00
Ari Lazier
5f61fd970c
support relative paths when opening realms
2016-03-03 13:33:49 -08:00
Scott Kyle
42cdf9daad
Disallow non-constructors to have schema property
...
Non-constructor functions (e.g. arrow functions and native functions) as well as regular objects should not be allowed as valid schema hosts. Neither of these cases were ever actually tested or used anywhere.
2016-03-03 02:52:15 -08:00
Scott Kyle
85832f0f02
Rename some functions according to PR feedback
2016-03-03 02:49:37 -08:00
kishikawa katsumi
9045d79453
Bool and NSDate properties can be indexed.
...
Core supports indexing Bool and NSDate properties.
realm-java also supports indexing Bool and NSDate properties.
It is better to align the specification with realm-java.
2016-03-02 13:20:29 -08:00
Scott Kyle
4a81b091cb
Accept constructor in create() and objects() methods
...
This will help the linter prevent spelling mistakes and make some code more easily readable.
Resolves #233
2016-03-01 00:46:03 -08:00
Scott Kyle
3858ede7c7
Rename RJSObjectSetProperty to RJSValidatedSetProperty
2016-02-29 12:37:28 -08:00
Scott Kyle
5a9ad4f2b9
Rename InvalidConstructor to UncallableConstructor
2016-02-29 12:35:12 -08:00
Scott Kyle
44a29d8dd4
Expose List and Results constructors into JS
2016-02-29 03:24:58 -08:00
Scott Kyle
154422a3d1
Make realm instances pass instanceof check
2016-02-29 03:24:58 -08:00
Ari Lazier
e495cc4685
add encryption support
2016-02-26 11:08:59 -08:00
Thomas Goyne
b7b2822082
Make it possible to disable the commit notifier background worker
...
This makes it much easier to write tests which test the work done on the
background thread.
2016-02-25 11:19:00 -08:00
Thomas Goyne
cfc88b6fd5
Rename CachedRealm to WeakRealmNotfier
2016-02-24 16:58:11 -08:00
Thomas Goyne
143cc3b696
Fix compilation with GCC 4.9
...
4.9 does not correctly implement C++14 aggregate initialization.
2016-02-24 16:58:11 -08:00
Thomas Goyne
99037a7c72
Add an AtomicSharedPtr implementation for gcc 4.9
2016-02-24 16:58:11 -08:00
Thomas Goyne
1e35324d97
Avoid holding locks while calling transaction::advance()
...
It can call user code due to change notifications, which leads to
deadlocks if that code then tries to add async queries (and advancing is
a potentially expensive operation, so doing it while holding a lock
inhibits parallelism anyway).
2016-02-24 16:58:11 -08:00
Thomas Goyne
8284340729
Remove redundant check in RealmCoordinator::advance_helper_shared_group_to_latest()
2016-02-24 16:58:11 -08:00
Thomas Goyne
4e18a99dfd
Update some out-of-date comments
2016-02-24 16:58:10 -08:00
Thomas Goyne
aa67216574
Write a much better comment about thread stuff for AsyncQuery
2016-02-24 16:58:10 -08:00
Thomas Goyne
ad46e307a2
Update the comments for Realm::Internal
2016-02-24 16:58:10 -08:00
Thomas Goyne
1430fcf474
Rename AsyncFriend to Interal
2016-02-24 16:58:10 -08:00
Thomas Goyne
c46a2a34de
Fix typos and minor errors in comments
2016-02-24 16:58:10 -08:00
Thomas Goyne
db7d6fa2a8
Don't hold onto the tableview between runs of async queries
...
Updating the table view in advance_read() can be very expensive, and the
updated data is never actually used.
2016-02-24 16:58:10 -08:00
Thomas Goyne
a95eb50915
Don't create background queries for Results on threads without runloops
2016-02-24 16:58:09 -08:00
Thomas Goyne
3e90c30571
Add more tests and fix bugs
2016-02-24 16:58:09 -08:00
Thomas Goyne
8c4f2a4f30
Reduce the scope of class friendships
2016-02-24 16:58:09 -08:00
Thomas Goyne
13e1054553
Don't continue to run queries in the background if the result is unused
2016-02-24 16:58:09 -08:00
Thomas Goyne
934263f76a
Automatically create the async query when converting to a TableView
2016-02-24 16:58:09 -08:00
Thomas Goyne
8f668fdf09
Use a single AsyncQuery per Results regardless of number of callbacks added
2016-02-24 16:58:08 -08:00
Thomas Goyne
d165458601
Add support for running queries asynchronously
2016-02-24 16:58:08 -08:00
Thomas Goyne
bceec93a69
Update to core 0.96.2
2016-02-23 15:01:35 -08:00
Tim Anglade
7cc2f69736
Merge pull request #264 from realm/km-js-fixlicense
...
License update
2016-02-21 18:56:59 -08:00
Nabil Hachicha
9bcebfaf29
PR feedback
2016-02-19 22:50:30 +00:00
Nabil Hachicha
76981229ab
start debug server only on when using chrome debug
2016-02-19 19:05:07 +00:00
Thomas Goyne
ae9d41f9ce
Remove an incorrect std::move()
2016-02-18 19:05:02 -08:00
Scott Kyle
2e3a3b5db8
Merge pull request #257 from realm/sk-schema-prop
...
The schema property should be directly on constructor
2016-02-18 16:27:47 -08:00
Karson Miller
5e9333b699
no message
2016-02-18 15:30:44 -08:00
Scott Kyle
a661350e59
Merge branch 'sk-sorted-results'
...
* sk-sorted-results:
Add sorted() method to List
Further improve argument checking for sorted()
Improve error message in sorted() method
Change sortedBy API as discussed
Allow sortedBy to accept array of properties
Change sortByProperty to return new Results
2016-02-18 15:21:35 -08:00
Scott Kyle
5b2e7b37af
Add script to update version in package.json and iOS
...
This uses agvtool to update the CURRENT_PROJECT_VERSION and DYLIB_CURRENT_VERSION project variables. The Info.plist files have been updated to propagate this value.
2016-02-18 13:58:12 -08:00
Scott Kyle
5332131c14
Add sorted() method to List
2016-02-18 13:41:11 -08:00
Scott Kyle
d847fbceb1
Further improve argument checking for sorted()
2016-02-18 12:55:54 -08:00
Scott Kyle
bd766297ef
Improve error message in sorted() method
2016-02-18 12:50:44 -08:00
Scott Kyle
05d84b23a2
Change sortedBy API as discussed
...
If provided an array, then each member can optionally be an array of [propName, reverse]
2016-02-18 12:47:18 -08:00
Scott Kyle
76865d0da4
Allow sortedBy to accept array of properties
...
It now optionally accepts an array of properties for both parameters and the tests have been updated to reflect new capabilities.
2016-02-18 11:58:39 -08:00
Scott Kyle
249bcd8f3f
Change sortByProperty to return new Results
...
The method name changed to sortedBy to reflect that it returns a new Results object and to be more succinct. Also, the second optional argument instead reflects descending (or rather, reverse) since it's an anti-pattern to have an optional argument default to true in JS, and this also follows precedences set by other JS libraries and by Python's sorted function.
2016-02-18 11:58:39 -08:00
Scott Kyle
b34e52b290
The schema property should be directly on constructor
...
The constructor is now also called with `this` set as the constructed object.
Fixes #232
2016-02-18 11:10:02 -08:00
Ari Lazier
b3486c0d0e
final fixes
2016-02-17 20:51:03 -08:00
Ari Lazier
1d01a1db73
don't copy query unnecessarily
2016-02-17 20:48:27 -08:00
Ari Lazier
e578b05058
pr feedback
2016-02-17 20:39:29 -08:00
Ari Lazier
6d02614eaa
add List.filtered
2016-02-17 20:24:08 -08:00
Ari Lazier
e91ef42ebb
add filtered method
2016-02-17 20:06:42 -08:00
Ari Lazier
98951f52ac
Merge pull request #244 from realm/al-benchmarks
...
Benchmarks
2016-02-17 13:15:47 -08:00
Thomas Goyne
87655793b7
Merge pull request #40 from realm/tg/list
...
Wrap more of LinkView in List
2016-02-16 17:35:58 -08:00
Thomas Goyne
7c350031d6
Merge pull request #37 from realm/tg/index-set-tests
...
Add IndexSet tests
2016-02-16 10:07:11 -08:00
Thomas Goyne
f5ae1bdf80
Merge pull request #39 from realm/tg/validate-schema-changes
...
Handle allowed schema changes in the transaction log observer
2016-02-16 10:07:01 -08:00
Scott Kyle
3e1889d342
Merge branch 'master' into sk-listview-merge
...
* master: (207 commits)
Convert to using new React Native MainActivity template
Create RealmReactPackage for our Android plugin
Fix doc for Android
NPM ignore react-native/android folder
Skip building Android module under Xcode
Skip building Android module for iOS tests
gitignore Android downloads folder
Update README with instructions to run on Android
Use un-patched RN for Android by installing hook into JSC
cleanup build system
Use Realm in node_modules for ReactTests on Android
Change Demo => ReactTests
adding a 'publishAndroid' task to generate the AAR with prebuilt .so files
Adjust POM_NAME
Use consistent package naming
Remove old Demo files
Add copyright to JNI file
Cleanup platform.hpp
Make our Android module buildable as a dependency
Add `npm test` command
...
2016-02-15 14:49:31 -08:00
Ari Lazier
01f92ed72f
start of benchmarks
...
fixes
enumeration test and test setup
add async store api tests
Log benchmark test errors and some other minor edits
Only delete .realm* files for tests
sql lite tests
run all the tests
worthless
Make SQLite benchmarks work
Make Realm insertion benchmark work like SQLite
run each test in release multiple times
Open each database once per benchmark test
Use same AppDelegate for benchmarks as the example
This will load the non-dev JS from the packager.
Make the benchmarks actually match their labels
Delete benchmark databases during setup phase
Some minor code style updates to benchmarks
query tests
make query test mostly work
bug fix and improved logging
remove double insertions
improved logging and bugfix
better logging
batch insersions
more reasonable counts
android
2016-02-15 13:02:25 -08:00
Thomas Goyne
a99cbb7b84
Merge pull request #41 from realm/tg/index_of
...
Remove the Query version of Results::index_of()
2016-02-12 17:37:24 -08:00
Scott Kyle
6e4b2440ba
Create RealmReactPackage for our Android plugin
...
Also renamed RealmReactAndroid to RealmReactModule to match the convention used by everyone else.
2016-02-12 09:49:11 -08:00
Scott Kyle
415b45be51
Use un-patched RN for Android by installing hook into JSC
...
This works by installing some assembly into JSGlobalContextCreateInGroup() that will immediately jump out into our own wrapper function so we always can inject the Realm constructor into the context.
2016-02-11 11:14:09 -08:00
Thomas Goyne
5f5510e170
Remove the Query version of Results::index_of()
...
It didn't work for queries based on a LinkView because for those the arguments
to count() are indexes in the LinkView rather than table rows, and there's
currently no way to check if a query is based on a LinkView.
2016-02-10 10:52:33 -08:00
Scott Kyle
5f02dc9f6d
Add copyright to JNI file
2016-02-08 15:56:08 -08:00
Scott Kyle
8e80733409
Cleanup platform.hpp
2016-02-08 15:55:52 -08:00
Thomas Goyne
638b4ec35e
Actually update the coordinator's copy of the schema
2016-02-08 14:46:42 -08:00
Thomas Goyne
a3dab7e4b1
Add wrappers for platform-specific headers and normalize include paths
...
Building the objectstore code now only requires adding the root `src` directory
to the include paths.
2016-02-08 14:46:42 -08:00
Nabil Hachicha
49a74e5646
Refactor & formatting code
2016-02-04 18:30:26 +00:00
Thomas Goyne
74eb195e7f
Add wrappers for a bunch more LinkView methods
2016-02-03 18:05:56 -08:00
Thomas Goyne
fdc67777bb
Make List default constructable
2016-02-03 18:05:56 -08:00
Thomas Goyne
4c5389dbac
Return RowExpr from List::get()
2016-02-03 18:05:55 -08:00
Thomas Goyne
8e58fc693c
Call verify_attached() from verify_in_transaction()
2016-02-03 18:05:55 -08:00
Thomas Goyne
27acf3f109
Fix spelling of verify_in_transaction
2016-02-03 18:05:55 -08:00
Thomas Goyne
9152198962
Change List::realm() to List::get_realm() for consistency
2016-02-03 18:05:55 -08:00
Thomas Goyne
6276266d67
Make List const-correct
2016-02-03 18:05:55 -08:00
Thomas Goyne
1cbbf1958f
Check the thread in all of List's methods
2016-02-03 18:05:55 -08:00
Thomas Goyne
243ae32187
Fix incorrect error message
2016-02-03 18:05:55 -08:00
Thomas Goyne
0819f72b1b
Remove call to sync_if_needed() on a LinkView
2016-02-03 18:05:55 -08:00
Thomas Goyne
62d573c1d9
Remove std:: from size_t in list.*
2016-02-03 18:05:55 -08:00
Thomas Goyne
356c17ba11
Remove list.hpp's dependency on shared_realm.hpp
2016-02-03 18:05:54 -08:00
Thomas Goyne
07c40b4517
Reformat list.{hpp,cpp} to match core style
2016-02-03 18:05:44 -08:00
Nabil Hachicha
e5ee6d8e9c
fixes #209 download core in gradle task
2016-01-30 18:26:27 +00:00
Nabil Hachicha
b92a281b5e
add missing refactored files
2016-01-28 15:11:33 +00:00
Nabil Hachicha
1e4c905cdc
Change package name fixes #204
2016-01-28 15:09:36 +00:00
Thomas Goyne
ad5db72767
Destroy all notifiers before closing realms in clear_cache()
2016-01-25 17:46:40 -08:00
Thomas Goyne
e557babaad
Fix the generic implementation of ExternalCommitHelper
2016-01-25 17:46:39 -08:00
Thomas Goyne
4eb49ce6dc
Add a not-very-useful generic CachedRealm implementation
2016-01-25 17:46:39 -08:00
Thomas Goyne
112c778d8e
Extract the non-Apple specific parts of CachedRealm to a base class
2016-01-25 17:46:39 -08:00
Thomas Goyne
178c562f2c
Add an untested non-Apple ExternalCommitHelper implementation
2016-01-25 17:46:39 -08:00
Thomas Goyne
4c195c92e0
Remove some unused cruft from ExternalCommitHelper
2016-01-25 17:46:39 -08:00
Thomas Goyne
513b3d770c
Add a short explanation of CachedRealm
2016-01-25 17:46:39 -08:00
Thomas Goyne
89bd55a535
Actually remove the Realm from the cache when close() is called
2016-01-25 17:46:38 -08:00
Thomas Goyne
9b8a0d5346
Log uncaught exceptions in the notifier thread
...
By default the thread just silently goes away.
2016-01-25 17:46:38 -08:00
Thomas Goyne
ebfca16d00
Eliminate a config copy when opening Realms
2016-01-25 17:46:38 -08:00
Thomas Goyne
e30e2ff278
Simplify RealmCoordinator::get_coordinator()
2016-01-25 17:46:38 -08:00
Thomas Goyne
7a0c83929f
Use an unordered map for the Realm coordinator cache
2016-01-25 17:46:38 -08:00
Thomas Goyne
d6daa052e8
Decouple Realm instance tracking from interprocess notifications
2016-01-25 17:46:38 -08:00
Thomas Goyne
2ed90e6d79
Check for invalid schema changes even when KVO is not used
2016-01-25 10:58:30 -08:00
Thomas Goyne
d5e00c9315
Handle allowed schema changes in the transaction log observer
2016-01-25 10:56:06 -08:00
Thomas Goyne
f3397d48c0
Add IndexSet tests
...
And fix a bug that resulted in ranges not being merged.
2016-01-25 10:36:54 -08:00
Thomas Goyne
c3a9489b02
Fix a potential deadlock when opening a realm
2016-01-25 10:13:44 -08:00
Thomas Goyne
e87a507223
Extract cache management and inter-Realm sharing to RealmCoordinator
2016-01-25 10:13:44 -08:00
Thomas Goyne
5e71c4178e
Merge pull request #17 from realm/tg-multiprocess-schema-init
...
Fix race condition in multiprocess schema init
2016-01-25 10:04:10 -08:00
Thomas Goyne
016112da8c
Merge pull request #20 from realm/tg-read-only-realm
...
Fix opening read-only Realms in read-only directories
2016-01-25 10:01:45 -08:00
Thomas Goyne
4a971b0102
Merge pull request #35 from realm/tg/cmake-fixes
...
Add headers and core's CPP flags to cmake
2016-01-25 10:01:34 -08:00
Scott Kyle
a6715d210d
Ignore more things when publishing with NPM
...
Unfortunately some kind of NPM bug is making it ignore a top-level .npmignore file.
2016-01-22 16:43:53 -08:00
Thomas Goyne
8d10a65088
Make Schema constructable from initializer lists
...
This enables the following syntax for defining object schemas, which is useful for writing tests:
Schema schema = {
{"origin", "", {
{"array", PropertyTypeArray, "target"}
}},
{"target", "", {
{"prop1", PropertyTypeInt},
{"prop2", PropertyTypeFloat},
}},
};
2016-01-22 11:55:05 -08:00
Ari Lazier
fe4abff106
delete files in the correct place
2016-01-21 12:37:03 -08:00
Scott Kyle
58ef90dc53
Only call size() when actually needed
...
This would unfortunately result in adverse performance side effects because calling size() can be expensive.
2016-01-21 11:41:38 -08:00
Thomas Goyne
62a729fbfd
Add headers to CMakeLists
2016-01-21 11:06:14 -08:00
Thomas Goyne
4b001e1842
Extract some logic to a helper function to avoid recursion in update_schema()
2016-01-20 16:26:30 -08:00
Thomas Goyne
8d7b5d8d08
Remove the tracking of if any changes were made from update_realm_with_schema()
...
It was no longer actually used for anything since we now check if any changes
are actually needed before calling it (to avoid beginning a write transaction
when not needed).
2016-01-20 16:26:30 -08:00
Thomas Goyne
9c2d4703ed
Reshuffle the updating of m_config in Realm::update_schema()
2016-01-20 16:26:30 -08:00
Thomas Goyne
6c25eeb85c
Fix race condition in multiprocess schema init
...
If the schema was initialized by a different process between when the old
schema was read and the write transaction was began, the schema init code would
see the updated schema version but not re-read the schema, resulting in it
thinking that a migration was required when the schema actually matched.
2016-01-20 16:26:29 -08:00
kishikawa katsumi
0bae415718
Read-only Realm should be opened even in immutable directory Realm files in an app bundle should be opened if marked as read-only
2016-01-20 16:25:10 -08:00
Nabil HACHICHA
bd379dd376
fixing crash on reload JS
2016-01-20 15:46:27 +00:00
Ari Lazier
b3530a43ff
use make_unique with gcc4.9
2016-01-19 13:12:24 -08:00
Ari Lazier
c4d5b9f5cc
merge latest object store
2016-01-19 10:51:43 -08:00
Mark Rowe
548701c2fd
Remove a bogus forward-declaration.
2016-01-19 10:41:25 -08:00
Mark Rowe
c4191d8af6
Hook the parser tests into the CMake build system.
2016-01-19 10:41:25 -08:00
Ari Lazier
5f2a51727b
merge in build system improvements
2016-01-15 12:46:58 -08:00
Ari Lazier
c6e46b9856
remove unneded dependencies
2016-01-15 11:49:22 -08:00
Scott Kyle
2f1eca4a9c
Merge branch 'master' into al-android-example
...
* master:
Fix typo in README
Improve clarity of schema parsing and serialization
Add test that checks schema validation
Update README with new Schema API
Cleanup some code and comments to make it consistent
Convert tests to create objects with property objects
Update example apps with new schema API
Remove confusion between propTypes and objectTypes
Simplify object schema info returned from RPC
RPC now keeps object keys in the same order
Change schema API to take properties as an object
Add method to clear mutation listeners in RPC client
Plug small leak from not releasing a JSStringRef
Make RJSStringForValue use consistent exception style
Improve error messages inside RJSUtil
2016-01-14 15:39:45 -08:00
Scott Kyle
1922125ab0
Improve clarity of schema parsing and serialization
2016-01-13 14:53:39 -08:00
Ari Lazier
63ffc760bd
merge latest from master
2016-01-13 12:46:07 -08:00
Ari Lazier
1ded2e661b
log levels
2016-01-13 11:50:19 -08:00
Ari Lazier
b45948eb9a
only start webserver in chrome debug mode
2016-01-13 11:32:29 -08:00
Ari Lazier
a9ef54d65d
chrome debugging
2016-01-13 11:18:10 -08:00
Ari Lazier
570607fa86
instantiate and make calls to rpc server
2016-01-13 11:07:54 -08:00
Nabil Hachicha
55bde66ef8
adding NanoHTTP server for chrome debug
2016-01-13 17:56:38 +00:00
Nabil Hachicha
27bae32361
Merge branch 'al-android-aar' of https://github.com/realm/realm-js into al-android-aar
2016-01-12 19:41:24 +00:00
Ari Lazier
ced472b47e
fix for last test
2016-01-12 08:16:13 -08:00
Nabil Hachicha
8c80b42748
Merge branch 'al-android-aar' of https://github.com/realm/realm-js into al-android-aar
2016-01-12 10:27:16 +00:00
Nabil Hachicha
2d8dddabee
revert getConstants to avoid initialising Realm too late
2016-01-12 10:25:53 +00:00
Ari Lazier
469121429a
implementation for remove files
2016-01-11 19:27:00 -08:00
Nabil Hachicha
b246f017e9
fix crash in using s_default_realm_directory
2016-01-12 03:01:06 +00:00
Ari Lazier
b562338b0e
code cleanup, build script
2016-01-11 09:42:26 -08:00
Nabil Hachicha
6426d48d57
defining default_realm_file_directory using application context
2016-01-11 16:18:15 +00:00
Ari Lazier
4735a91f8c
run tests
2016-01-08 16:33:53 -08:00
Ari Lazier
9a15ef4c87
initialize the context when the module is initialized
2016-01-05 20:34:50 -08:00
Ari Lazier
e90d2c514b
rebase from master
2016-01-05 19:33:56 -08:00
Scott Kyle
676849a338
Cleanup some code and comments to make it consistent
2016-01-05 13:54:03 -08:00
Scott Kyle
15052985f1
Remove confusion between propTypes and objectTypes
...
The RPC layer now only speaks in objectTypes, since they don't always equate to propTypes. We were overloading the use of propTypes for no good purpose.
2016-01-05 13:53:54 -08:00
Scott Kyle
36ffc6c77c
Simplify object schema info returned from RPC
...
Only the property names are needed.
2016-01-05 13:40:57 -08:00
Scott Kyle
c928ab716e
RPC now keeps object keys in the same order
...
Maintaining insertion order when passing objects through the RPC is essential to make the new schema API work.
2016-01-05 13:40:57 -08:00
Scott Kyle
43e14093cc
Change schema API to take properties as an object
...
The keys are names of the properties, which is more natural in JS, but will cause issues with ability to create objects where arrays of values. This feature will be removed in a subsequent commit.
2016-01-05 13:40:57 -08:00
Scott Kyle
e86dc94ee9
Plug small leak from not releasing a JSStringRef
2016-01-05 13:30:27 -08:00
Scott Kyle
213c3d832f
Make RJSStringForValue use consistent exception style
2016-01-05 13:30:27 -08:00
Scott Kyle
f5047af3bc
Improve error messages inside RJSUtil
2016-01-05 13:30:27 -08:00
Scott Kyle
2bfedc5d8a
Merge branch 'sk-project-cleanup'
...
* sk-project-cleanup:
Fix for failing React tests
Rename JS test files to be consistent
Cleanup and fix resolving JS test files
Cleanup source groups in Xcode project
Move RealmJS.mm to correct location
2016-01-05 13:19:02 -08:00
Scott Kyle
51f9bbcda4
Merge branch 'sk-snapshot-results'
...
* sk-snapshot-results:
Explicitly check if row is attached
Add methods to create snapshot of List and Results
Update to Realm Core 0.95.5
2016-01-05 13:16:27 -08:00
Nabil Hachicha
98cb634a36
using dynamic linker to expose s_globalContextRefToJSCExecutor
2016-01-05 11:08:42 -08:00
Ari Lazier
4270bc2b0f
try to initialize JSContexts
2016-01-05 11:08:42 -08:00
Ari Lazier
3a72bb3ade
finish rename
2016-01-05 11:08:42 -08:00
Ari Lazier
eea8658627
put our react module in our aar
2016-01-05 11:08:42 -08:00
Nabil Hachicha
28d1f92a7e
add Demo project based on the built realmreact lib
2016-01-05 11:07:21 -08:00
Ari Lazier
1fa0098158
empty implementations for platform methods
2016-01-05 11:07:21 -08:00
Ari Lazier
8104738e1a
use gcc
2016-01-05 11:07:21 -08:00
Ari Lazier
50ecaa3b22
just use one symlink to the binding source, make more stuff compile
2016-01-05 11:05:44 -08:00
Ari Lazier
3aaf988953
fixes
2016-01-05 11:05:27 -08:00
Nabil Hachicha
c3d5fd4e09
add Core include + fix c++14 issue
2016-01-05 11:04:06 -08:00
Ari Lazier
fb1d6b6a93
more import fixes
2016-01-05 11:04:06 -08:00
Ari Lazier
2974d87560
fix imports
2016-01-05 11:04:06 -08:00
Ari Lazier
62ae41327d
include JSBase
2016-01-05 11:04:06 -08:00
Nabil Hachicha
5b06c41163
adding module deps + fixing gradle
2016-01-05 11:04:06 -08:00
Ari Lazier
518133e769
bdash pr fixes
2016-01-04 18:13:09 -08:00
Ari Lazier
24be3ab825
remove unnedded constructors/destructor
2016-01-04 16:51:51 -08:00
Ari Lazier
3e45625748
pr fixes
2016-01-04 16:37:07 -08:00
Ari Lazier
4c7d6d8b2f
remove unnecessary const cast
2016-01-04 16:27:37 -08:00
Ari Lazier
d964c77d2d
store ObjectSchema as a pointer rather than a reference
2016-01-04 16:21:28 -08:00
Scott Kyle
a9b9e479cf
Explicitly check if row is attached
2016-01-04 16:17:28 -08:00
Ari Lazier
df901c636f
store ObjectSchema as a pointer rather than a reference
2016-01-04 16:04:01 -08:00
Ari Lazier
aa5e1bef7d
remove invalid usage of const Schema
2016-01-04 15:54:03 -08:00
Ari Lazier
148abd4b7b
merge latest object store changes
2016-01-04 15:42:32 -08:00
Scott Kyle
632f9d737e
Add methods to create snapshot of List and Results
...
The Results class was updated to match the style of List and include a flag (m_live) that determines if it should sync updates. If an object in the static Results is deleted, then it will return null.
2015-12-30 16:53:26 -08:00
Scott Kyle
602613b992
Update to Realm Core 0.95.5
2015-12-30 16:53:26 -08:00
Scott Kyle
5fe90c9904
Move RealmJS.mm to correct location
2015-12-29 14:55:20 -08:00
Ari Lazier
a73229758d
pr feedback
2015-12-18 14:37:41 -08:00
Ari Lazier
df9468f8d0
fix for copy assignment
2015-12-17 18:40:26 -08:00
Ari Lazier
9b907b336a
results should store const ObjectSchema
2015-12-17 17:32:51 -08:00
Ari Lazier
86e95fb9b1
Schema stored in Realm::Config should be const
2015-12-17 16:18:16 -08:00
Scott Kyle
41ef7c41a6
Fix crash caused by accessing invalid ObjectSchema
...
These references would eventually become invalid. The quickest fix is for them to no longer be references. The longer-term fix might be to only store the object type and dynamically retrieve the ObjectSchema only when necessary.
Fixes #181
2015-12-16 13:04:53 -08:00
Scott Kyle
4109c86343
Make Realm object properties enumerable
2015-12-08 03:26:57 -08:00
Ari Lazier
5d1e9d4dd3
pr fixes
2015-11-30 11:47:32 -08:00
Ari Lazier
71ef42bd61
move rpc react modele back to lib
2015-11-30 11:31:58 -08:00
Ari Lazier
ca843cb48b
pr fixes
2015-11-30 11:23:30 -08:00
Ari Lazier
5f584f747f
use underscore rather than dash
2015-11-30 11:23:29 -08:00
Ari Lazier
eb44b27633
move everything/rename to make room for android
2015-11-30 11:23:29 -08:00
Ari Lazier
f714d11293
Merge pull request #172 from realm/al-keypath
...
tests for keypath queries
2015-11-29 19:29:14 -08:00
Ari Lazier
7ad2786359
Merge pull request #168 from realm/al-os-merge
...
Integrate new Results class
2015-11-29 18:58:55 -08:00
Ari Lazier
cdb254ca44
tests for keypath queries
2015-11-29 18:56:50 -08:00
Ari Lazier
8a00a2f92a
call results constructor taking a table when no query is provided
2015-11-25 19:59:51 -08:00
Ari Lazier
39e3b017a4
integrate new results class
2015-11-25 19:57:15 -08:00
Ari Lazier
1b37e0945f
make None the first enum type
2015-11-25 19:10:59 -08:00
Ari Lazier
96994a24cc
use current_group() helper
2015-11-25 18:34:36 -08:00
Ari Lazier
fbb1f42c6e
don't merge predicate to negated and group
2015-11-25 18:32:13 -08:00
Ari Lazier
6449d34735
more tests
2015-11-25 12:57:56 -08:00
Ari Lazier
3fba2f3a19
add a few more tests
2015-11-25 12:54:13 -08:00
Ari Lazier
d967a8a4e4
process compound operators in the correct order
2015-11-25 12:49:31 -08:00
Ari Lazier
2324f8cc9b
fix for mixed && and || queries
2015-11-24 11:18:03 -08:00
Ari Lazier
812930285e
compount parser tests
2015-11-24 10:39:42 -08:00
Ari Lazier
63ffaf7adb
fix for reload in example
2015-11-23 19:00:31 -08:00
Ari Lazier
2096f7aa00
latest from object store branch
2015-11-23 11:26:50 -08:00
Ari Lazier
e3b638edf3
pr fixes
2015-11-23 08:56:36 -08:00
Ari Lazier
9ea8ab25c5
pr feedback
2015-11-23 08:47:09 -08:00
Ari Lazier
49955a03e3
use cpp extension for pure cpp files
2015-11-20 19:32:35 -08:00
Ari Lazier
df7474feb3
run parser tests in RealmJSTests
2015-11-20 15:16:35 -08:00
Ari Lazier
40f0e5f274
move queryTests to parser dir
2015-11-20 14:51:04 -08:00
Ari Lazier
494fbd3a06
object tests
2015-11-20 14:14:35 -08:00
Ari Lazier
7b993d2f09
turn off parser analyze
2015-11-19 15:59:16 -08:00
Ari Lazier
22ca94e36e
test and bug fixes for data queries
2015-11-19 15:17:57 -08:00
Ari Lazier
0e8ca5ed05
add binary query support
2015-11-19 13:05:37 -08:00
Ari Lazier
aa3bad1a69
more string tests and bugfix
2015-11-19 13:05:37 -08:00
Ari Lazier
be93d3dd58
first string tests and custom error messages
2015-11-19 13:05:37 -08:00
Ari Lazier
20ac833e41
bool tests
2015-11-19 13:05:37 -08:00
Ari Lazier
5784bbe6ed
start porting over objc query tests
2015-11-19 13:05:37 -08:00
Ari Lazier
2cc88b5a26
fix for not predicate
2015-11-19 13:05:37 -08:00
Ari Lazier
3828417f32
compound tests
2015-11-19 13:05:37 -08:00
Ari Lazier
5dda5f4b6b
test not, remove requirement of padding
2015-11-19 13:05:37 -08:00
Ari Lazier
f402a45a40
change argument syntax to use $ instead of {}
2015-11-19 13:05:37 -08:00
Ari Lazier
5c56a5c87c
tests for all expressions/operators
2015-11-19 13:05:37 -08:00
Ari Lazier
735b49ff2a
fix and tests for arguments
2015-11-19 13:05:37 -08:00
Ari Lazier
676b86d194
more grammer tests
2015-11-19 13:05:37 -08:00
Ari Lazier
f46e92468c
add basic test harness for grammer validation
2015-11-19 13:05:37 -08:00
Ari Lazier
7829d21bd4
add macro to enable/disable debug token printing
2015-11-19 13:05:37 -08:00
Ari Lazier
9309bbfbf8
make precondition a macro
2015-11-19 13:05:37 -08:00
Ari Lazier
f3d7855c99
test and fix for date queries
2015-11-19 13:05:37 -08:00
Ari Lazier
3a198ec507
support query format strings
2015-11-19 13:05:37 -08:00
Ari Lazier
3b698400b7
support for querying boolean properties
2015-11-19 13:05:37 -08:00
Ari Lazier
bb16ffa7fe
add required padding around string operators, use pegtl_istring_t
2015-11-19 13:05:37 -08:00
Ari Lazier
e7e4b6715e
move query building to a separate file
2015-11-19 13:05:37 -08:00
Ari Lazier
2f1c26ad73
remove duplicate code, add argument expression type
2015-11-19 13:05:37 -08:00
Ari Lazier
c776290df8
code cleanup, bugfixes
2015-11-19 13:05:37 -08:00
Ari Lazier
d8c89c7098
support for truepredicate/falsepredicate, single quote strings - all tests now pass
2015-11-19 13:05:37 -08:00
Ari Lazier
c7c0698ad0
hook it up
2015-11-19 13:05:37 -08:00
Ari Lazier
11b27dbdbf
store negated predicates in parse tree
2015-11-19 13:05:37 -08:00
Ari Lazier
4b3417736f
support OR with proper precedence
2015-11-19 13:05:37 -08:00
Ari Lazier
5bdc6eba93
parse tree construction
2015-11-19 13:05:37 -08:00
Ari Lazier
2f287d046d
full grammar
2015-11-19 13:05:37 -08:00
Ari Lazier
ed4e59c8d0
compound predicates
2015-11-19 13:05:37 -08:00
Ari Lazier
6ea80c4ecd
beginnings of a parser
2015-11-19 13:05:37 -08:00
Ari Lazier
d1a579c922
size_t, no std::size_t
2015-11-19 07:07:33 -08:00
Ari Lazier
55851f6d99
fix for rpc constants and other pr feedback
2015-11-18 17:55:30 -08:00
Ari Lazier
a12b6caedb
fixes to list.cpp/hpp based on object store pr feedback - use lowercase strings for property names
2015-11-18 14:36:46 -08:00
Scott Kyle
7b115a934b
ArrayBufferView objects now fully supported
...
Previously we were not accounting for the byte offsets and misunderstood how the Uint8Array constructor worked. The tests now confirm everything works as expected with multiple different typed arrays and slices of the data.
2015-11-17 13:32:32 -08:00
Scott Kyle
616f78ea07
Add support for data properties in RPC layer
...
The data is base64 encoded before being sent via the RPC.
2015-11-17 13:32:31 -08:00
Scott Kyle
3bf84a1b6f
Update data properties to return ArrayBuffers
...
As a convenience, the setters will take typed Arrays (e.g. Uint8Array) since that is a common representation of data in JS (as they are "views" of ArrayBuffer objects).
The tests have been updated to reflect this new behavior.
2015-11-17 13:32:31 -08:00
Ari Lazier
159931e4ec
pr fixes
2015-11-16 17:36:28 -08:00
Ari Lazier
53911fefb6
block refresh until the last context has finished execution
2015-11-16 11:16:09 -08:00
Ari Lazier
df15c5f722
integrate latest object store changes
2015-11-13 18:20:40 -08:00
Ari Lazier
52da420496
integrate latest object store changes
2015-11-13 18:20:27 -08:00
Scott Kyle
5320df9a5f
Merge pull request #116 from realm/sk-realmjs-api
...
Create API that returns constructor JSObjectRef
2015-11-03 16:39:08 -08:00
Scott Kyle
83869e2193
Prevent memory leaks when adding listeners
...
Check if the callback has already been added to the set before protecting it. Vice versa for unprotecting it when removing the listener.
2015-11-03 02:43:29 -08:00
Scott Kyle
aff11983f3
Create API that returns constructor JSObjectRef
...
Resolves #98
2015-11-02 22:51:33 -08:00
Ari Lazier
196a0a15a4
allow setting nullable properties to undefined
2015-11-02 10:08:23 -08:00
Ari Lazier
2cff7e291f
create docs dir in binding
2015-10-28 14:45:31 -07:00
Ari Lazier
841f45a7b2
change the license before starting the beta
2015-10-27 14:15:21 -07:00
Ari Lazier
ec87281cc1
don't convert undefined to null in rpc requests
2015-10-27 12:13:57 -07:00
Ari Lazier
18d65471be
fix and tests for setting null properties
2015-10-27 12:13:57 -07:00
Ari Lazier
ac1cdfdc8b
support null for basic propety types
2015-10-27 12:13:57 -07:00
Ari Lazier
e3fb40f299
enable nullable propeties without a macro
2015-10-27 12:13:57 -07:00
Ari Lazier
fc631c3e6f
wont work until we have propery object store support
2015-10-27 12:13:57 -07:00
Ari Lazier
db67fe71ea
only ignore invalid property exceptions
2015-10-27 09:39:52 -07:00
Ari Lazier
9092f9ac5f
use typed exceptions
2015-10-27 09:39:52 -07:00
Scott Kyle
0511bade62
Non-existent object getters shouldn't throw exceptions
2015-10-27 09:39:52 -07:00
Ari Lazier
a1c4cd5702
pr fixes
2015-10-27 07:48:11 -07:00
Ari Lazier
6f41c3cf68
take notification name
2015-10-26 19:18:24 -07:00
Ari Lazier
6f57500972
change notification name to change
2015-10-26 16:19:12 -07:00
Ari Lazier
246ccc7bde
add other notification methods
2015-10-26 16:15:46 -07:00
Ari Lazier
ab1965c27e
no more notification token
2015-10-26 16:03:32 -07:00
Ari Lazier
b7d47ac543
apply newest object store changes
2015-10-26 15:27:43 -07:00
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
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