@devvit/realtime 0.11.20-next-2025-07-25-17-24-54-9a691dab8.0 → 0.11.20-next-2025-07-28-12-50-32-fb5e880af.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.
@@ -1,7 +1,6 @@
1
1
  import type { JSONValue } from '@devvit/shared';
2
2
  export declare class RealtimeClient {
3
3
  #private;
4
- constructor();
5
4
  send(channel: string, msg: JSONValue): Promise<void>;
6
5
  }
7
6
  export declare const realtime: RealtimeClient;
@@ -1 +1 @@
1
- {"version":3,"file":"RealtimeClient.d.ts","sourceRoot":"","sources":["../src/RealtimeClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,qBAAa,cAAc;;;IAOnB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAI3D;AAED,eAAO,MAAM,QAAQ,gBAAuB,CAAC"}
1
+ {"version":3,"file":"RealtimeClient.d.ts","sourceRoot":"","sources":["../src/RealtimeClient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,qBAAa,cAAc;;IAGnB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ3D;AAED,eAAO,MAAM,QAAQ,gBAAuB,CAAC"}
package/RealtimeClient.js CHANGED
@@ -1,27 +1,29 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
1
6
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
7
  if (kind === "m") throw new TypeError("Private method is not writable");
3
8
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
10
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
11
  };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
- var _RealtimeClient_realtimePlugin;
12
+ var _RealtimeClient_instances, _RealtimeClient_pluginCache, _RealtimeClient_plugin_get;
13
13
  import { RealtimeDefinition } from '@devvit/protos';
14
14
  import { context } from '@devvit/server';
15
- import { getDevvitConfig } from '@devvit/server/get-devvit-config.js';
15
+ import { getDevvitConfig } from '@devvit/shared-types/server/get-devvit-config.js';
16
16
  export class RealtimeClient {
17
17
  constructor() {
18
- _RealtimeClient_realtimePlugin.set(this, void 0);
19
- __classPrivateFieldSet(this, _RealtimeClient_realtimePlugin, getDevvitConfig().use(RealtimeDefinition), "f");
18
+ _RealtimeClient_instances.add(this);
19
+ _RealtimeClient_pluginCache.set(this, void 0);
20
20
  }
21
21
  async send(channel, msg) {
22
22
  // guarantee an object by wrapping msg. the key must align to useChannel().
23
- await __classPrivateFieldGet(this, _RealtimeClient_realtimePlugin, "f").Send({ channel, data: { msg } }, context.metadata);
23
+ await __classPrivateFieldGet(this, _RealtimeClient_instances, "a", _RealtimeClient_plugin_get).Send({ channel, data: { msg } }, context.metadata);
24
24
  }
25
25
  }
26
- _RealtimeClient_realtimePlugin = new WeakMap();
26
+ _RealtimeClient_pluginCache = new WeakMap(), _RealtimeClient_instances = new WeakSet(), _RealtimeClient_plugin_get = function _RealtimeClient_plugin_get() {
27
+ return (__classPrivateFieldSet(this, _RealtimeClient_pluginCache, __classPrivateFieldGet(this, _RealtimeClient_pluginCache, "f") ?? getDevvitConfig().use(RealtimeDefinition), "f"));
28
+ };
27
29
  export const realtime = new RealtimeClient();
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Hey! If you're seeing this, you're probably trying to run client code in the
3
- * server context, or you have your server build environment set up incorrectly.
3
+ * server context, or you have your client build environment set up incorrectly.
4
4
  * To fix this:
5
5
  * 1) Check that you're not importing client code in your server files. If you
6
6
  * are, you should import from `@devvit/web/server` instead of
7
7
  * `@devvit/web/client`.
8
- * 2) Ensure that your server's tsconfig & build environment is set up correctly
9
- * - specifically, make sure you do NOT set `compilerOptions.customConditions`
10
- * to `["browser"]` in your `tsconfig.json` file. Also, verify that whatever
11
- * bundler you're using (esbuild, vite, etc.) is bundling the server code
12
- * for a Node environment, and not a web browser!
8
+ * 2) If this is coming from client code, ensure that your server's tsconfig &
9
+ * build environment is set up correctly - specifically, make sure you set
10
+ * `compilerOptions.customConditions` to `["browser"]` in your `tsconfig.json`
11
+ * file. Also, verify that whatever bundler you're using (esbuild, vite, etc.)
12
+ * is bundling the server code for a web browser, and not a Node environment!
13
13
  */
