Commit Graph

516 Commits

Author SHA1 Message Date
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
cmasone-attic ca9a4caf7f Bump patch-level NPM module version (#2725)
I forgot to do this when fixing issue #2699
2016-10-17 14:27:58 -07:00
cmasone-attic 078e9e6f4e Correctly handle HTTP conflict status on updateRoot (#2721)
The code in fetch.js and http_batch_store.js weren't really
agreeing on how HTTP failures were reported up the stack. Now,
they agree, and this allows HttpBatchStore.updateRoot() to
correctly detect a conflict response and return false.

This means that the merge logic in Database.commit() works right,
now.

Fixes #2699
2016-10-17 11:53:58 -07:00
Erik Arvidsson 5619d2b3ac Update Flow to 0.33 (#2692) 2016-10-12 14:17:49 -07:00
Erik Arvidsson 7783fc5f44 Update style issues found by newer eslint (#2685) 2016-10-10 10:56:02 -07:00
Erik Arvidsson f84b1a4c5b Update @attic/eslint (#2683)
To better check flow syntax
2016-10-07 16:39:44 -07:00
Erik Arvidsson 239b02cfd5 Allow struct set to cause a type change (#2542)
This allows setting a field in a struct to a new type or to set a
non-existig field in a struct.

In JS this is done through the StructMirror.p.set and in Go this is
done through Struct Set.

Fixes #2181
2016-10-07 12:38:29 -07:00
Aaron Boodman 53d5b59017 Track run date and input paths for fb and flickr importers (#2673)
Track run date and input paths for fb and flickr importers
2016-10-06 18:52:30 -07:00
Erik Arvidsson 71b9fd9337 JS: Change FlowIssue style comment (#2678)
This is a work around to make code using React Native work.
2016-10-06 15:45:51 -07:00
Erik Arvidsson a88ac5822c JS: Add CommitOptions to commit method (#2677)
This allows setting the meta field when you commit.

This is a version change because the signature of Database commit
changed in a non backwards compatible way. It now takes an optional
third options object instead of an optional array.
2016-10-06 13:14:41 -07:00
Erik Arvidsson 74ca059568 Don't include the coverage report in the NPM package (#2669) 2016-10-04 17:53:28 -07:00
Ben Kalman 86b7ab38aa Let DatabaseSpec.database take a cacheSize parameter 2016-10-04 10:53:33 -07:00
Erik Arvidsson cdba35e70a Allow Node.js to work with https (#2667)
Detect the protocol and pick the right module as needed.

Fixes #2613
2016-10-03 18:28:11 -07:00
cmasone-attic 96905bff5d JS: Auto-merge concurrent commits to noms datasets (#2655)
This patch brings JS into line with Go's handling of concurrent
commits to separate Datasets.

Fixes issue #2524
2016-09-30 10:49:03 -07:00
Dan Willhite 40e2d7686f Make jsonToNoms handle some null values (#2646)
Null values in struct field are handled by not skipping that field in
the noms type. Null values as elements in array cause an exception.
2016-09-29 10:29:55 -07:00
Erik Arvidsson 89fbf312f1 Increase the timeout for slow JS tests (#2648) 2016-09-29 09:49:24 -07:00
cmasone-attic dd92a06559 JS: Make Database a mutable API that vends immutable Datasets (#2636)
Noms SDK users frequently shoot themselves in the foot because they're
holding onto an "old" Database object. That is, they have a Database
tucked away in some internal state, they call Commit() on it, and
don't replace the object in their internal state with the new Database
returned from Commit.

This PR fixes #2589 by changing the Database and Dataset JS API to be
in line with the proposal there.
2016-09-28 16:50:57 -07:00
Aaron Boodman 3efc6c5f7d You're the computer, you sort the fields (#2641)
Change makeStructType() API for sanity. Update callers.
2016-09-28 15:39:52 -07:00
Erik Arvidsson 2582235bed Add work arounds for React Native (#2608)
This works around a bunch of issues related to fetch and XMLHttpRequest
in React Native.
2016-09-22 16:49:39 -07:00
Erik Arvidsson 21b8fc2b4f Update Flow to 0.32 (#2606)
Motivation: Better libs needed in an upcoming PR.
2016-09-22 15:22:20 -07:00
Erik Arvidsson e28cda9ba7 Update Babel dependencies (#2604)
The motivation is to get babylon@6.11.1 which has a fix for a bug where it
treated toString as a duplicate export.
2016-09-22 13:54:46 -07:00
Erik Arvidsson bc40db4fdb Make UTF-8 encode/decode write directly to a buffer (#2566)
We used to use a third party module that allocated new buffers all
the time. For Noms, we already have a buffer that we want to write
to.

For the rolling hash we use a scratch buffer that we reuse between
calls.

This also removes the DataView objects. Our usage is so basic that
having a DataView object wrapper is just overkill.

Fixes #2304
2016-09-20 11:09:31 -07:00
Erik Arvidsson e3bea0f274 Tweak the display of the type of an empty Map (#2590)
Fixes #2247
Closes #2252
2016-09-16 17:48:47 -07:00
Erik Arvidsson ee1db61bba Remove TypeDesc equals (#2584)
This method was not being used.

Major Version Change: equals was part of exposed public API of *Desc
2016-09-16 13:59:19 -07:00
Ben Kalman 08bb4597d7 Blackbg (#2586)
DashCast makes the background color black, which makes sense for
displaying on a TV screen anyway - easier on the eyes, less distracting,
probably less power usage. Looks fine black on a computer screen too.
2016-09-16 13:15:29 -07:00
Erik Arvidsson d6991a0f7a Add code coverage to js/noms too (#2580) 2016-09-15 15:47:05 -07:00
Ben Kalman c8e72b20c9 Support multiple perf datasets in the perf UI (#2571)
The 'ds' parameter can now have multiple comma separated datasets, and
every time the page refreshes (which now happens programmatically, not
via location.reload) it shows the next.
2016-09-14 17:05:41 -07:00