Commit Graph

560 Commits

Author SHA1 Message Date
Rafael Weinstein 86e812a5db (JS) Don't preload iterators (#3078)
dont preload iterators
2017-01-17 13:49:22 -08:00
Erik Arvidsson 2dfb4040b7 Update to Flow 0.36 (#3079) 2017-01-17 11:56:20 -08:00
Rafael Weinstein 759c36c96f Walk avoids blobs (#3074) 2017-01-13 16:32:40 -08:00
Rafael Weinstein 760e7f9945 (JS) Implement parallel walk io (#3070)
(JS) Implement parallel walk io
2017-01-12 15:57:02 -08:00
Erik Arvidsson 554d4da885 Upgrade to use latest webpack-config (#3066) 2017-01-11 18:47:22 -08:00
Erik Arvidsson 15f188ac2c webpack-config: Pick up noms version next (#3065)
Make sure we replace process.env.NOMS_VERSION_NEXT for webpack builds
2017-01-11 17:58:23 -08:00
Erik Arvidsson 2f6f760658 Work around environment variable issue. (#3061)
We are using babel-plugin-transform-inline-environment-variables which
replaces `process.env.FOO` with the value of the `FOO` environment
variable at compile time.

However, due to our pipeline we end with something like:

```js
var NAME = 'NOMS_VERSION_NEXT';
process.env[NAME]
```

which does not get replaced in development mode. If it was a const the
transformer could replace it but var bindings can change.
2017-01-11 15:08:04 -08:00
Aaron Boodman c885ace18f Bump js package again. (#3056)
I had already used 66 in a previous commit that was reverted.
2017-01-10 18:09:50 -08:00
Aaron Boodman 377e730bd2 Bump js package version because of noms format change. (#3055) 2017-01-10 15:53:22 -08:00
Rafael Weinstein 01303a828d go read ahead (#3046) 2017-01-10 15:28:26 -08:00
Aaron Boodman c5805766f5 Enable v8 by default (#3045) 2017-01-10 14:43:55 -08:00
Aaron Boodman a09ef6fb44 Revert "Introduce noms version 8. Use it to guard type simplification." (#3043) 2017-01-09 16:30:25 -08:00
Aaron Boodman a4ffa5ba9b Introduce noms version 8. Use it to guard type simplification. (#3035)
Introduce noms version 8. Use it to guard type simplification.
2017-01-06 17:32:32 -08:00
Ben Kalman 528355c9be Write sequence read-ahead cache to correct index (#3025) 2017-01-06 09:52:47 +11:00
Erik Arvidsson 1e0a698781 Type accretion for struct fields should use equal (#3029)
We used to use isSubtype but we should just create a more specific type
when we can.

Fixes #2993
2017-01-05 13:57:42 -08:00
Aaron Boodman 5617c15489 Add support for IsSubtype(T, A|B|...) (#3024) 2017-01-04 21:55:36 -08:00
cmasone-attic cf452aab07 JS: ValueStore writes chunks only when referenced (#3021)
The old strategy for writing values was to recursively encode them,
putting the resulting chunks into a BatchStore from the bottom up as
they were generated.

The new strategy tries to keep chunks from the same 'level' of a
graph together by caching chunks as they're encoded and only writing
them once they're referenced by some other value. When a collection
is written, the graph representing it is encoded recursively, and
chunks are generated bottom-up. The new strategy should, in practice,
mean that the children of a given parent node in this graph will be
cached until that parent gets written, and then they'll get written
all at once.
2017-01-04 15:05:46 -08:00
Rafael Weinstein e025471eab Remember hints for written chunks (#3017)
Prior to this patch, ValueStore only kept a record of where referenced Refs originally reside in from chunks read from the server. This ignored the case of a client doing subsequent commits with the same ValueStore (for example, writing multiple states of a map). This was resulting in the server being forced to load a ton of chunks to validate.
2017-01-04 13:58:44 -08:00
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