Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/api/public-api/classes/Devvit.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

### addCustomPostType()

:::warning Deprecation notice
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30.
:::

> `static` **addCustomPostType**(`customPostType`): `void`

Add a custom post type for your app.
Expand All @@ -43,6 +47,7 @@ The custom post type to add.
```ts
import { Devvit, useState } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Counter',
description: 'A simple click counter post.',
Expand Down
1 change: 1 addition & 0 deletions docs/blocks/button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ A button that increments a counter
```tsx
import { Devvit, useState } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Say Hello',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions docs/blocks/image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ A button that increments a counter
```tsx
import { Devvit, useState } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Say Hello',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions docs/capabilities/blocks/app_image_assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const render: Devvit.CustomPostComponent = () => {
);
};

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'My custom post',
description: 'Test custom post for showing a custom asset!',
Expand Down
6 changes: 6 additions & 0 deletions docs/capabilities/blocks/dimensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ You can use dimensions to:

## Getting dimensions

:::warning Deprecation notice
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30.
:::

Dimension information is specified in density-independent pixels. These pixel units are located on the context object.

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

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

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Name',
render: (_context) => {
Expand Down
1 change: 1 addition & 0 deletions docs/capabilities/blocks/working_with_useasync.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const App = () => {
};

//add your custom post
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'AppName',
description: 'Using useAsync with XKCD API',
Expand Down
1 change: 1 addition & 0 deletions docs/capabilities/blocks/working_with_useinterval.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function getCurrentTime() {
return `${hours}:${minutes}:${seconds}`;
}

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Clock',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions docs/capabilities/blocks/working_with_usestate.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ const CountPage: Devvit.BlockComponent<Props> = ({ navigate, setCount, count },
};

//add your custom post
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'AppName',
description: 'Navigate between pages and count!',
Expand Down
2 changes: 2 additions & 0 deletions docs/capabilities/client/forms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ A form lets your app ask users to input and submit data. Forms can be defined wi
import { Devvit, useState, useForm } from '@devvit/public-api';

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

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Multi-step Form',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions docs/capabilities/client/navigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ When linking to Reddit content, the navigation function requires the app account
});

// Interactive post with navigation
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Navigation Post',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions docs/capabilities/client/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Client-side effects enable your Devvit app to provide interactive feedback and n
import { Devvit } from '@devvit/public-api';

// In a custom post component
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Interactive Post',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions docs/capabilities/client/toasts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Toasts will not work from scheduled jobs or triggers.
});

// Example in blocks
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'My Custom Post',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions docs/capabilities/server/cache-helper.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ Here’s a way to set up in-app caching instead of using scheduler or interval t
// other capabilities
});

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Name',
render: (context) => {
Expand Down
2 changes: 2 additions & 0 deletions docs/capabilities/server/post-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ To update post data after creation, fetch the post and use the `setPostData()` m
```ts title="main.tsx"
import { Devvit, useForm } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'InteractivePost',
render: (context) => {
Expand Down Expand Up @@ -378,6 +379,7 @@ Post data is available through `context.postData` in both client and server cont
```tsx title="main.tsx"
import { Devvit } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'MyCustomPost',
render: (context) => {
Expand Down
2 changes: 2 additions & 0 deletions docs/capabilities/server/settings-and-secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ Settings can be retrieved from within your app.
});

// Access in custom post type
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'ConfigurablePost',
render: (context) => {
Expand Down Expand Up @@ -620,6 +621,7 @@ Here's a complete example showing both secrets and subreddit settings in action:
return data.choices[0]?.message?.content || 'No response';
}

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'AI Assistant',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions docs/earn-money/payments/support_this_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { usePayments, useProducts } from '@devvit/payments';
import { ProductButton } from '@devvit/payments/helpers/ProductButton';
import { Devvit } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
render: (context) => {
const { products } = useProducts(context);
Expand Down
1 change: 1 addition & 0 deletions docs/guides/tools/devvit_cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ $ npx devvit create icons "src/my-icons.ts"
import { Devvit } from '@devvit/public-api';
import Icons from './my-icons.ts';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'my-custom-post',
render: (_context) => {
Expand Down
5 changes: 5 additions & 0 deletions versioned_docs/version-0.11/api/public-api/classes/Devvit.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

## Methods

:::warning Deprecation notice
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30.
:::

<a id="addcustomposttype"></a>

### addCustomPostType()
Expand All @@ -43,6 +47,7 @@ The custom post type to add.
```ts
import { Devvit, useState } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Counter',
description: 'A simple click counter post.',
Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.11/app_image_assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const render: Devvit.CustomPostComponent = () => {
);
};

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'My custom post',
description: 'Test custom post for showing a custom asset!',
Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.11/blocks/button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ A button that increments a counter
```tsx
import { Devvit, useState } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Say Hello',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.11/blocks/image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ A button that increments a counter
```tsx
import { Devvit, useState } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Say Hello',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.11/capabilities/adding-links.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ import { Devvit } from '@devvit/public-api';
Devvit.configure({ redditAPI: true });

