Skip to content

Commit 3c764c1

Browse files
authored
Remove JS SDK, examples, and tools (attic-labs#3293)
1 parent 44dd79d commit 3c764c1

File tree

213 files changed

+24
-53291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+24
-53291
lines changed

CONTRIBUTING.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ You can use `go test` command, e.g:
8989

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

92-
For JS code, We have a python script to run all js tests.
93-
94-
* `python tools/run-all-js-tests.py`
95-
96-
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.
92+
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.
9793

9894
### Perf tests
9995

doc/index.md

-5
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,3 @@ Here's what we have so far!
1313

1414
* [Go SDK Tour](go-tour.md)
1515
* [Go SDK Reference](https://godoc.org/github.com/attic-labs/noms)
16-
17-
## JavaScript
18-
19-
* [JavaScript SDK Tour](js-tour.md)
20-
* [JavaScript SDK Reference](http://docs.noms.io/js)

doc/intro.md

+21-6
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,28 @@ A database has two responsibilities: it provides storage of [content-addressed](
3838

3939
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.
4040

41-
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).
41+
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).
4242

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

45-
```
46-
var noms = require('@attic/noms');
47-
var db = noms.DatabaseSpec.parse('http://localhost:8000').db();
45+
```go
46+
package main
47+
48+
import (
49+
"fmt"
50+
"os"
51+
52+
"github.com/attic-labs/noms/go/spec"
53+
)
54+
55+
func main() {
56+
sp, err := spec.ForDatabase("http://localhost:8000")
57+
if err != nil {
58+
fmt.Fprintf(os.Stderr, "Could not access database: %s\n", err)
59+
return
60+
}
61+
defer sp.Close()
62+
}
4863
```
4964

5065
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:
@@ -174,7 +189,7 @@ Because of this sorting, Noms collections can be used as efficient indexes, in t
174189

175190
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.
176191

177-
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.
192+
Also, because Noms collections are ordered search trees, it is possible to implement set operations like union and intersect efficiently on them.
178193

179194
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.
180195

doc/js-tour.md

-193
This file was deleted.

go/constants/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"os"
1111
)
1212

13-
// TODO: generate this from some central thing with go generate, so that JS and Go can be easily kept in sync
13+
// TODO: generate this from some central thing with go generate.
1414
const NomsVersion = "7.2"
1515
const NOMS_VERSION_NEXT_ENV_NAME = "NOMS_VERSION_NEXT"
1616
const NOMS_VERSION_NEXT_ENV_VALUE = "1"

go/spec/spec_test.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ func TestMemHashPathSpec(t *testing.T) {
6969
assert.Equal("", spec.DatabaseName)
7070
assert.False(spec.Path.IsEmpty())
7171

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

7775
spec.GetDatabase().WriteValue(s)

go/types/blob_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import (
1616
"github.com/attic-labs/testify/suite"
1717
)
1818

19-
// IMPORTANT: These tests and in particular the hash of the values should stay in sync with the
20-
// corresponding tests in js
21-
2219
type countingReader struct {
2320
last uint32
2421
val uint32

go/types/xp_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ type testSuite struct {
2222
testValues []*testValue
2323
}
2424

25-
// please update Go and JS to keep them in sync - see js/src//xp-test.js
2625
func newTestSuite() *testSuite {
2726
testValues := []*testValue{
2827
{Bool(true), "g19moobgrm32dn083bokhksuobulq28c", "bool - true"},

js/noms/.babelrc

-3
This file was deleted.

js/noms/.eslintrc.js

-7
This file was deleted.

js/noms/.flowconfig

-20
This file was deleted.

js/noms/.gitignore

-6
This file was deleted.

js/noms/.npmignore

-7
This file was deleted.

js/noms/README.md

-17
This file was deleted.

js/noms/build/make-index-html.js

-17
This file was deleted.

0 commit comments

Comments
 (0)