Skip to content
Open
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
3 changes: 2 additions & 1 deletion docs/blocks/button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example. View the announcement below this example.
Devvit.addCustomPostType({
name: 'Say Hello',
render: (context) => {
Expand All @@ -180,3 +180,4 @@ Devvit.addCustomPostType({
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
4 changes: 3 additions & 1 deletion docs/blocks/image.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ 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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.

Devvit.addCustomPostType({
name: 'Say Hello',
render: (context) => {
Expand All @@ -200,6 +201,7 @@ Devvit.addCustomPostType({
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

### Example

Expand Down
3 changes: 2 additions & 1 deletion docs/capabilities/blocks/app_image_assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const render: Devvit.CustomPostComponent = () => {
);
};

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'My custom post',
description: 'Test custom post for showing a custom asset!',
Expand All @@ -86,6 +86,7 @@ Devvit.addMenuItem({
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

4. Run `devvit upload`.
5. Install or update your app on your subreddit.
Expand Down
8 changes: 5 additions & 3 deletions docs/capabilities/blocks/dimensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You can use dimensions to:
## Getting dimensions

:::warning Deprecation notice
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30.
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30. [View announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
:::

Dimension information is specified in density-independent pixels. These pixel units are located on the context object.
Expand All @@ -32,14 +32,15 @@ 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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'Dimensions app',
render: (context) => {
return context.dimensions?.width < 300 ? <SmallApp /> : <BigApp />;
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

This example shows that dimensions always references the root element, even if it’s in a child element. Although `MyHeader` is a component within the root element, this does not change the custom post dimensions provided in the context object.

Expand All @@ -58,14 +59,15 @@ export const MyHeader: Devvit.BlockComponent = (props, context) => {
);
};

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'Name',
render: (_context) => {
return <MyHeader />;
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

## Limitations

Expand Down
3 changes: 2 additions & 1 deletion docs/capabilities/blocks/working_with_useasync.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,14 @@ const App = () => {
};

//add your custom post
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'AppName',
description: 'Using useAsync with XKCD API',
render: App,
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

## When to use useAsync and useState

Expand Down
3 changes: 2 additions & 1 deletion docs/capabilities/blocks/working_with_useinterval.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function getCurrentTime() {
return `${hours}:${minutes}:${seconds}`;
}

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'Clock',
render: (context) => {
Expand All @@ -77,3 +77,4 @@ Devvit.addCustomPostType({

export default Devvit;
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
3 changes: 2 additions & 1 deletion docs/capabilities/blocks/working_with_usestate.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,14 @@ 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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'AppName',
description: 'Navigate between pages and count!',
render: App,
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

In this example, when a user session ends, state will no longer be available to the app. To save and persist data between sessions you will need to [store data server-side via the Redis](../server/redis).

Expand Down
6 changes: 4 additions & 2 deletions docs/capabilities/client/forms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'FormExample',
render: (context) => {
Expand Down Expand Up @@ -139,6 +139,7 @@ A form lets your app ask users to input and submit data. Forms can be defined wi
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

### Methods

Expand Down Expand Up @@ -1049,7 +1050,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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'Multi-step Form',
render: (context) => {
Expand Down Expand Up @@ -1133,6 +1134,7 @@ Below is a collection of common use cases and patterns.
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
</TabItem>
</Tabs>

Expand Down
3 changes: 2 additions & 1 deletion docs/capabilities/client/navigation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'Navigation Post',
render: (context) => {
Expand Down Expand Up @@ -132,6 +132,7 @@ When linking to Reddit content, the navigation function requires the app account
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

### Parameters

Expand Down
3 changes: 2 additions & 1 deletion docs/capabilities/client/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'Interactive Post',
render: (context) => {
Expand Down Expand Up @@ -82,6 +82,7 @@ Client-side effects enable your Devvit app to provide interactive feedback and n
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

</TabItem>
</Tabs>
Expand Down
3 changes: 2 additions & 1 deletion docs/capabilities/client/toasts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'My Custom Post',
render: (context) => {
Expand All @@ -111,6 +111,7 @@ Toasts will not work from scheduled jobs or triggers.
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

### Parameters

Expand Down
3 changes: 2 additions & 1 deletion docs/capabilities/server/cache-helper.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'Name',
render: (context) => {
Expand Down Expand Up @@ -280,5 +280,6 @@ Here’s a way to set up in-app caching instead of using scheduler or interval t

export default Devvit;
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
</TabItem>
</Tabs>
6 changes: 4 additions & 2 deletions docs/capabilities/server/post-data.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'InteractivePost',
render: (context) => {
Expand Down Expand Up @@ -350,6 +350,7 @@ To update post data after creation, fetch the post and use the `setPostData()` m
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
</TabItem>
</Tabs>

Expand Down Expand Up @@ -379,7 +380,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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'MyCustomPost',
render: (context) => {
Expand All @@ -392,6 +393,7 @@ Post data is available through `context.postData` in both client and server cont
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
</TabItem>
</Tabs>

Expand Down
6 changes: 4 additions & 2 deletions docs/capabilities/server/settings-and-secrets.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'ConfigurablePost',
render: (context) => {
Expand All @@ -312,6 +312,7 @@ Settings can be retrieved from within your app.
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
</TabItem>
</Tabs>

Expand Down Expand Up @@ -621,7 +622,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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'AI Assistant',
render: (context) => {
Expand All @@ -645,6 +646,7 @@ Here's a complete example showing both secrets and subreddit settings in action:

export default Devvit;
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
</TabItem>
</Tabs>

Expand Down
3 changes: 2 additions & 1 deletion docs/earn-money/payments/support_this_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
render: (context) => {
const { products } = useProducts(context);
Expand All @@ -83,6 +83,7 @@ Devvit.addCustomPostType({
);
})
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

## Example

Expand Down
3 changes: 2 additions & 1 deletion docs/guides/tools/devvit_cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'my-custom-post',
render: (_context) => {
Expand All @@ -52,6 +52,7 @@ Devvit.addCustomPostType({

export default Devvit;
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

### devvit help

Expand Down
5 changes: 3 additions & 2 deletions versioned_docs/version-0.11/api/public-api/classes/Devvit.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
## Methods

:::warning Deprecation notice
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30.
`addCustomPostType` is deprecated and will be unsupported. It will not work after June 30. [View announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
:::

<a id="addcustomposttype"></a>
Expand Down Expand Up @@ -47,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'Counter',
description: 'A simple click counter post.',
Expand All @@ -63,6 +63,7 @@ Devvit.addCustomPostType({
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

---

Expand Down
3 changes: 2 additions & 1 deletion versioned_docs/version-0.11/app_image_assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const render: Devvit.CustomPostComponent = () => {
);
};

// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'My custom post',
description: 'Test custom post for showing a custom asset!',
Expand All @@ -86,6 +86,7 @@ Devvit.addMenuItem({
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)

4. Run `devvit upload`.
5. Install or update your app on your subreddit.
Expand Down
3 changes: 2 additions & 1 deletion versioned_docs/version-0.11/blocks/button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +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.
// addCustomPostType() is deprecated and will be unsupported. It will not work after June 30. View the announcement below this example.
Devvit.addCustomPostType({
name: 'Say Hello',
render: (context) => {
Expand All @@ -180,3 +180,4 @@ Devvit.addCustomPostType({
},
});
```
[View `addCustomPostType` deprecation announcement.](https://www.reddit.com/r/Devvit/comments/1r3xcm2/devvit_web_and_the_future_of_devvit/)
Loading
Loading