@devvit/ui-renderer 0.10.21-next-2024-05-13-e62a4282b.0 → 0.10.21-next-2024-05-13-66644c557.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.
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DevvitSubredditMetadata, LinkedBundle } from '@devvit/protos';
|
|
2
|
+
/**
|
|
3
|
+
* @arg dx The static "DX_Bundle" LinkedBundle embedded in the post body. Even
|
|
4
|
+
* skinnier than a skinny LinkedBundle, only defining hostname and
|
|
5
|
+
* provides. See LinksAndCommentsSubmitCustomPost(). This should always
|
|
6
|
+
* be available but element properties can be undefined.
|
|
7
|
+
* @arg meta The current subreddit manifest.
|
|
8
|
+
* @return true if an app's @devvit/public-api version supports
|
|
9
|
+
* RenderPostContent(UIRequest), false if only
|
|
10
|
+
* RenderPost(RenderPostRequest) is supported, undefined if unknown
|
|
11
|
+
* (caller should choose a safe default).
|
|
12
|
+
*/
|
|
13
|
+
export declare function apiVersionSupportsUIRequest(dx: Readonly<{
|
|
14
|
+
hostname: string;
|
|
15
|
+
} & Partial<LinkedBundle>> | undefined, meta: Readonly<DevvitSubredditMetadata> | undefined): boolean | undefined;
|
|
16
|
+
//# sourceMappingURL=api-version-util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-version-util.d.ts","sourceRoot":"","sources":["../../library/src/client/api-version-util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK5E;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,QAAQ,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,SAAS,EACtE,IAAI,EAAE,QAAQ,CAAC,uBAAuB,CAAC,GAAG,SAAS,GAClD,OAAO,GAAG,SAAS,CAOrB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { compareVersions } from 'compare-versions';
|
|
2
|
+
// to-do: delete when RenderPost is not used. Don't forget to delete
|
|
3
|
+
// compare-versions too.
|
|
4
|
+
/**
|
|
5
|
+
* @arg dx The static "DX_Bundle" LinkedBundle embedded in the post body. Even
|
|
6
|
+
* skinnier than a skinny LinkedBundle, only defining hostname and
|
|
7
|
+
* provides. See LinksAndCommentsSubmitCustomPost(). This should always
|
|
8
|
+
* be available but element properties can be undefined.
|
|
9
|
+
* @arg meta The current subreddit manifest.
|
|
10
|
+
* @return true if an app's @devvit/public-api version supports
|
|
11
|
+
* RenderPostContent(UIRequest), false if only
|
|
12
|
+
* RenderPost(RenderPostRequest) is supported, undefined if unknown
|
|
13
|
+
* (caller should choose a safe default).
|
|
14
|
+
*/
|
|
15
|
+
export function apiVersionSupportsUIRequest(dx, meta) {
|
|
16
|
+
if (!dx || !meta)
|
|
17
|
+
return;
|
|
18
|
+
const skinny = meta.installedRemoteApps.find((skinny) => skinny.hostname === dx.hostname);
|
|
19
|
+
if (!skinny)
|
|
20
|
+
return;
|
|
21
|
+
const version = skinny.buildInfo?.dependencies['@devvit/public-api'];
|
|
22
|
+
if (!version)
|
|
23
|
+
return;
|
|
24
|
+
return compareVersions(version, '0.10.19') >= 0;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-version-util.test.d.ts","sourceRoot":"","sources":["../../library/src/client/api-version-util.test.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/ui-renderer",
|
|
3
|
-
"version": "0.10.21-next-2024-05-13-
|
|
3
|
+
"version": "0.10.21-next-2024-05-13-66644c557.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,11 +58,12 @@
|
|
|
58
58
|
},
|
|
59
59
|
"types": "./index.d.ts",
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@devvit/protos": "0.10.21-next-2024-05-13-
|
|
62
|
-
"@devvit/runtime-lite": "0.10.21-next-2024-05-13-
|
|
63
|
-
"@devvit/runtimes": "0.10.21-next-2024-05-13-
|
|
64
|
-
"@devvit/shared-types": "0.10.21-next-2024-05-13-
|
|
61
|
+
"@devvit/protos": "0.10.21-next-2024-05-13-66644c557.0",
|
|
62
|
+
"@devvit/runtime-lite": "0.10.21-next-2024-05-13-66644c557.0",
|
|
63
|
+
"@devvit/runtimes": "0.10.21-next-2024-05-13-66644c557.0",
|
|
64
|
+
"@devvit/shared-types": "0.10.21-next-2024-05-13-66644c557.0",
|
|
65
65
|
"@dotlottie/player-component": "2.7.2",
|
|
66
|
+
"compare-versions": "6.1.0",
|
|
66
67
|
"nice-grpc-web": "3.3.3",
|
|
67
68
|
"p-queue": "7.3.4",
|
|
68
69
|
"rxjs": "7.8.1"
|
|
@@ -89,9 +90,9 @@
|
|
|
89
90
|
"devDependencies": {
|
|
90
91
|
"@ampproject/filesize": "4.3.0",
|
|
91
92
|
"@devvit/eslint-config": "0.10.20",
|
|
92
|
-
"@devvit/public-api": "0.10.21-next-2024-05-13-
|
|
93
|
+
"@devvit/public-api": "0.10.21-next-2024-05-13-66644c557.0",
|
|
93
94
|
"@devvit/repo-tools": "0.10.20",
|
|
94
|
-
"@devvit/tsconfig": "0.10.21-next-2024-05-13-
|
|
95
|
+
"@devvit/tsconfig": "0.10.21-next-2024-05-13-66644c557.0",
|
|
95
96
|
"@lit-labs/ssr": "^2.2.3",
|
|
96
97
|
"@lit/localize": "0.11.4",
|
|
97
98
|
"@open-wc/testing-helpers": "2.3.0",
|
|
@@ -128,10 +129,10 @@
|
|
|
128
129
|
},
|
|
129
130
|
"filesize": {
|
|
130
131
|
"dist/devvit-custom-post.min.js": {
|
|
131
|
-
"gzip": "
|
|
132
|
-
"none": "
|
|
132
|
+
"gzip": "940 KB",
|
|
133
|
+
"none": "4260 KB"
|
|
133
134
|
}
|
|
134
135
|
},
|
|
135
136
|
"source": "./src/index.ts",
|
|
136
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "92873cfb6cdfec31597a7d20ef22a679cbafac06"
|
|
137
138
|
}
|