14
14
  export {};
15
15
  //# sourceMappingURL=clientImportInServerCodePanic.d.ts.map
@@ -1,15 +1,15 @@
1
1
  /**
2
2
  * Hey! If you're seeing this, you're probably trying to run client code in the
3
- * server context, or you have your server build environment set up incorrectly.
3
+ * server context, or you have your client build environment set up incorrectly.
4
4
  * To fix this:
5
5
  * 1) Check that you're not importing client code in your server files. If you
6
6
  * are, you should import from `@devvit/web/server` instead of
7
7
  * `@devvit/web/client`.
8
- * 2) Ensure that your server's tsconfig & build environment is set up correctly
9
- * - specifically, make sure you do NOT set `compilerOptions.customConditions`
10
- * to `["browser"]` in your `tsconfig.json` file. Also, verify that whatever
11
- * bundler you're using (esbuild, vite, etc.) is bundling the server code
12
- * for a Node environment, and not a web browser!
8
+ * 2) If this is coming from client code, ensure that your server's tsconfig &
9
+ * build environment is set up correctly - specifically, make sure you set
10
+ * `compilerOptions.customConditions` to `["browser"]` in your `tsconfig.json`
11
+ * file. Also, verify that whatever bundler you're using (esbuild, vite, etc.)
12
+ * is bundling the server code for a web browser, and not a Node environment!
13
13
  */
14
14
  console.error("Can't import client code in the server!");
15
15
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/realtime",
3
- "version": "0.11.20-next-2025-07-25-17-24-54-9a691dab8.0",
3
+ "version": "0.11.20-next-2025-07-28-12-50-32-fb5e880af.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,18 +19,19 @@
19
19
  "test:types": "tsc --noEmit"
20
20
  },
21
21
  "dependencies": {
22
- "@devvit/protos": "0.11.20-next-2025-07-25-17-24-54-9a691dab8.0",
23
- "@devvit/shared": "0.11.20-next-2025-07-25-17-24-54-9a691dab8.0"
22
+ "@devvit/protos": "0.11.20-next-2025-07-28-12-50-32-fb5e880af.0",
23
+ "@devvit/shared": "0.11.20-next-2025-07-28-12-50-32-fb5e880af.0",
24
+ "@devvit/shared-types": "0.11.20-next-2025-07-28-12-50-32-fb5e880af.0"
24
25
  },
25
26
  "peerDependencies": {
26
27
  "@devvit/client": "*",
27
28
  "@devvit/server": "*"
28
29
  },
29
30
  "devDependencies": {
30
- "@devvit/client": "0.11.20-next-2025-07-25-17-24-54-9a691dab8.0",
31
- "@devvit/repo-tools": "0.11.20-next-2025-07-25-17-24-54-9a691dab8.0",
32
- "@devvit/server": "0.11.20-next-2025-07-25-17-24-54-9a691dab8.0",
33
- "@devvit/tsconfig": "0.11.20-next-2025-07-25-17-24-54-9a691dab8.0",
31
+ "@devvit/client": "0.11.20-next-2025-07-28-12-50-32-fb5e880af.0",
32
+ "@devvit/repo-tools": "0.11.20-next-2025-07-28-12-50-32-fb5e880af.0",
33
+ "@devvit/server": "0.11.20-next-2025-07-28-12-50-32-fb5e880af.0",
34
+ "@devvit/tsconfig": "0.11.20-next-2025-07-28-12-50-32-fb5e880af.0",
34
35
  "eslint": "9.11.1",
35
36
  "typescript": "5.8.3",
36
37
  "vitest": "1.6.1"
@@ -38,5 +39,5 @@
38
39
  "publishConfig": {
39
40
  "directory": "dist"
40
41
  },
41
- "gitHead": "fb15c146a01dfc979e3d8e41bfd914a58b6427a6"
42
+ "gitHead": "ea8c67f0f877eafc8b41e537fe6758d22d7db8b6"
42
43
  }
