Skip to content

Commit 2c4bb8c

Browse files
Added Blocks addCustomPostType deprecation notice (#56)
<!-- If this pull request closes an issue, please mention the issue number below --> Closes # DR-412 ## 💸 TL;DR Blocks `addCustomPostType` is being deprecated. This PR adds notices for this. ## 📜 Details [Design Doc](<!-- insert Google Doc link here if applicable -->) [Jira](https://reddit.atlassian.net/issues?filter=-1&selectedIssue=DR-412) <!-- Add additional details required for the PR: breaking changes, screenshots, external dependency changes --> ## 🧪 Testing Steps / Validation <!-- add details on how this PR has been tested, include reproductions and screenshots where applicable --> ## ✅ Checks <!-- Make sure your pr passes the CI checks and do check the following fields as needed - --> - [ ] CI tests (if present) are passing - [ ] Adheres to code style for repo - [ ] Contributor License Agreement (CLA) completed if not a Reddit employee
1 parent 51561e0 commit 2c4bb8c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+112
-0
lines changed

docs/api/public-api/classes/Devvit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222

2323
### addCustomPostType()
2424

25+
:::warning Deprecation notice
26+
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30.
27+
:::
28+
2529
> `static` **addCustomPostType**(`customPostType`): `void`
2630
2731
Add a custom post type for your app.
@@ -43,6 +47,7 @@ The custom post type to add.
4347
```ts
4448
import { Devvit, useState } from '@devvit/public-api';
4549

50+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
4651
Devvit.addCustomPostType({
4752
name: 'Counter',
4853
description: 'A simple click counter post.',

docs/blocks/button.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ A button that increments a counter
163163
```tsx
164164
import { Devvit, useState } from '@devvit/public-api';
165165

166+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
166167
Devvit.addCustomPostType({
167168
name: 'Say Hello',
168169
render: (context) => {

docs/blocks/image.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ A button that increments a counter
183183
```tsx
184184
import { Devvit, useState } from '@devvit/public-api';
185185

186+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
186187
Devvit.addCustomPostType({
187188
name: 'Say Hello',
188189
render: (context) => {

docs/capabilities/blocks/app_image_assets.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ const render: Devvit.CustomPostComponent = () => {
6565
);
6666
};
6767

68+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
6869
Devvit.addCustomPostType({
6970
name: 'My custom post',
7071
description: 'Test custom post for showing a custom asset!',

docs/capabilities/blocks/dimensions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ You can use dimensions to:
1515

1616
## Getting dimensions
1717

18+
:::warning Deprecation notice
19+
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30.
20+
:::
21+
1822
Dimension information is specified in density-independent pixels. These pixel units are located on the context object.
1923

2024
| Dimension | Description |
@@ -28,6 +32,7 @@ Dimension information is specified in density-independent pixels. These pixel un
2832
This example shows a custom post that specifies dimensions.
2933

3034
```tsx
35+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
3136
Devvit.addCustomPostType({
3237
name: 'Dimensions app',
3338
render: (context) => {
@@ -53,6 +58,7 @@ export const MyHeader: Devvit.BlockComponent = (props, context) => {
5358
);
5459
};
5560

61+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
5662
Devvit.addCustomPostType({
5763
name: 'Name',
5864
render: (_context) => {

docs/capabilities/blocks/working_with_useasync.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ const App = () => {
154154
};
155155

156156
//add your custom post
157+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
157158
Devvit.addCustomPostType({
158159
name: 'AppName',
159160
description: 'Using useAsync with XKCD API',

docs/capabilities/blocks/working_with_useinterval.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function getCurrentTime() {
5959
return `${hours}:${minutes}:${seconds}`;
6060
}
6161

62+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
6263
Devvit.addCustomPostType({
6364
name: 'Clock',
6465
render: (context) => {

docs/capabilities/blocks/working_with_usestate.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ const CountPage: Devvit.BlockComponent<Props> = ({ navigate, setCount, count },
144144
};
145145

146146
//add your custom post
147+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
147148
Devvit.addCustomPostType({
148149
name: 'AppName',
149150
description: 'Navigate between pages and count!',

docs/capabilities/client/forms.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ A form lets your app ask users to input and submit data. Forms can be defined wi
7777
import { Devvit, useState, useForm } from '@devvit/public-api';
7878

7979
// Interactive post with form
80+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
8081
Devvit.addCustomPostType({
8182
name: 'FormExample',
8283
render: (context) => {
@@ -1048,6 +1049,7 @@ Below is a collection of common use cases and patterns.
10481049
redditAPI: true,
10491050
});
10501051

1052+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
10511053
Devvit.addCustomPostType({
10521054
name: 'Multi-step Form',
10531055
render: (context) => {

docs/capabilities/client/navigation.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ When linking to Reddit content, the navigation function requires the app account
9393
});
9494

9595
// Interactive post with navigation
96+
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
9697
Devvit.addCustomPostType({
9798
name: 'Navigation Post',
9899
render: (context) => {

0 commit comments

Comments
 (0)