Commit Graph

164 Commits

Author SHA1 Message Date
Benjamin Kalman 31790e8f37 Bump JS to v56.2.0 to pick up img change 2016-08-04 14:47:39 -07:00
Adam Leventhal 117eafebbc add Blob.Splice() (#2242) 2016-08-02 16:58:41 -07:00
Erik Arvidsson 0d402acc9b Add README.md to js/ (#2211)
This is what gets shown on npmjs.org and other tools indexing npm
modules.
2016-07-30 13:11:42 -07:00
Adam Leventhal e920c12c1c Fix cyclic type nondeterminism (#2147) (#2148) 2016-07-29 21:35:17 -07:00
Rafael Weinstein 3d86ddb33a Fix IndexedSequenceDiff bug when entire subtree is added / removed (#2197)
IndexedSequenceDiff special cases the situation when an entire subtree was added or removed, but got its math wrong.
2016-07-29 13:22:39 -07:00
Erik Arvidsson ff88ff2a65 Commit type: Compute the type for meta too (#2185)
This changes to compute the type for the meta field in a similar
way to how we compute the type for the value field.

Fixes #2179
2016-07-28 17:14:35 -07:00
Erik Arvidsson 7a4436e9b5 Remove Type name property (#2161)
Only struct types have a name property and this was left over from
an earlier refactoring.
2016-07-26 15:31:43 -07:00
Rafael Weinstein b57377c1ed Chunk over value (non-type) serialization bytes (#2130)
Chunk over value (non-type) serialization bytes
2016-07-25 11:02:26 -07:00
Rafael Weinstein 717745f2fc Refactor sequence_chunker.Done() (#2076)
Go SequenceChunker Refactor
2016-07-21 14:51:32 -07:00
Erik Arvidsson d24dda5e0c JS: Compute commit type based on value and parents
We now compute the commit type based on the type of the value and
the type of the parents.

For the first commit we get:

```
struct Commit {
  parents: Set<Ref<Cycle<0>>>,
  value: T,
}
```

As long as we continue to commit values with type T that type stays
the same.

When we later commits a value of type U we get:

```
struct Commit {
  parents: Set<Ref<struct Commit {
    parents: Set<Ref<Cycle<0>>>,
    value: T | U
  }>>,
  value: U,
}
```

The new type gets combined as a union type for the value of the inner
commit struct.

Fixes #1495
2016-07-18 14:29:07 -07:00
Erik Arvidsson 1cfa818c07 JS: Fix isSubtype for unions with cycles (#2060)
This is the JS part of #2007

This exposed bugs in resolve/unresolve types and these were fixed
by making the code more similar to go.

Fixes #2015
2016-07-14 13:37:37 -07:00
Rafael Weinstein 890433e864 Reland js type cache (#2032)
Reland js type cache (#2032)
2016-07-13 15:23:23 -07:00
Erik Arvidsson f2a83346ca JS: Change hash function to sha512
For browser support we use npm amscrypto.js-sha512. For node we use its
builtin crypto module.
2016-07-12 13:59:09 -07:00
Rafael Weinstein 94a27139c7 bump noms npm version & update codec-perf-rig numbers (#2016) 2016-07-11 16:54:12 -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
Ben Kalman c7b67ab50a Noms JS version 49.1 --> 49.2 from last patch (#1990) 2016-07-08 10:39:47 -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
Ben Kalman 3d75150b2e Noms version 48.0.0 --> 49.0.0 (#1902) 2016-06-24 12:33:43 -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
Rafael Weinstein 62dcc6f377 Split node & browser Uint8Array usage (#1811)
Split node & browser Uint8Array usage
2016-06-14 12:28:28 -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
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 abbd0cfb1e JS: Make Structs use arrays (#1743)
...instead of objects as maps.

Fixes #1715
2016-06-07 15:59:27 -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 1b6ef9ceee Rename Parent<> to Cycle<> (#1718) 2016-06-03 10:31:27 -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
Rafael Weinstein 143d570960 Binary encoding (#1679)
Noms format is now binary encoded.
2016-05-31 16:13:51 -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
Erik Arvidsson f52a062f81 Increment version (#1664) 2016-05-27 11:24:16 -07:00
Ben Kalman 5792f901c6 Use native browser fetch if available (#1655) 2016-05-27 10:40:20 -07:00
Erik Arvidsson d2880c5d2a Export escapeStructField (#1654) 2016-05-26 17:01:54 -07:00
Dan Willhite e271576f06 Forward all query parameters when calling remote server api. 2016-05-25 17:34:49 -07:00
Erik Arvidsson 998b7a9df0 Update flow to 0.25 (#1619) 2016-05-25 10:30:17 -07:00
Dan Willhite 0a2dd97d4a Enable database authorization on JS dataspecs.
Accomplished by forwarding query params specified on database spec to
remote server api.
Fixes #1595
2016-05-24 17:47:46 -07:00
Aaron Boodman 68b1b88a69 js/json-convert: encode field names (#1620) 2016-05-24 16:47:22 -07:00
Mike Gray 61848137ad increasing the mocha timeout so travis builds fail less (#1622) 2016-05-24 14:49:31 -07:00
Aaron Boodman 43d991495c noms/js: export isSubtype (#1617) 2016-05-24 11:55:19 -07:00
Ben Kalman e34551cd54 Standardise database/dataset accessors as database() and dataset() (#1607)
In JS they are either set() or store(). In Go they are either Dataset()
Store(), or Database().
2016-05-24 10:25:16 -07:00
Erik Arvidsson a84ecf41eb Fix code review issues 2016-05-23 16:51:45 -07:00
Aaron Boodman 77de0b0e54 Introduce js/json-convert.js (#1601) 2016-05-23 15:07:35 -07:00
Ben Kalman 56c7f44aa9 Make JS walk() return value mean "skip" not "recurse" (#1604)
This is consistent with Go Walk(), and it's arguably less surprising
than returning undefined implies false.
2016-05-23 14:32:45 -07:00