// Interactive post definition
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Name',
render: (context) => {
Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.11/capabilities/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Devvit.configure({
// other capabilities
});

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Name',
render: (context) => {
Expand Down
2 changes: 2 additions & 0 deletions versioned_docs/version-0.11/capabilities/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This example shows an interactive post with a text label and a button that trigg
```tsx
import { Devvit, useState, useForm } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'TemplateName',
render: (context) => {
Expand Down Expand Up @@ -522,6 +523,7 @@ Devvit.configure({
redditAPI: true,
});

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Multi-step Form',
render: (context) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ async function fetchResponse(context: Devvit.Context): Promise<string> {
}
}

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Devvit - Ask GPT',
render: (context) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Devvit.configure({
http: true,
});

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Random Number Generator',
render: () => {
Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.11/capabilities/userActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Devvit.addMenuItem({
},
});

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Favorite color post',
render: (context) => {
Expand Down
4 changes: 4 additions & 0 deletions versioned_docs/version-0.11/custom_post_form.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Copy and paste the following code snippets into your `main.tsx` file below the i
6. Create a custom post component.

```jsx

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'My Custom Post Type',
render: () => {
Expand All @@ -76,6 +78,7 @@ Devvit.addCustomPostType({
```jsx
import { Devvit, useState } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'My Custom Post Type',
render: (context) => {
Expand All @@ -100,6 +103,7 @@ Devvit.addCustomPostType({
```tsx
import { Devvit, useState, useForm } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'My Custom Post Type',
render: (context) => {
Expand Down
5 changes: 5 additions & 0 deletions versioned_docs/version-0.11/custom_post_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Want to know more about custom posts? You’re in the right place. This page wil

Custom posts need a definition for the post type and the post loading state:

:::warning Deprecation notice
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30.
:::

- The `addCustomPostType()` method defines the custom post type.
- The `submitPost()` method instantiates the post and defines the loading state.

Expand All @@ -30,6 +34,7 @@ The UI is wrapped in `<blocks>`. If you don’t include them, `<blocks>` will be
**Example**

```tsx
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'My Custom Post Type',
description: 'A big hello text.',
Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.11/devvit.kit.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Once @devvit/kit is installed, you can use the components in your app. This exam
import { Devvit } from '@devvit/public-api';
import { Columns } from '@devvit/kit';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Columns static content',
render: () => {
Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.11/devvit_cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ $ devvit create icons "src/my-icons.ts"
import { Devvit } from "@devvit/public-api";
import Icons from "./my-icons.ts";

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: "my-custom-post",
render: (_context) => {
Expand Down
5 changes: 5 additions & 0 deletions versioned_docs/version-0.11/devvit_for_pythonistas.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Let's start with a simple "Hello World" app using the Devvit playground, which i
```tsx
import { Devvit, useState } from '@devvit/public-api';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Say Hello',
render: (context) => {
Expand Down Expand Up @@ -126,6 +127,10 @@ Let's break down the code you just wrote. Think of Typescript as Python's cousin

### Creating an interactive post

:::warning Deprecation notice
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30.
:::

- **`Devvit.addCustomPostType({...})`:** This tells Devvit you're creating a new type of post on Reddit.

- **`name: 'Say Hello'`:** This gives your post type a name.
Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.11/devvit_kit.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Once @devvit/kit is installed, you can use the components in your app. This exam
import { Devvit } from '@devvit/public-api';
import { Columns } from '@devvit/kit';

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Columns static content',
render: () => {
Expand Down
2 changes: 2 additions & 0 deletions versioned_docs/version-0.11/dimensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Dimension information is specified in density-independent pixels. These pixel un
This example shows a custom post that specifies dimensions.

```tsx
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Dimensions app',
render: (context) => {
Expand All @@ -53,6 +54,7 @@ export const MyHeader: Devvit.BlockComponent = (props, context) => {
);
};

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
Devvit.addCustomPostType({
name: 'Name',
render: (_context) => {
Expand Down
Loading