Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Remove JS SDK, examples, and tools #3293

Merged
merged 1 commit into from Mar 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 1 addition & 5 deletions CONTRIBUTING.md
Expand Up @@ -89,11 +89,7 @@ You can use `go test` command, e.g:

* `go test $(go list ./... | grep -v /vendor/)` should run every test except from vendor packages.

For JS code, We have a python script to run all js tests.

* `python tools/run-all-js-tests.py`

If you have commit rights, Jenkins automatically runs the Go and JS tests on every PR, then every subsequent patch. To ask Jenkins to immediately run, any committer can reply (no quotes) "Jenkins: test this" to your PR.
If you have commit rights, Jenkins automatically runs the Go tests on every PR, then every subsequent patch. To ask Jenkins to immediately run, any committer can reply (no quotes) "Jenkins: test this" to your PR.

### Perf tests

Expand Down
5 changes: 0 additions & 5 deletions doc/index.md
Expand Up @@ -13,8 +13,3 @@ Here's what we have so far!

* [Go SDK Tour](go-tour.md)
* [Go SDK Reference](https://godoc.org/github.com/attic-labs/noms)

## JavaScript

* [JavaScript SDK Tour](js-tour.md)
* [JavaScript SDK Reference](http://docs.noms.io/js)
27 changes: 21 additions & 6 deletions doc/intro.md
Expand Up @@ -38,13 +38,28 @@ A database has two responsibilities: it provides storage of [content-addressed](

A Noms database can be implemented on top of any underlying storage system that provides key/value storage with at least optional optimistic concurrency. We only use optimistic concurrency to store the current value of each dataset. Chunks themselves are immutable.

We have implementations of Noms databases on top of our own file-backed store [Noms Block Store (NBS)](https://github.com/attic-labs/noms/tree/master/go/nbs) (usually used locally), our own [HTTP protocol](https://github.com/attic-labs/noms/blob/master/go/datas/database_server.go) (used for working with a remote database), [Amazon DynamoDB](https://aws.amazon.com/dynamodb/), and [memory](https://github.com/attic-labs/noms/blob/master/js/noms/src/memory-store.js) (mainly used for testing).
We have implementations of Noms databases on top of our own file-backed store [Noms Block Store (NBS)](https://github.com/attic-labs/noms/tree/master/go/nbs) (usually used locally), our own [HTTP protocol](https://github.com/attic-labs/noms/blob/master/go/datas/database_server.go) (used for working with a remote database), [Amazon DynamoDB](https://aws.amazon.com/dynamodb/), and [memory](https://github.com/attic-labs/noms/blob/master/go/chunks/memory_store.go) (mainly used for testing).

Here's an example of creating an http-backed database using the [JavaScript Noms SDK](js-tour.md):
Here's an example of creating an http-backed database using the [Go Noms SDK](go-tour.md):

```
var noms = require('@attic/noms');
var db = noms.DatabaseSpec.parse('http://localhost:8000').db();
```go
package main

import (
"fmt"
"os"

"github.com/attic-labs/noms/go/spec"
)

func main() {
sp, err := spec.ForDatabase("http://localhost:8000")
if err != nil {
fmt.Fprintf(os.Stderr, "Could not access database: %s\n", err)
return
}
defer sp.Close()
}
```

A dataset is nothing more than a named pointer into the DAG. Consider the following command to copy the dataset named `foo` to the dataset named `bar` within a database:
Expand Down Expand Up @@ -174,7 +189,7 @@ Because of this sorting, Noms collections can be used as efficient indexes, in t

For example, say you want to quickly be able to find `Person` structs by their age. You could build a map of type `Map<Number, Set<Person>>`. This would allow you to quickly (~log<sub>k</sub>(n) seeks, where `k` is average prolly tree width, which is currently 64) find all the people of an exact age. But it would _also_ allow you to find all people within a range of ages efficiently (~num_results/log<sub>k</sub>(n) seeks), even if the ages are non-integral.

Also, because Noms collections are ordered search trees, it is possible to implement set operations like union and [intersect](https://github.com/attic-labs/noms/blob/d6537c74c58fecebb8c4605c07b0670ed9737e1f/js/src/set.js#L157) efficiently on them.
Also, because Noms collections are ordered search trees, it is possible to implement set operations like union and intersect efficiently on them.

So, for example, if you wanted to find all the people of a particular age AND having a particular hair color, you could construct a second map having type `Map<String, Set<Person>>`, and intersect the two sets.

Expand Down
193 changes: 0 additions & 193 deletions doc/js-tour.md

This file was deleted.

2 changes: 1 addition & 1 deletion go/constants/version.go
Expand Up @@ -10,7 +10,7 @@ import (
"os"
)

// TODO: generate this from some central thing with go generate, so that JS and Go can be easily kept in sync
// TODO: generate this from some central thing with go generate.
const NomsVersion = "7.2"
const NOMS_VERSION_NEXT_ENV_NAME = "NOMS_VERSION_NEXT"
const NOMS_VERSION_NEXT_ENV_VALUE = "1"
Expand Down
4 changes: 1 addition & 3 deletions go/spec/spec_test.go
Expand Up @@ -69,9 +69,7 @@ func TestMemHashPathSpec(t *testing.T) {
assert.Equal("", spec.DatabaseName)
assert.False(spec.Path.IsEmpty())

// This would be a reasonable check, and the equivalent JS test does it, but
// it causes the next GetValue to return nil. This is inconsistent with JS.
// See https://github.com/attic-labs/noms/issues/2802:
// This is a reasonable check but it causes the next GetValue to return nil:
// assert.Nil(spec.GetValue())

spec.GetDatabase().WriteValue(s)
Expand Down
3 changes: 0 additions & 3 deletions go/types/blob_test.go
Expand Up @@ -16,9 +16,6 @@ import (
"github.com/attic-labs/testify/suite"
)

// IMPORTANT: These tests and in particular the hash of the values should stay in sync with the
// corresponding tests in js

type countingReader struct {
last uint32
val uint32
Expand Down
1 change: 0 additions & 1 deletion go/types/xp_test.go
Expand Up @@ -22,7 +22,6 @@ type testSuite struct {
testValues []*testValue
}

// please update Go and JS to keep them in sync - see js/src//xp-test.js
func newTestSuite() *testSuite {
testValues := []*testValue{
{Bool(true), "g19moobgrm32dn083bokhksuobulq28c", "bool - true"},
Expand Down
3 changes: 0 additions & 3 deletions js/noms/.babelrc

This file was deleted.

7 changes: 0 additions & 7 deletions js/noms/.eslintrc.js

This file was deleted.

20 changes: 0 additions & 20 deletions js/noms/.flowconfig

This file was deleted.

6 changes: 0 additions & 6 deletions js/noms/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions js/noms/.npmignore

This file was deleted.

17 changes: 0 additions & 17 deletions js/noms/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions js/noms/build/make-index-html.js

This file was deleted.