@liveblocks/core 1.0.2-test5 → 1.0.2

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/dist/index.d.ts CHANGED
@@ -460,28 +460,6 @@ declare type ToJson<T extends Lson | LsonObject> = T extends Json ? T : T extend
460
460
  [K in KS]: ToJson<V>;
461
461
  } : never;
462
462
 
463
- /**
464
- * This type is used by clients to define the metadata for a user.
465
- */
466
- declare type BaseUserMeta = {
467
- /**
468
- * The id of the user that has been set in the authentication endpoint.
469
- * Useful to get additional information about the connected user.
470
- */
471
- id?: string;
472
- /**
473
- * Additional user information that has been set in the authentication endpoint.
474
- */
475
- info?: Json;
476
- };
477
-
478
- declare type Callback<T> = (event: T) => void;
479
- declare type UnsubscribeCallback = () => void;
480
- declare type Observable<T> = {
481
- subscribe(callback: Callback<T>): UnsubscribeCallback;
482
- subscribeOnce(callback: Callback<T>): UnsubscribeCallback;
483
- };
484
-
485
463
  /**
486
464
  * This helper type is effectively a no-op, but will force TypeScript to
487
465
  * "evaluate" any named helper types in its definition. This can sometimes make
@@ -508,6 +486,28 @@ declare type Resolve<T> = T extends (...args: unknown[]) => unknown ? T : {
508
486
  [K in keyof T]: T[K];
509
487
  };
510
488
 
489
+ /**
490
+ * This type is used by clients to define the metadata for a user.
491
+ */
492
+ declare type BaseUserMeta = {
493
+ /**
494
+ * The id of the user that has been set in the authentication endpoint.
495
+ * Useful to get additional information about the connected user.
496
+ */
497
+ id?: string;
498
+ /**
499
+ * Additional user information that has been set in the authentication endpoint.
500
+ */
501
+ info?: Json;
502
+ };
503
+
504
+ declare type Callback<T> = (event: T) => void;
505
+ declare type UnsubscribeCallback = () => void;
506
+ declare type Observable<T> = {
507
+ subscribe(callback: Callback<T>): UnsubscribeCallback;
508
+ subscribeOnce(callback: Callback<T>): UnsubscribeCallback;
509
+ };
510
+
511
511
  declare type AppOnlyAuthToken = {
512
512
  appId: string;
513
513
  roomId?: never;
@@ -1075,6 +1075,17 @@ declare type RoomInitializers<TPresence extends JsonObject, TStorage extends Lso
1075
1075
  shouldInitiallyConnect?: boolean;
1076
1076
  }>;
1077
1077
 
1078
+ declare type EnterOptions<TPresence extends JsonObject, TStorage extends LsonObject> = Resolve<RoomInitializers<TPresence, TStorage> & {
1079
+ /**
1080
+ * Only necessary when you’re using Liveblocks with React v17 or lower.
1081
+ *
1082
+ * If so, pass in a reference to `ReactDOM.unstable_batchedUpdates` here.
1083
+ * This will allow Liveblocks to circumvent the so-called "zombie child
1084
+ * problem". To learn more, see
1085
+ * https://liveblocks.io/docs/guides/troubleshooting#stale-props-zombie-child
1086
+ */
1087
+ unstable_batchedUpdates?: (cb: () => void) => void;
1088
+ }>;
1078
1089
  declare type Client = {
1079
1090
  /**
1080
1091
  * Gets a room. Returns null if {@link Client.enter} has not been called previously.
@@ -1087,7 +1098,7 @@ declare type Client = {
1087
1098
  * @param roomId The id of the room
1088
1099
  * @param options Optional. You can provide initializers for the Presence or Storage when entering the Room.
1089
1100
  */
1090
- enter<TPresence extends JsonObject, TStorage extends LsonObject = LsonObject, TUserMeta extends BaseUserMeta = BaseUserMeta, TRoomEvent extends Json = never>(roomId: string, options: RoomInitializers<TPresence, TStorage>): Room<TPresence, TStorage, TUserMeta, TRoomEvent>;
1101
+ enter<TPresence extends JsonObject, TStorage extends LsonObject = LsonObject, TUserMeta extends BaseUserMeta = BaseUserMeta, TRoomEvent extends Json = never>(roomId: string, options: EnterOptions<TPresence, TStorage>): Room<TPresence, TStorage, TUserMeta, TRoomEvent>;
1091
1102
  /**
1092
1103
  * Leaves a room.
1093
1104
  * @param roomId The id of the room
package/dist/index.js CHANGED
@@ -113,7 +113,7 @@ if (process.env.NODE_ENV !== "production" && typeof window !== "undefined") {
113
113
  var onMessageFromPanel = eventSource.observable;
114
114
 
115
115
  // src/devtools/index.ts
116
- var VERSION = true ? "1.0.2-test5" : "dev";
116
+ var VERSION = true ? "1.0.2" : "dev";
117
117
  var _devtoolsSetupHasRun = false;
118
118
  function setupDevTools(getAllRooms) {
119
119
  if (process.env.NODE_ENV === "production" || typeof window === "undefined") {
@@ -4178,7 +4178,7 @@ function prepareCreateWebSocket(liveblocksServer, WebSocketPolyfill) {
4178
4178
  const ws = WebSocketPolyfill || WebSocket;
4179
4179
  return (token) => {
4180
4180
  return new ws(
4181
- `${liveblocksServer}/?token=${token}&version=${true ? "1.0.2-test5" : "dev"}`
4181
+ `${liveblocksServer}/?token=${token}&version=${true ? "1.0.2" : "dev"}`
4182
4182
  );
4183
4183
  };
4184
4184
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/core",
3
- "version": "1.0.2-test5",
3
+ "version": "1.0.2",
4
4
  "description": "Shared code and foundational internals for Liveblocks",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",