Commit Graph

382 Commits

Author SHA1 Message Date
Erik Arvidsson 3a1cf20bec JS: Make fetch response headers a Map again (#1898)
Since we are using browser fetch when available it makes more sense
to use a Map.
2016-06-24 16:46:46 -07:00
Ben Kalman 3d75150b2e Noms version 48.0.0 --> 49.0.0 (#1902) 2016-06-24 12:33:43 -07:00
Erik Arvidsson ead78cb2fb JS: No need for a class for bytes.js (#1897) 2016-06-24 10:51:36 +08:00
Ben Kalman 0f4ed16641 Meta nodes encode a fake simple ref of non-ordered values (#1893)
Previously when we had an ordered (set/map) prolly tree containing
non-ordered values (blobs/refs/etc), we'd put the ref of the largest
value in each meta node, complete with its full type info and height.

This is wasteful, all we really need is the hash of the largest item for
searching the tree. In lieu of encoding just the hash - which isn't a
value - this patch creates a fake Ref<Boolean> with height 0.
2016-06-23 15:59:26 -07:00
Ben Kalman e7da64ad98 Add tests for sets and maps of 1K and 4K structs (#1866)
In Go: there are already similar tests for numbers, but testing structs
hits the non-scalar value prolly tree code.

In JS: the set and map tests hadn't even been ported from Go, so I
ported most of their functionality.
2016-06-23 14:00:03 -07:00
Ben Kalman 93b5dcb550 Add struct diffing to ordered_sequences_diff_test.go (#1877) 2016-06-23 10:10:38 -07:00
Erik Arvidsson ebd9a88d23 JS: Fix http batch store (#1885)
There were a few issues here:

1. The version header was not always passed to fetch
2. HTTP headers are case insensitive and Node an Fetch uses lower case.
3. The old code used a Map instead of an object as map. Node and Fetch
   uses an object as map. Now we just pass along the response headers.

Fixes #1881
Closes #1880 (which this is partially based in)
2016-06-23 17:41:56 +08:00
Erik Arvidsson e3b52ba2c6 Increment JS SDK version (#1879) 2016-06-23 13:42:35 +08:00
Ben Kalman c45530ef33 Remove advanceTo, not used (anymore?) (#1875) 2016-06-22 17:30:17 -07:00
cmasone-attic 4d5eb3b334 Version Noms SDK and storage (#1841)
ChunkStores provide a Version() method so that anyone directly
using a ChunkStore (e.g. BatchStoreAdaptor) can retrieve and
check the version of the underlying store.

remoteDatabaseServer checks the version of the ChunkStore it's
backed by at startup, and then provides that version as an HTTP
header to all clients. In Go, httpBatchStore checks this header
anytime it gets a response from the server and bails if there's
version skew.

In Go, the responsibility for checking whether the running code and
the data being accessed lies with the BatchStore layer. In JS, there
is code in fetch.js that checks the header mentioned above.

Towards #1561
2016-06-21 20:55:07 -07:00
Mike Gray 9b8d80852c removing unneeded eslint disable (#1862) 2016-06-21 14:21:40 -07:00
Ben Kalman 1b9ea570ae Fix sequence chunker bug triggered by repeatedly removing last element (#1844)
Fix sequence chunker bug triggered by repeatedly removing last element

The bug is we sometimes create a prollytree with a root meta sequence
node with only a single item. This is never the canonical representation
of prollytrees.

I reworked the sequence chunker to take a different approach to corner
cases. Instead of being smart and avoiding this case (which clearly
didn't work properly), it's more liberal with creating unnecessary
nodes, then it fixes them up in the finalisation step.
2016-06-20 18:35:46 -07:00
Rafael Weinstein e8686c29f7 Remove Set.intersect (#1852)
Remove Set.intersect
2016-06-20 10:22:46 -07:00
Dan Willhite a3a78d695d Add HeadValue() and MaybeHeadValue() to dataset.go and js equivalents
Fixes #1801.
2016-06-15 11:16:25 -07:00
Mike Gray d637458041 limit the size of the edit distance matrix - js (#1812) 2016-06-14 18:01:55 -04:00
Rafael Weinstein 62dcc6f377 Split node & browser Uint8Array usage (#1811)
Split node & browser Uint8Array usage
2016-06-14 12:28:28 -07:00
Mike Gray 166a83979b limit the size of the edit distance matrix (#1739) 2016-06-13 17:18:35 -04:00
Rafael Weinstein 79a446d7b5 MemoryStore doesn't use put-cache (#1798)
MemoryStore doesn't use put-cache
2016-06-13 14:00:23 -07:00
Rafael Weinstein 8eda6fcea6 Revert "JS: Split BinaryNomsWriter into Node+Browser (#1773)" (#1781)
This reverts commit 5cb7a5db28.
2016-06-10 10:54:03 -07:00
Mike Gray f94b91a5d2 sequences return a compare func used for diffs (#1771) 2016-06-09 23:17:14 -04:00
Erik Arvidsson 5cb7a5db28 JS: Split BinaryNomsWriter into Node+Browser (#1773)
This is because on Node we can write UTF8 directly to a buffer
2016-06-09 17:21:11 -07:00
Rafael Weinstein dc137a337d export newStructWithType (#1766) 2016-06-08 18:52:49 -07:00
Erik Arvidsson 99f757f823 Align js api (#1756)
* JS: remove -> delete

* JS: Set insert -> add

* JS: List remove(start, end) -> remove(idx)

* JS: Increment to 46

Fixes #1750
Fixes #1751
Fixes #1752
2016-06-08 15:20:52 -07:00
Erik Arvidsson 5571e0bc6f Add commas to HRS of struct type (#1759)
This makes the struct more consistent with the rest.
2016-06-08 14:54:47 -07:00
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 abbd0cfb1e JS: Make Structs use arrays (#1743)
...instead of objects as maps.

Fixes #1715
2016-06-07 15:59:27 -07:00
Dan Willhite f371a235d5 Change dataspec syntax to use '::' in path specs. 2016-06-07 15:01:26 -07:00
Erik Arvidsson 4af0ca1efb Fix issue with in browser Hash (#1738)
Also, make Hash not copy the bytes.
2016-06-06 17:11:34 -07:00
Erik Arvidsson e4b7d13416 Add license field to all the package.json file (#1742)
Issue #1307
2016-06-06 16:56:10 -07:00
Erik Arvidsson 1e84c47082 JS: Make Hash store the digest internally (#1704)
Now that we are using a binary serialization it makes more sense to
have Hash work with the digest and only compute the sha1 string when
needed.

Fixes #1685
2016-06-03 16:34:35 -07:00
Erik Arvidsson f20c6465b6 Flow comment first (#1724) 2016-06-03 14:35:21 -07:00
Erik Arvidsson 1b6ef9ceee Rename Parent<> to Cycle<> (#1718) 2016-06-03 10:31:27 -07:00
Rafael Weinstein b442b3b716 Align go & js meta tuple ctors (#1717) 2016-06-02 17:57:21 -07:00
Erik Arvidsson d6537c74c5 Update clients to use latest eslint (#1699)
And fix new errors that were found.

This also adds tools/run-all-js-tests.py which runs `npm install`
and `npm test` in all directories containing a package.json file.
2016-06-02 09:41:32 -07:00
Erik Arvidsson e1fb5ebd90 Sort field names when created (#1695)
This also skips the sorting of the field names when the StructDesc
is created by the decoder.

Fixes #1687
2016-06-01 16:26:06 -07:00
Rafael Weinstein 3429d10b70 cache hash after encode (#1686) 2016-05-31 17:21:55 -07:00
Rafael Weinstein 141b5678a0 Post-binaryEnc cleanup (#1684)
Post-binaryEnc cleanup
2016-05-31 16:58:09 -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
Ben Kalman b79f5b0a04 Implement JS BlobReader.seek (#1673) 2016-05-27 18:39:59 -07:00
Erik Arvidsson dbd4c572df Add ListBuilder (#1669)
A ListBuilder allows creating large lists efficiently
2016-05-27 14:49:22 -07:00
Aaron Boodman db9bb15786 Remove es6 support from js sdk (#1668)
We're not using it, and it just makes compiles slower
2016-05-27 14:08:48 -07:00
Aaron Boodman 18838b7c2a js sdk: expose type.describe() for convenience (#1667) 2016-05-27 14:08:34 -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 f52a062f81 Increment version (#1664) 2016-05-27 11:24:16 -07:00
Erik Arvidsson 7f034dfa9e Fix style error after #1657 (#1663) 2016-05-27 11:22:38 -07:00
Aaron Boodman 85d81f5268 Fix perf bug in js commit path (#1657) 2016-05-27 11:19:58 -07:00
Ben Kalman 5792f901c6 Use native browser fetch if available (#1655) 2016-05-27 10:40:20 -07:00