Commit Graph

55 Commits

Author SHA1 Message Date
Erik Arvidsson bc896efcc5 Add tests for type after mutations (#1753)
Also, remove invariant for set intersection. We can handle different
types now.

Fixes #1749
2016-06-08 11:39:12 -07:00
Erik Arvidsson f20c6465b6 Flow comment first (#1724) 2016-06-03 14:35:21 -07:00
Rafael Weinstein 143d570960 Binary encoding (#1679)
Noms format is now binary encoded.
2016-05-31 16:13:51 -07:00
Erik Arvidsson 85af172382 Make BlobWriter and ListWriter optionally write eagerly (#1672)
If a ValueReadWriter is passed to the BlobWriter/ListWriter we
write the value as soon as possible
2016-05-31 14:20:36 -07:00
Rafael Weinstein d3a3b72caa Insert sequential (#1675)
Insert sequential correctly into prolly tree
2016-05-31 13:10:45 -07:00
Aaron Boodman e5f288b752 Licensify js/ 2016-05-30 14:32:28 -07:00
cmasone-attic 8eb6167976 JS: Fix collection forEach (#1666)
In JS, the forEach() method didn't correctly handle async
callbacks for processing collection items. Now, if the
callback returns a Promise, it'll be properly waited for.
2016-05-27 13:17:31 -07:00
Erik Arvidsson d1bfa30108 JS: Cleanup newTFromSequence (#1630) 2016-05-25 09:37:48 -07:00
Erik Arvidsson 3ae55e01ec JS: Rename RefValue to Ref 2016-05-20 19:18:32 -07:00
Erik Arvidsson 7d8eea4a07 JS: Rename Ref to Hash 2016-05-20 19:18:32 -07:00
Ben Kalman 01a50e9541 Change the async "newList" and friends to sync "new List" constructors (#1554)
Friends: List, Set, Map, Blob, and Commit. This lets us remove a lot of
Promise and async/await bloat.
2016-05-20 15:01:55 -07:00
Chris Masone 917a4d8564 JS: make sure we call close() on Database most of the time
Other than DatasetSpec::value(), this should close all Database
instances that we create. I'm not sure how to deal with that one
case, though.
2016-05-19 16:49:54 -07:00
Erik Arvidsson d67d1fb924 Make Map use Array<[K, V]> instead of Array<K | V> (#1538) 2016-05-18 15:16:08 -07:00
Erik Arvidsson 643c12172b Noms data structure names (#1525)
* Change to default exports

* Rename NomsX to X in (Blob, List, Map, Set)

* Increment version
2016-05-18 09:26:36 -07:00
Erik Arvidsson df1c91843d JS: No need to compute the union type in decode (#1523)
* JS: No need to compute the union type in decode

Instead trust that the serialization is correct

Towards #1491
2016-05-17 15:39:18 -07:00
Erik Arvidsson 5db7fe8285 JS: Update the collection/struct API to compute the type. (#1502)
When you create or modify a data structure we now compute the type
based on the type of the values in the data structure.

Towards #1491
2016-05-16 10:58:50 -07:00
Erik Arvidsson 58464baef9 Total ordering of values (#1475)
This allows having a set/map of heterogenous elements/keys. To support
this we have to be able to have a total ordering for all noms values.

The ordering is false < true < -999 < 0 < 999 < "" < "a" < "z" < Hash
In other words, Bool < Number < String < * and for comparing non
primitives we compare the hash of the object.

Fixes #1104
Fixes #1312
2016-05-12 10:35:56 -07:00
Rafael Weinstein 1c90201f49 Make JS Sequence not be values (#1470) 2016-05-10 14:19:39 -07:00
Erik Arvidsson 014e330315 Rename DataStore to Database (#1448) 2016-05-06 17:37:19 -07:00
Erik Arvidsson c8ce81d6ba Serialize meta tuple with ref value (#1443)
When we serialize a meta tuple we should serialize it with the Ref value (which includes the type). This is because in the future the sub tree might be of a different type than the current tree.

Towards #1312
2016-05-06 13:25:23 -07:00
Ben Kalman e7219f3603 Add height to every RefValue (#1415)
This is to support efficient chunk diff. Most of the churn in this patch
comes from updating test expectations, and updating every Ref construction
to include a height and every MetaTuple to include a Ref.
2016-05-05 10:11:05 -07:00
Erik Arvidsson 963fbdaad6 Write type with value (#1406)
Write type for all values

Fixes #1308
2016-05-03 16:52:22 -07:00
Chris Masone aa0b0fd658 JS: Maintain validation cache on DataStore across Commit
While this causes the cache to potentially grow infinitely, having a
DataStore keep track of every value it's read or written makes it
simpler to program with. Once RefValues can only come to be by being
read out of a DataStore, we can do away with this altogether.

The big changes here are that DataStore now has a ValueStore, instead
if extending ValueStore. The DataStore constructor now takes a
ValueStore, so that new instances re-use the same ValueStore can be
constructed on Commit. Since callers don't care about that detail,
this change exports NewDataStore(), which still takes a BatchStore.
2016-05-03 13:11:01 -07:00
Erik Arvidsson 3032c76a39 Use a map for the struct fields
Fixes #1368
2016-05-02 15:35:27 -07:00
Ben Kalman 8cc0c35829 Change MetaTuple to work with RefValue, not Ref (#1372)
Change MetaTuple to work with RefValue, not Ref
2016-05-02 11:17:18 -07:00
Chris Masone f26a94584c JS: Implement new DataStore client protocol
This replaces the HTTP ChunkStore implementation with an implementation of
our new DataStore client protocol. It migrates much of the batching logic
from RemoteStore into the new BatchStore, which is analogous to a class we
have on the Go side, but continues to use a Delegate to handle all the HTTP
work.

This patch also introduces ValueStore, which handles validating Values as
they're written. Instead of handling Value reading and writing itself,
DataStore now extends ValueStore.

Towards #1280
2016-05-02 09:52:36 -07:00
Chris Masone 8eba180782 Revert "renaming datastore to database (#1374) - fixes bug #1290"
This reverts commit d77902b323.
2016-05-02 09:01:44 -07:00
Mike Gray d77902b323 renaming datastore to database (#1374) - fixes bug #1290
* datastore -> database
* fixing bug 1290, renaming datastore to database
2016-05-01 22:02:16 -04:00
Erik Arvidsson cfc51e2e9d Remove optional fields (#1354)
Remove optional fields

Fixes #1310
2016-04-28 17:12:15 -07:00
Erik Arvidsson fa742aecb1 Remove unions from structs (#1345)
Fixes #1344
2016-04-28 11:13:59 -07:00
Erik Arvidsson 3ff6ee6add Inline struct type declaration into chunk (#1324)
Struct type definition is now inlined into the chunk. To break
cycles we use back references.

- Removes unresolved type refs
- Removes packages

Fixes #1164
Fixes #1165
2016-04-27 20:39:51 -07:00
Erik Arvidsson 6779a60a39 Merge branch 'floating' of https://github.com/mikegray/noms into mikegray-floating 2016-04-27 15:18:10 -07:00
Ben Kalman 24855b32c0 JS: make Sequence subclasses implement chunks getter (#1330) 2016-04-27 13:50:16 -07:00
Mike Gray 47794ca754 Removing [U]Int[8|16|32|64] and Float[32|64] in favor of Number 2016-04-27 16:24:13 -04:00
Rafael Weinstein ae333d925b Mark long tests in js. Add npm run ts command 2016-04-27 09:44:05 -07:00
Mike Gray e2f762bc60 verify unique keys during map construction 2016-04-27 09:40:27 -04:00
Erik Arvidsson 5896559db7 Remove support for enums (#1291) 2016-04-22 10:14:05 -07:00
Ben Kalman 9b667cc6ba Implement efficient set/map size/length (#1277)
The Go Len implementation just iterated over all values and incremented
a counter. Now it can just read it off the meta sequence.

The JS implementation never supported size because it would have been
async in order to implement even the Go style implementation.

Mostly addresses #764 (efficient; but could be more efficient).
2016-04-19 17:04:33 -07:00
Ben Kalman 66e60150f1 Lower random map diff test size even more, to 50 (#1225) 2016-04-12 17:00:31 -07:00
Ben Kalman 7c253e272e Lower random map diff test size (#1221) 2016-04-12 15:59:28 -07:00
Ben Kalman 3cdf75d6d0 Implement Set/Map diff (#1139) 2016-04-12 14:58:39 -07:00
Rafael Weinstein 1676707906 WriteValue returns RefBase 2016-04-11 17:09:25 -07:00
Erik Arvidsson bfc7a5d88e JS: Remove makePrimitiveType (#1206)
type.js no longer exports makePrimitiveType. It is recommended to use
the type constants directly. There are a few cases where we had a
NomsKind and needed a Type. For those cases there is now a
getPrimitiveType but it is not exported by noms.

Fixes #1168
2016-04-11 15:00:39 -07:00
Erik Arvidsson 72fe7d2860 JS: Reduce map size in test (#1207)
BuildMap keeps timing out. This changes the size from 5k to 1k.

Fixes #1142
2016-04-11 14:27:25 -07:00
Erik Arvidsson 8385227847 Add type validation
* Add type validation

This is not yet hooked up to the different APIs

Towards #1078
2016-04-05 13:56:00 -07:00
Ben Kalman f27f9b36bb Remove async-test.js
Its 'instanceof Promise' check was broken because of a babel Promise

polyfill; but mocha supports async style tests natively now anyway.
2016-04-01 18:01:34 -07:00
Erik Arvidsson 56be90796e JS: chunks should use typed RefValue
Fixes #1112
2016-03-28 10:59:48 -07:00
Erik Arvidsson 7910ad31cf JS: Make chunks an array of RefValue
Towards #1112
2016-03-28 10:18:35 -07:00
Rafael Weinstein 38292e29c6 RefValue 2016-03-22 16:43:13 -07:00
Erik Arvidsson 98637b1f6d JS: Update to remove type param when not needed 2016-03-22 11:14:32 -07:00