@devvit/server 0.13.7 → 0.13.8-next-2026-07-07-16-52-11-2d38e4efd.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/server",
3
- "version": "0.13.7",
3
+ "version": "0.13.8-next-2026-07-07-16-52-11-2d38e4efd.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,18 +30,17 @@
30
30
  "test:unit-with-coverage": "vitest run --coverage"
31
31
  },
32
32
  "dependencies": {
33
- "@devvit/protos": "0.13.7",
34
- "@devvit/public-api": "0.13.7",
35
- "@devvit/shared": "0.13.7",
36
- "@devvit/shared-types": "0.13.7"
33
+ "@devvit/protos": "0.13.8-next-2026-07-07-16-52-11-2d38e4efd.0",
34
+ "@devvit/shared": "0.13.8-next-2026-07-07-16-52-11-2d38e4efd.0",
35
+ "@devvit/shared-types": "0.13.8-next-2026-07-07-16-52-11-2d38e4efd.0"
37
36
  },
38
37
  "devDependencies": {
39
- "@devvit/repo-tools": "0.13.7",
40
- "@devvit/tsconfig": "0.13.7",
38
+ "@devvit/repo-tools": "0.13.8-next-2026-07-07-16-52-11-2d38e4efd.0",
39
+ "@devvit/tsconfig": "0.13.8-next-2026-07-07-16-52-11-2d38e4efd.0",
41
40
  "@types/node": "20.14.12",
42
41
  "eslint": "9.11.1",
43
42
  "typescript": "5.8.3",
44
43
  "vitest": "4.1.0"
45
44
  },
46
- "gitHead": "0d74a011329bf736fdc2deb9e9bacc555b0eea1b"
45
+ "gitHead": "4eb74d95ef13ee856127c7c8f3b169c05e40f053"
47
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server-context.d.ts","sourceRoot":"","sources":["../src/server-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAI5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,2DAA2D;AAC3D,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG;IAGlC,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,qEAAqE;AACrE,KAAK,OAAO,GAAG;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;CAAE,CAAC;AAInE,gCAAgC;AAChC,eAAO,IAAI,OAAO,GAAI,SAAS,QAAQ,CAAC,OAAO,CAAC,KAAG,OAkBlD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,OAAO,OAAO,GAAG,IAAI,CAEnD"}
1
+ {"version":3,"file":"server-context.d.ts","sourceRoot":"","sources":["../src/server-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,2DAA2D;AAC3D,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG;IAGlC,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,qEAAqE;AACrE,KAAK,OAAO,GAAG;IAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;CAAE,CAAC;AAInE,gCAAgC;AAChC,eAAO,IAAI,OAAO,GAAI,SAAS,QAAQ,CAAC,OAAO,CAAC,KAAG,OAuBlD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,OAAO,OAAO,GAAG,IAAI,CAEnD"}
package/server-context.js CHANGED
@@ -1,23 +1,25 @@
1
- // to-do: inline a copy here. this is the only dependency on @devvit/public-api
2
- // and it's a functional one, not a devDependencies.
3
- import { getContextFromMetadata } from '@devvit/public-api/devvit/internals/context.js';
4
- import { T1, T2 as asT2, T3 as asT3, T5 as asT5 } from '@devvit/shared';
5
1
  import { Header, headerPrefix } from '@devvit/shared-types/Header.js';
2
+ import { BaseContextFromMetadata } from '@devvit/shared-types/server/base-context.js';
6
3
  const nonDevvitMetadataHeaders = new Set([Header.Traceparent, Header.Tracestate]);
7
4
  /** Constructs a new Context. */
8
5
  export let Context = (headers) => {
9
6
  const meta = metaFromIncomingMessage(headers);
10
- const publicApiContext = getContextFromMetadata(meta, meta[Header.Post]?.values[0], meta[Header.Comment]?.values[0]);
7
+ const baseCtx = BaseContextFromMetadata(meta, meta[Header.Post]?.values[0], meta[Header.Comment]?.values[0]);
11
8
  return {
12
- ...publicApiContext,
13
- commentId: publicApiContext.commentId ? T1(publicApiContext.commentId) : undefined,
14
- subredditId: asT5(publicApiContext.subredditId),
15
- userId: publicApiContext.userId ? asT2(publicApiContext.userId) : undefined,
16
- postId: publicApiContext.postId ? asT3(publicApiContext.postId) : undefined,
17
- subredditName: publicApiContext.subredditName, // This is guaranteed to be defined
18
- snoovatar: publicApiContext.snoovatar,
19
- username: publicApiContext.username,
20
- loid: publicApiContext.loid,
9
+ // `cache` lifetime matches `Context` so nothing to init here.
10
+ appName: baseCtx.appName,
11
+ appSlug: baseCtx.appSlug,
12
+ appVersion: baseCtx.appVersion,
13
+ commentId: baseCtx.commentId,
14
+ loid: baseCtx.loid,
15
+ postData: baseCtx.postData,
16
+ postId: baseCtx.postId,
17
+ snoovatar: baseCtx.snoovatar,
18
+ subredditId: baseCtx.subredditId,
19
+ subredditName: baseCtx.subredditName,
20
+ userId: baseCtx.userId,
21
+ username: baseCtx.username,
22
+ metadata: meta,
21
23
  };
22
24
  };
23
25
  /**