diff --git a/docs/capabilities/devvit-web/devvit_web_overview.mdx b/docs/capabilities/devvit-web/devvit_web_overview.mdx index 6db6ba3cd..9dab7931c 100644 --- a/docs/capabilities/devvit-web/devvit_web_overview.mdx +++ b/docs/capabilities/devvit-web/devvit_web_overview.mdx @@ -39,6 +39,7 @@ As with most experimental features, there are some caveats. | Single request and single response handling only | Streaming or chunked responses and websockets are not supported. Long-polling is supported if it's under the max request time. | | No external requests from your client | You can't have any external requests other than the app's webview domain. All backend responses are locked down to the webview domain via CSP. (Your backend can make external fetch requests though.) | | localStorage clears on app updates | The iframe URL changes with each app version, so `localStorage` data is lost when you publish an update. Use [Redis](../server/redis.mdx) for data that needs to persist across app versions. | +| App bundle size | Your app bundle can be at most 32 MB. Larger bundles can't be loaded, so `devvit upload`, `devvit playtest`, and `devvit publish` reject them. See [App bundle size](#app-bundle-size). | Devvit Web still has the same technical requirements: @@ -46,8 +47,20 @@ Devvit Web still has the same technical requirements: - Max request time: 30s - Max payload size: 4MB - Max response size: 10MB +- Max app bundle size: 32MB - HTML/CSS/JS only +### App bundle size + +Your app bundle contains your compiled server code and its source maps. Your client files (HTML, CSS, JavaScript, images, and other assets) are uploaded separately and only add a short reference per file to the bundle, so they don't count toward the limit. + +If your bundle is larger than 32 MB, the CLI stops the upload and lists the largest parts of the bundle, such as your server code and server source map. To shrink your bundle: + +- Avoid importing large files (JSON data, images, fonts, WASM, and similar) into your server code. Serve them as static client assets or store the data elsewhere. +- Remove dependencies your server doesn't use, or replace large ones with lighter alternatives. +- Enable minification in your server build. +- Keep source maps small: don't inline them into your code, and consider turning off `sourcesContent`. + ## Devvit Web components Devvit Web uses endpoints between the client and server to make communication similar to standard web apps. A Devvit Web app has three components: diff --git a/docs/guides/faq.mdx b/docs/guides/faq.mdx index 35a76202d..a720b56a9 100644 --- a/docs/guides/faq.mdx +++ b/docs/guides/faq.mdx @@ -513,6 +513,7 @@ The main limits are: - [Redis](../capabilities/server/redis.mdx): 5 GB max storage per installation for published apps (100 MB for unpublished apps), 5 MB max request size, and 40,000 max commands per second. - [Devvit Web](../capabilities/devvit-web/devvit_web_overview.mdx): 30 seconds per request, a 4 MB request payload, and a 10 MB response. +- [App bundle](../capabilities/devvit-web/devvit_web_overview.mdx#app-bundle-size): 32 MB for your compiled server code and source maps. Client assets don't count toward it. - [Post data](../capabilities/server/post-data.mdx): 2 KB per post. - [Settings and secrets](../capabilities/server/settings-and-secrets.mdx): 2 KB per setting value. - [Realtime](../capabilities/realtime/overview.md): 1 MB maximum message payload and 100 messages per second per installation. diff --git a/versioned_docs/version-0.15/capabilities/devvit-web/devvit_web_overview.mdx b/versioned_docs/version-0.15/capabilities/devvit-web/devvit_web_overview.mdx index 6db6ba3cd..9dab7931c 100644 --- a/versioned_docs/version-0.15/capabilities/devvit-web/devvit_web_overview.mdx +++ b/versioned_docs/version-0.15/capabilities/devvit-web/devvit_web_overview.mdx @@ -39,6 +39,7 @@ As with most experimental features, there are some caveats. | Single request and single response handling only | Streaming or chunked responses and websockets are not supported. Long-polling is supported if it's under the max request time. | | No external requests from your client | You can't have any external requests other than the app's webview domain. All backend responses are locked down to the webview domain via CSP. (Your backend can make external fetch requests though.) | | localStorage clears on app updates | The iframe URL changes with each app version, so `localStorage` data is lost when you publish an update. Use [Redis](../server/redis.mdx) for data that needs to persist across app versions. | +| App bundle size | Your app bundle can be at most 32 MB. Larger bundles can't be loaded, so `devvit upload`, `devvit playtest`, and `devvit publish` reject them. See [App bundle size](#app-bundle-size). | Devvit Web still has the same technical requirements: @@ -46,8 +47,20 @@ Devvit Web still has the same technical requirements: - Max request time: 30s - Max payload size: 4MB - Max response size: 10MB +- Max app bundle size: 32MB - HTML/CSS/JS only +### App bundle size + +Your app bundle contains your compiled server code and its source maps. Your client files (HTML, CSS, JavaScript, images, and other assets) are uploaded separately and only add a short reference per file to the bundle, so they don't count toward the limit. + +If your bundle is larger than 32 MB, the CLI stops the upload and lists the largest parts of the bundle, such as your server code and server source map. To shrink your bundle: + +- Avoid importing large files (JSON data, images, fonts, WASM, and similar) into your server code. Serve them as static client assets or store the data elsewhere. +- Remove dependencies your server doesn't use, or replace large ones with lighter alternatives. +- Enable minification in your server build. +- Keep source maps small: don't inline them into your code, and consider turning off `sourcesContent`. + ## Devvit Web components Devvit Web uses endpoints between the client and server to make communication similar to standard web apps. A Devvit Web app has three components: diff --git a/versioned_docs/version-0.15/guides/faq.mdx b/versioned_docs/version-0.15/guides/faq.mdx index 35a76202d..a720b56a9 100644 --- a/versioned_docs/version-0.15/guides/faq.mdx +++ b/versioned_docs/version-0.15/guides/faq.mdx @@ -513,6 +513,7 @@ The main limits are: - [Redis](../capabilities/server/redis.mdx): 5 GB max storage per installation for published apps (100 MB for unpublished apps), 5 MB max request size, and 40,000 max commands per second. - [Devvit Web](../capabilities/devvit-web/devvit_web_overview.mdx): 30 seconds per request, a 4 MB request payload, and a 10 MB response. +- [App bundle](../capabilities/devvit-web/devvit_web_overview.mdx#app-bundle-size): 32 MB for your compiled server code and source maps. Client assets don't count toward it. - [Post data](../capabilities/server/post-data.mdx): 2 KB per post. - [Settings and secrets](../capabilities/server/settings-and-secrets.mdx): 2 KB per setting value. - [Realtime](../capabilities/realtime/overview.md): 1 MB maximum message payload and 100 messages per second per installation.