This is a breaking change to the JS API. HashSpec and parseObjectSpec
have been removed in favour of PathSpec, and parse errors now throw
SyntaxError instead of silently failing (this matches JSON.parse).
This requires all parameterized types to have type params. Fortunately
one can use `T<any>` which has the same behavior as the old `T` syntax.
We should tighten the types further after this but this unblocks us.
Fixes#2301
- Lower case header names in fetch function
- fetchUint8Array should return an Uint8Array and not an ArrayBuffer
- Safari does not have slice on typed arrays
Fixes#2265
The library that we were using multiplied (and divided) by 2 to
do the zigzag encoding. However, if we are already close to the
precision limit then we lose precision and the encoding/decoding
does not round trip.
Instead, we split the float64 into two Uint32 numbers and do the
operations on those.
Also, the code that split a float64 into base and exp was not shifting
enough, it was shifting until float64(maxInt64) when we need to shift
until less than max safe int (according to float64)
Fixes#2104Fixes#2234
sequence.getOffset was problematic and didn't have a clear meaning. In addition it was causing a bunch of +1 code at call sites. This patch replaces it with cumulativeNumLeaves which has a clearer meaning.
This changes so that all commit struct types have a meta field
(which might be an empty struct).
Increment the serialization version since the old data does not
necessarily have the meta field.
Fixes ##2112
We now compute the commit type based on the type of the value and
the type of the parents.
For the first commit we get:
```
struct Commit {
parents: Set<Ref<Cycle<0>>>,
value: T,
}
```
As long as we continue to commit values with type T that type stays
the same.
When we later commits a value of type U we get:
```
struct Commit {
parents: Set<Ref<struct Commit {
parents: Set<Ref<Cycle<0>>>,
value: T | U
}>>,
value: U,
}
```
The new type gets combined as a union type for the value of the inner
commit struct.
Fixes#1495
* Revert "Revert "Share node_modules for samples/js" (#1967)"
This reverts commit 7bb1623e99.
* Add parent directory to the PATH
* Change run-all-js-tests to run samples/js before samples/js/**
* Fix a temporary comment