package/realtime.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../src/realtime.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACtC,CAAC;AAQF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM,QAAQ,CAAC,sBAAsB,CAAC,KACrC,OAAO,CAAC,UAAU,CAepB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO,IAErC,CAAC;AAEF,cAAM,UAAU;;gBAGF,IAAI,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAIlD;;;;;;;OAOG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBjC,SAAS,GAAI,IAAI,YAAY,KAAG,IAAI,CAgClC;CACH"}
1
+ {"version":3,"file":"realtime.d.ts","sourceRoot":"","sources":["../src/realtime.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACtC,CAAC;AAQF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,MAAM,QAAQ,CAAC,sBAAsB,CAAC,KACrC,OAAO,CAAC,UAAU,CAepB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,QAAO,IAErC,CAAC;AAEF,cAAM,UAAU;;gBAGF,IAAI,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAIlD;;;;;;;OAOG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBjC,SAAS,GAAI,IAAI,YAAY,KAAG,IAAI,CAgClC;CACH"}
package/realtime.js CHANGED
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
12
  var _Connection_opts;
13
- import { emitEffect } from '@devvit/client/effects/emit-effect.js';
13
+ import { emitEffect } from '@devvit/shared-types/client/emit-effect.js';
14
14
  const connectionsByChannel = new Map();
15
15
  /* TODO: Clean up this API. Now that realtime has been removed from the
16
16
  * EFFECTS_WITH_RESPONSE list, we probably don't need to await emitEffect.
@@ -1,15 +1,16 @@
1
1
  /**
2
2
  * Hey! If you're seeing this, you're probably trying to run server code in the
3
- * client context, or you have your client build environment set up incorrectly.
3
+ * client context, or you have your server build environment set up incorrectly.
4
4
  * To fix this:
5
5
  * 1) Check that you're not importing server code in your client files. If you
6
6
  * are, you should import from `@devvit/web/client` instead of
7
7
  * `@devvit/web/server`.
8
- * 2) Ensure that your client's tsconfig & build environment is set up correctly
9
- * - specifically, make sure you set `compilerOptions.customConditions` to
10
- * `["browser"]` in your `tsconfig.json` file. Also, verify that whatever
11
- * bundler you're using (esbuild, vite, etc.) is bundling the client code
12
- * for a web browser, and not a Node environment!
8
+ * 2) If this is coming from server code, ensure that your client's tsconfig &
9
+ * build environment is set up correctly - specifically, make sure you do NOT
10
+ * have `compilerOptions.customConditions` set to include `["browser"]` in
11
+ * your `tsconfig.json` file. Also, verify that whatever bundler you're using
12
+ * (esbuild, vite, etc.) is bundling the client code for a Node environment,
13
+ * and not a web browser!
13
14
  */
14
15
  export {};
15
16
  //# sourceMappingURL=serverImportInClientCodePanic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serverImportInClientCodePanic.d.ts","sourceRoot":"","sources":["../src/serverImportInClientCodePanic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
1
+ {"version":3,"file":"serverImportInClientCodePanic.d.ts","sourceRoot":"","sources":["../src/serverImportInClientCodePanic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
@@ -1,15 +1,16 @@
1
1
  /**
2
2
  * Hey! If you're seeing this, you're probably trying to run server code in the
3
- * client context, or you have your client build environment set up incorrectly.
3
+ * client context, or you have your server build environment set up incorrectly.
4
4
  * To fix this:
5
5
  * 1) Check that you're not importing server code in your client files. If you
6
6
  * are, you should import from `@devvit/web/client` instead of
7
7
  * `@devvit/web/server`.
8
- * 2) Ensure that your client's tsconfig & build environment is set up correctly
9
- * - specifically, make sure you set `compilerOptions.customConditions` to
10
- * `["browser"]` in your `tsconfig.json` file. Also, verify that whatever
11
- * bundler you're using (esbuild, vite, etc.) is bundling the client code
12
- * for a web browser, and not a Node environment!
8
+ * 2) If this is coming from server code, ensure that your client's tsconfig &
9
+ * build environment is set up correctly - specifically, make sure you do NOT
10
+ * have `compilerOptions.customConditions` set to include `["browser"]` in
11
+ * your `tsconfig.json` file. Also, verify that whatever bundler you're using
12
+ * (esbuild, vite, etc.) is bundling the client code for a Node environment,
13
+ * and not a web browser!
13
14
  */
14
15
  console.error("Can't import server code in the client!");
15
16
  export {};