Commit Graph

542 Commits

Author SHA1 Message Date
Ben Kalman 129b07818a Noms JS version 65.5.0 (#3011) 2017-01-04 14:18:40 +11:00
Ben Kalman be2e714545 Implement @at in JS paths (#3010) 2017-01-04 11:58:08 +11:00
Ben Kalman 9b149516ef Implement JS Map and Set at() (#3009) 2017-01-04 11:31:09 +11:00
Ben Kalman f83e5b5b9c Refactor JS path code and implement @type (#3003)
This brings it much closer to the Go implementation, and eventually
implementing the @at annotation.
2017-01-04 09:32:07 +11:00
Rafael Weinstein e0d8445ccd Js sequence refactor (#2998)
Removes IndexedSequence and OrderedSequence. What remain are MetaSequence and each of the leaf sequences which directly inherit from Sequence.
2017-01-03 14:03:17 -08:00
Erik Arvidsson ed1e386e24 JS: Make equals and compare exit early if === (#2951) 2016-12-22 13:38:57 -08:00
Rafael Weinstein 206eb6a38d Remove import of isPrimitiveKind 2016-12-20 17:04:56 -08:00
Rafael Weinstein cb3390924f Remove unnecessary invariants (#2966)
Remove unnecessary invariants
2016-12-20 15:52:26 -08:00
Erik Arvidsson 80d4894fcc JS: Fix walk
The promise was resolving too early.
2016-12-09 18:51:49 -08:00
Aaron Boodman fe59ae9504 Revert "Fix JS walk handling for values of type Type (#2913)" (#2931)
This reverts commit 2717908d2b.
2016-12-09 17:43:26 -08:00
Rafael Weinstein 88691863f4 Add simple read ahead for JS Collections (#2930)
Adds the ability for SequenceCursors to eagerly load all child sequences when the first child is requested.

The effect is for uses where noms tends to forward scan, it will read in batches of ~150 chunks (e.g. ~512k) rather than one chunk at a time.

On my MBP, this improves the raw blob read perf over http from ~60K/s to ~5MB/s.
2016-12-09 16:08:38 -08:00
Erik Arvidsson 741563958d Remove again and again 2016-12-09 12:46:54 -08:00
Erik Arvidsson 27267581d5 Again and again (#2929) 2016-12-09 12:16:05 -08:00
Erik Arvidsson a59463e277 Remove testing again 2016-12-09 12:07:47 -08:00
Erik Arvidsson e438145f14 Testing again (#2928) 2016-12-09 11:52:46 -08:00
Erik Arvidsson 559393f0b3 Revert "testing" (#2927) 2016-12-09 11:28:03 -08:00
Erik Arvidsson c58a215415 testing (#2926) 2016-12-09 11:23:36 -08:00
Erik Arvidsson bde471f690 JS: Do not validate struct type when reading a chunk (#2923)
When we read a chunk and create structs we were validating that the
struct was of the type it claimed to be.

This now, no longer does that validation, which matches Go.
2016-12-09 10:38:10 -08:00
Aaron Boodman 7a2c4f4984 Turn off chunk validation in production mode (#2925) 2016-12-09 10:32:13 -08:00
Erik Arvidsson 2717908d2b Fix JS walk handling for values of type Type (#2913)
Fixes #2911
2016-12-08 16:38:10 -08:00
Rafael Weinstein a67bb9bf7b Minor rework of hash.Hash API (#2888)
Define the hash.Hash type to be a 20-byte array, rather than embed one. Hash API Changes: `hash.FromSlice` -> `hash.New`, `hash.FromData` -> `hash.Of`
2016-12-02 12:11:00 -08:00
Erik Arvidsson 3a963602d2 Update Noms JS SDK to use Flow 0.35 (#2890) 2016-12-01 17:52:30 -08:00
Erik Arvidsson 4a44200d3e Lock down Flow version (#2844)
This is to prevent errors in the future when the code and flow version
do not match.
2016-11-22 18:48:17 -08:00
Erik Arvidsson 5e901b0924 Cache OIDs as we descend (#2840)
Remove validation/normalization of union order and struct field order as we decode a chunk into a type.

Instead the validation happens in ValidatingBatchSink.

We still normalize the union order when a struct type is created directly (not from a chunk) using  makeStructType.

The motivation for this change is that computing the OID (order ID) is expensive and it used to be a O(n^2) since we kept recomputing it as we traversed the type hierarchy.

Towards #2836
2016-11-21 15:18:02 -08:00
Ben Kalman 0ee6d105bb Export HttpError and SpecOptions to Noms JS API (#2819)
I renamed HTTPError to HttpError for consistency with HttpBatchStore
(and XMLHttpRequest).
2016-11-10 15:46:21 -08:00
Erik Arvidsson db4aedaeaf Use the latest version of documentation.js (#2805)
To pick up links into github for methods
2016-11-10 13:00:49 -08:00
Ben Kalman 172b991ac1 Port new Spec API to Go from JS (#2807)
This is a side-by-side port, taking inspiration from the old dataspec.go
code. Notably:

- LDB support has been added in Go. It wasn't needed in JS.
- There is an Href() method on Spec now.
- Go now handles IPV6.
- Go no longer treats access_token specially.
- Go now has Pin.
- I found some issues in the JS while doing this, I'll fix later.

I've also updated the config code to use the new API so that basically
all the Go samples use the code, even if they don't really change.
2016-11-08 14:18:47 -08:00
Erik Arvidsson 1775c3805a Update to Flow 0.34 (#2803) 2016-11-07 08:32:24 -08:00
cmasone-attic 12ddb66fc5 Clobber ValueStore cache entry on WriteValue (#2804)
ValueStore caches Values that are read out of it, but it doesn't
do the same for Values that are written. This is because we expect
that reading Values shortly after writing them is an uncommon usage
pattern, and because the Chunks that make up novel Values are
generally efficiently retrievable from the BatchStore that backs
a ValueStore. The problem discovered in issue #2802 is that ValueStore
caches non-existence as well as existence of read Values. So, reading
a Value that doesn't exist in the DB would result in the ValueStore
permanently returning nil for that Value -- even if you then go and
write it to the DB.

This patch drops the cache entry for a Value whenever it's written.

Fixes #2802
2016-11-04 15:53:26 -07:00
Ben Kalman 50c48be4b8 Noms, demo-server, and photos UI changes to support auth (#2793)
The big change here is adding a new Spec class in spec.js. This replaces
DatabaseSpec/DatasetSpec/PathSpec in specs.js, but I'm leaving those in
and moving code over in a later patch. For now, only photos UI.

The photos UI change is to plumb through the authorization token through
the Spec code. For now, it's reading it from a URL parameter, but soon
I'll make it session based (probably localStorage).

The demo-server change is to add the Authorization header into CORS.
2016-11-02 11:57:07 -07:00
Erik Arvidsson 9a3a119e60 Update build scripts to use the installed node (#2781) 2016-10-28 18:01:07 -07:00
Erik Arvidsson 2bd617ade8 Add delete field to structs (#2779) 2016-10-28 15:22:37 -07:00
Erik Arvidsson 7983e61afc Use babel-preset-noms (#2780) 2016-10-28 15:04:20 -07:00
Erik Arvidsson 0029b81ab4 Fix babel-preset-noms (#2776)
It wasn't working on the code coverage tests. Now I restored this
to what it was before these changes (minus removing some features
that chrome and node now supports out of the box)
2016-10-28 12:10:00 -07:00
Erik Arvidsson 529d796ad4 Fix syntax error in package.json (#2774) 2016-10-27 16:27:31 -07:00
Erik Arvidsson 7be17c5dfd Add a babel-preset-react module (#2770)
This simplifies dependency handling
2016-10-27 16:24:03 -07:00
Dan Willhite 8bd980553b Make pin return unchanged spec if it's already pinned (#2769) 2016-10-27 15:17:53 -07:00
Erik Arvidsson 8320cb6d28 Use the eslint-config-noms instead (#2767) 2016-10-27 13:28:26 -07:00
Erik Arvidsson b9db5d1bc2 Make our eslint setup less hacky (#2766)
Rename the package to eslint-config-noms as documented on the eslint
site.

This allows other npm modules to use and `extends: 'noms'` in their
eslint rc file.
2016-10-27 11:51:55 -07:00
Erik Arvidsson 3be4130a03 Export BatchStoreAdaptor (#2760) 2016-10-26 14:58:51 -07:00
Erik Arvidsson c15a2bb770 Use a newer version of @attic/eslintrc (#2758) 2016-10-25 16:58:02 -07:00
Erik Arvidsson 17d1587b34 Disable more eslint rules (#2756) 2016-10-25 16:14:40 -07:00
Erik Arvidsson 68581f6f1c Disable space-after-type-colon eslint rule (#2755) 2016-10-25 15:58:50 -07:00
Erik Arvidsson 7ae91491a6 Update version of eslintrc (#2754)
This is so that we can have the clients depend on the fix.
2016-10-25 15:47:19 -07:00
Ben Kalman 107c3fe9c0 Update eslint to 3.8.1, noms was broken at 3.8.1 (#2751)
Also remove roll.py (not used anymore, we use file path) and make it
pinned to a specific version (so that this doesn't happen again.
2016-10-24 17:31:59 -07:00
cmasone-attic d8f172df09 Remove commit de-duping (#2749)
Now that we're going to put in real commit-merge logic, we
can take out the very-old hack that deduplicated identical
commits.

Fixes #2720
2016-10-24 10:12:16 -07:00
Ben Kalman 007ba18987 Use the same cursor when initializing and finalizing the chunker (#2729)
Previously we would clone them from the original cursor, to (a) not
modify the original cursor, and (b) have initialization and finalization
not interfere with each other.

However, this isn't necessary and it just creates unnecessary churn. For
example, when we read-ahead, it would be wasteful to re-read the
read-head chunks from initialization.
2016-10-20 16:04:03 -07:00
Erik Arvidsson e164f8aeec Flow header after copyright (#2734)
This puts the flow header after the copyright header.

It also:
 * fixes the existing files to have valid headers
 * Makes sure the script can handle doctype
2016-10-19 11:36:48 -07:00
Erik Arvidsson b05a857d99 Handle NaN and Infinity in number encoding (#2731)
We were hitting iloops for these non finite numbers
2016-10-18 16:49:35 -07:00
Erik Arvidsson 609b3d75ad Fix HTTPError class (#2726)
And also fix browser/fetch.js to match the node version.
2016-10-18 11:10:37 -07:00