Commit Graph

395 Commits

Author SHA1 Message Date
Rafael Weinstein
8a5f3853b7 Revert "Js type cache (#2011)"
This reverts commit 4e10ae63f4.
2016-07-11 18:36:17 -07:00
Rafael Weinstein
48ab930ed2 Revert "Ensure all bytes consumed on decode (#2019)"
This reverts commit cd45787a91.
2016-07-11 18:36:01 -07:00
Rafael Weinstein
cd45787a91 Ensure all bytes consumed on decode (#2019)
Ensure all bytes consumed on decode
2016-07-11 18:08:51 -07:00
Rafael Weinstein
94a27139c7 bump noms npm version & update codec-perf-rig numbers (#2016) 2016-07-11 16:54:12 -07:00
Rafael Weinstein
4e10ae63f4 Js type cache (#2011)
Js type cache
2016-07-11 16:45:35 -07:00
Mike Gray
b6f19dfea5 number encoding (#1845)
Moved to encoding Values of type Number as 2 varints.
2016-07-11 12:08:56 -07:00
Erik Arvidsson
c462f2520c Fix invalid JSON (#1993) 2016-07-08 13:17:31 -07:00
Ben Kalman
c7b67ab50a Noms JS version 49.1 --> 49.2 from last patch (#1990) 2016-07-08 10:39:47 -07:00
Ben Kalman
68e16f338e Fix noms browser fetch and splore layout (#1989) 2016-07-07 18:19:18 -07:00
Rafael Weinstein
ee5c0f3a72 MakeStructType and NewStructWithType now takes slices rather than maps (#1945)
NewStructType and NewStructWithType now takes slices rather than maps
2016-07-07 16:36:48 -07:00
Aaron Boodman
1d752e3101 Update license: Noms will be copyright Attic Labs. (#1976) 2016-07-05 22:07:42 -07:00
Erik Arvidsson
983fa59090 Samples js shared 2 (#1973)
* Revert "Revert "Share node_modules for samples/js" (#1967)"

This reverts commit 7bb1623e99.

* Add parent directory to the PATH

* Change run-all-js-tests to run samples/js before samples/js/**

* Fix a temporary comment
2016-07-05 16:25:21 -07:00
Erik Arvidsson
0a502c3ee4 Fix some js tests (#1932) 2016-06-29 15:57:53 -07:00
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