Commit Graph

38 Commits

Author SHA1 Message Date
Rafael Weinstein
4e10ae63f4 Js type cache (#2011)
Js type cache
2016-07-11 16:45:35 -07:00
Rafael Weinstein
ee5c0f3a72 MakeStructType and NewStructWithType now takes slices rather than maps (#1945)
NewStructType and NewStructWithType now takes slices rather than maps
2016-07-07 16:36:48 -07:00
Aaron Boodman
1d752e3101 Update license: Noms will be copyright Attic Labs. (#1976) 2016-07-05 22:07:42 -07:00
Rafael Weinstein
79a446d7b5 MemoryStore doesn't use put-cache (#1798)
MemoryStore doesn't use put-cache
2016-06-13 14:00:23 -07:00
Erik Arvidsson
abbd0cfb1e JS: Make Structs use arrays (#1743)
...instead of objects as maps.

Fixes #1715
2016-06-07 15:59:27 -07:00
Erik Arvidsson
f20c6465b6 Flow comment first (#1724) 2016-06-03 14:35:21 -07:00
Aaron Boodman
e5f288b752 Licensify js/ 2016-05-30 14:32:28 -07:00
Aaron Boodman
68b1b88a69 js/json-convert: encode field names (#1620) 2016-05-24 16:47:22 -07:00
Ben Kalman
01a50e9541 Change the async "newList" and friends to sync "new List" constructors (#1554)
Friends: List, Set, Map, Blob, and Commit. This lets us remove a lot of
Promise and async/await bloat.
2016-05-20 15:01:55 -07:00
Chris Masone
917a4d8564 JS: make sure we call close() on Database most of the time
Other than DatasetSpec::value(), this should close all Database
instances that we create. I'm not sure how to deal with that one
case, though.
2016-05-19 16:49:54 -07:00
Rafael Weinstein
4389605e47 Struct diff (#1548)
StructDiff
2016-05-19 11:09:26 -07:00
Erik Arvidsson
643c12172b Noms data structure names (#1525)
* Change to default exports

* Rename NomsX to X in (Blob, List, Map, Set)

* Increment version
2016-05-18 09:26:36 -07:00
Erik Arvidsson
5db7fe8285 JS: Update the collection/struct API to compute the type. (#1502)
When you create or modify a data structure we now compute the type
based on the type of the values in the data structure.

Towards #1491
2016-05-16 10:58:50 -07:00
Erik Arvidsson
58464baef9 Total ordering of values (#1475)
This allows having a set/map of heterogenous elements/keys. To support
this we have to be able to have a total ordering for all noms values.

The ordering is false < true < -999 < 0 < 999 < "" < "a" < "z" < Hash
In other words, Bool < Number < String < * and for comparing non
primitives we compare the hash of the object.

Fixes #1104
Fixes #1312
2016-05-12 10:35:56 -07:00
Erik Arvidsson
014e330315 Rename DataStore to Database (#1448) 2016-05-06 17:37:19 -07:00
Erik Arvidsson
3032c76a39 Use a map for the struct fields
Fixes #1368
2016-05-02 15:35:27 -07:00
Chris Masone
f26a94584c JS: Implement new DataStore client protocol
This replaces the HTTP ChunkStore implementation with an implementation of
our new DataStore client protocol. It migrates much of the batching logic
from RemoteStore into the new BatchStore, which is analogous to a class we
have on the Go side, but continues to use a Delegate to handle all the HTTP
work.

This patch also introduces ValueStore, which handles validating Values as
they're written. Instead of handling Value reading and writing itself,
DataStore now extends ValueStore.

Towards #1280
2016-05-02 09:52:36 -07:00
Chris Masone
8eba180782 Revert "renaming datastore to database (#1374) - fixes bug #1290"
This reverts commit d77902b323.
2016-05-02 09:01:44 -07:00
Mike Gray
d77902b323 renaming datastore to database (#1374) - fixes bug #1290
* datastore -> database
* fixing bug 1290, renaming datastore to database
2016-05-01 22:02:16 -04:00
Erik Arvidsson
d4d6de6a76 Rename Field t to type (#1366)
* Rename Field t to type

* Fix clients/csv too
2016-04-29 13:47:52 -07:00
Erik Arvidsson
719094ef37 Parameterize the Type type (#1362)
The Type type is now parameterized with a `T: TypeDesc`. This means
that we almost always know the type of `t.desc` and we can remove
invariants.
2016-04-29 11:24:51 -07:00
Erik Arvidsson
cfc51e2e9d Remove optional fields (#1354)
Remove optional fields

Fixes #1310
2016-04-28 17:12:15 -07:00
Erik Arvidsson
fa742aecb1 Remove unions from structs (#1345)
Fixes #1344
2016-04-28 11:13:59 -07:00
Erik Arvidsson
3ff6ee6add Inline struct type declaration into chunk (#1324)
Struct type definition is now inlined into the chunk. To break
cycles we use back references.

- Removes unresolved type refs
- Removes packages

Fixes #1164
Fixes #1165
2016-04-27 20:39:51 -07:00
Mike Gray
47794ca754 Removing [U]Int[8|16|32|64] and Float[32|64] in favor of Number 2016-04-27 16:24:13 -04:00
Erik Arvidsson
71ee644d36 Add runtime type checking to structs (#1253) 2016-04-15 09:25:25 -07:00
Erik Arvidsson
a02ca3cd6d JS: Remove empty Refs in package when the package is created (#1220)
This means that we do not need to use fixup type in any other
place in the code.
2016-04-13 17:29:49 -07:00
Rafael Weinstein
1676707906 WriteValue returns RefBase 2016-04-11 17:09:25 -07:00
Erik Arvidsson
bfc7a5d88e JS: Remove makePrimitiveType (#1206)
type.js no longer exports makePrimitiveType. It is recommended to use
the type constants directly. There are a few cases where we had a
NomsKind and needed a Type. For those cases there is now a
getPrimitiveType but it is not exported by noms.

Fixes #1168
2016-04-11 15:00:39 -07:00
Erik Arvidsson
2031372212 JS: Dynamically create a class per struct
The decoder now generates a class for a struct. Given:

```noms
struct MyStruct {
  x: Int8
  s: optional String
}
```

the generated class looks something like this:

```js
class MyStruct extends Struct {
  get x(): int8 { ... }
  setX(value: int8): MyStruct { ... }
  get s(): ?string { ... }
  setS(value: ?string): MyStruct { ... }
}
```

The base class `Struct` has nothing on it (except chunks). It
usefull in cases where a generic struct is wanted.

To reflect on Structs we introduce StructMirror.

This also means that Commit is now a real ~~boy~~type.

This does not yet handle Defs.

Towards #1157
2016-04-01 09:37:58 -07:00
Erik Arvidsson
7910ad31cf JS: Make chunks an array of RefValue
Towards #1112
2016-03-28 10:18:35 -07:00
Erik Arvidsson
a5c174ca24 JS: Clean up Struct interface 2016-03-23 11:42:40 -07:00
Rafael Weinstein
38292e29c6 RefValue 2016-03-22 16:43:13 -07:00
Erik Arvidsson
98637b1f6d JS: Update to remove type param when not needed 2016-03-22 11:14:32 -07:00
Erik Arvidsson
bc64b63110 JS: Use export default for DataStore 2016-03-21 15:07:13 -07:00
Erik Arvidsson
c6d637197f JS: Move writeValue to DataStore
Towards #1095
2016-03-21 15:07:07 -07:00
Erik Arvidsson
c27780e4fe JS: Move readValue to DataStore
Towards #1095
2016-03-21 13:45:37 -07:00
Erik Arvidsson
60534360b3 JS: Rename files to use hyphen instead of underscore 2016-03-17 13:25:19 -07:00