@fluidframework/map 2.0.0-internal.5.4.0 → 2.0.0-internal.6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/directory.js +9 -14
- package/dist/directory.js.map +1 -1
- package/dist/mapKernel.js +3 -3
- package/dist/mapKernel.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/lib/directory.js +9 -14
- package/lib/directory.js.map +1 -1
- package/lib/mapKernel.js +3 -3
- package/lib/mapKernel.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/package.json +13 -13
- package/src/packageVersion.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @fluidframework/map
|
|
2
2
|
|
|
3
|
+
## 2.0.0-internal.6.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Upgraded typescript transpilation target to ES2020 [8abce8cdb4](https://github.com/microsoft/FluidFramework/commits/8abce8cdb4e2832fb6405fb44e393bef03d5648a)
|
|
8
|
+
|
|
9
|
+
Upgraded typescript transpilation target to ES2020. This is done in order to decrease the bundle sizes of Fluid Framework packages. This has provided size improvements across the board for ex. Loader, Driver, Runtime etc. Reduced bundle sizes helps to load lesser code in apps and hence also helps to improve the perf.If any app wants to target any older versions of browsers with which this target version is not compatible, then they can use packages like babel to transpile to a older target.
|
|
10
|
+
|
|
3
11
|
## 2.0.0-internal.5.4.0
|
|
4
12
|
|
|
5
13
|
Dependency updates only.
|
package/dist/directory.js
CHANGED
|
@@ -774,9 +774,8 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
774
774
|
* {@inheritDoc IDirectory.get}
|
|
775
775
|
*/
|
|
776
776
|
get(key) {
|
|
777
|
-
var _c;
|
|
778
777
|
this.throwIfDisposed();
|
|
779
|
-
return
|
|
778
|
+
return this._storage.get(key)?.value;
|
|
780
779
|
}
|
|
781
780
|
/**
|
|
782
781
|
* {@inheritDoc IDirectory.set}
|
|
@@ -815,7 +814,6 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
815
814
|
* {@inheritDoc IDirectory.createSubDirectory}
|
|
816
815
|
*/
|
|
817
816
|
createSubDirectory(subdirName) {
|
|
818
|
-
var _c;
|
|
819
817
|
this.throwIfDisposed();
|
|
820
818
|
// Undefined/null subdirectory names can't be serialized to JSON in the manner we currently snapshot.
|
|
821
819
|
if (subdirName === undefined || subdirName === null) {
|
|
@@ -825,7 +823,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
825
823
|
throw new Error(`SubDirectory name may not contain ${posix.sep}`);
|
|
826
824
|
}
|
|
827
825
|
// Create the sub directory locally first.
|
|
828
|
-
const isNew = this.createSubDirectoryCore(subdirName, true, this.getLocalSeq(),
|
|
826
|
+
const isNew = this.createSubDirectoryCore(subdirName, true, this.getLocalSeq(), this.runtime.clientId ?? "detached");
|
|
829
827
|
const subDir = this._subdirectories.get(subdirName);
|
|
830
828
|
(0, common_utils_1.assert)(subDir !== undefined, 0x5aa /* subdirectory should exist after creation */);
|
|
831
829
|
// If we are not attached, don't submit the op.
|
|
@@ -1162,10 +1160,9 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1162
1160
|
* @returns metadata generated for stahed op
|
|
1163
1161
|
*/
|
|
1164
1162
|
applyStashedCreateSubDirMessage(op) {
|
|
1165
|
-
var _c;
|
|
1166
1163
|
this.throwIfDisposed();
|
|
1167
1164
|
// Create the sub directory locally first.
|
|
1168
|
-
this.createSubDirectoryCore(op.subdirName, true, this.getLocalSeq(),
|
|
1165
|
+
this.createSubDirectoryCore(op.subdirName, true, this.getLocalSeq(), this.runtime.clientId ?? "detached");
|
|
1169
1166
|
this.updatePendingSubDirMessageCount(op);
|
|
1170
1167
|
const localOpMetadata = {
|
|
1171
1168
|
type: "createSubDir",
|
|
@@ -1282,13 +1279,11 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1282
1279
|
}
|
|
1283
1280
|
}
|
|
1284
1281
|
incrementPendingSubDirCount(map, subDirName) {
|
|
1285
|
-
|
|
1286
|
-
const count = (_c = map.get(subDirName)) !== null && _c !== void 0 ? _c : 0;
|
|
1282
|
+
const count = map.get(subDirName) ?? 0;
|
|
1287
1283
|
map.set(subDirName, count + 1);
|
|
1288
1284
|
}
|
|
1289
1285
|
decrementPendingSubDirCount(map, subDirName) {
|
|
1290
|
-
|
|
1291
|
-
const count = (_c = map.get(subDirName)) !== null && _c !== void 0 ? _c : 0;
|
|
1286
|
+
const count = map.get(subDirName) ?? 0;
|
|
1292
1287
|
map.set(subDirName, count - 1);
|
|
1293
1288
|
if (count <= 1) {
|
|
1294
1289
|
map.delete(subDirName);
|
|
@@ -1419,7 +1414,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1419
1414
|
*/
|
|
1420
1415
|
rollbackPendingMessageId(map, key, pendingMessageId) {
|
|
1421
1416
|
const pendingMessageIds = map.get(key);
|
|
1422
|
-
const lastPendingMessageId = pendingMessageIds
|
|
1417
|
+
const lastPendingMessageId = pendingMessageIds?.pop();
|
|
1423
1418
|
if (!pendingMessageIds || lastPendingMessageId !== pendingMessageId) {
|
|
1424
1419
|
throw new Error("Rollback op does not match last pending");
|
|
1425
1420
|
}
|
|
@@ -1608,7 +1603,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1608
1603
|
const dir = this._subdirectories.get(op.subdirName);
|
|
1609
1604
|
// Child sub directory create seq number can't be lower than the parent subdirectory.
|
|
1610
1605
|
if (this.sequenceNumber !== -1 && this.sequenceNumber < msg.sequenceNumber) {
|
|
1611
|
-
if (
|
|
1606
|
+
if (dir?.sequenceNumber === -1) {
|
|
1612
1607
|
// Only set the seq on the first message, could be more
|
|
1613
1608
|
dir.sequenceNumber = msg.sequenceNumber;
|
|
1614
1609
|
}
|
|
@@ -1659,7 +1654,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1659
1654
|
*/
|
|
1660
1655
|
deleteCore(key, local) {
|
|
1661
1656
|
const previousLocalValue = this._storage.get(key);
|
|
1662
|
-
const previousValue = previousLocalValue
|
|
1657
|
+
const previousValue = previousLocalValue?.value;
|
|
1663
1658
|
const successfullyRemoved = this._storage.delete(key);
|
|
1664
1659
|
if (successfullyRemoved) {
|
|
1665
1660
|
const event = { key, path: this.absolutePath, previousValue };
|
|
@@ -1678,7 +1673,7 @@ class SubDirectory extends common_utils_1.TypedEventEmitter {
|
|
|
1678
1673
|
*/
|
|
1679
1674
|
setCore(key, value, local) {
|
|
1680
1675
|
const previousLocalValue = this._storage.get(key);
|
|
1681
|
-
const previousValue = previousLocalValue
|
|
1676
|
+
const previousValue = previousLocalValue?.value;
|
|
1682
1677
|
this._storage.set(key, value);
|
|
1683
1678
|
const event = { key, path: this.absolutePath, previousValue };
|
|
1684
1679
|
this.directory.emit("valueChanged", event, local, this.directory);
|