Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wasm asset support for theme app extensions #4229

Merged
merged 1 commit into from
Jul 22, 2024
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
6 changes: 6 additions & 0 deletions .changeset/breezy-clouds-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/app': minor
---


Introduce `.wasm` asset support for theme app extensions
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const BUNDLE_SIZE_LIMIT = BUNDLE_SIZE_LIMIT_MB * megabytes
const LIQUID_SIZE_LIMIT_KB = 500
const LIQUID_SIZE_LIMIT = LIQUID_SIZE_LIMIT_KB * kilobytes

const SUPPORTED_ASSET_EXTS = ['.jpg', '.jpeg', '.json', '.js', '.css', '.png', '.svg']
const SUPPORTED_ASSET_EXTS = ['.jpg', '.jpeg', '.json', '.js', '.css', '.png', '.svg', '.wasm']
const SUPPORTED_LOCALE_EXTS = ['.json']
const SUPPORTED_EXTS: {[dirname: string]: FilenameValidation} = {
assets: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export async function fileServerMiddleware(
'.html': 'text/html',
'.js': 'text/javascript',
'.json': 'application/json',
'.wasm': 'application/wasm',
'.css': 'text/css',
'.png': 'image/png',
'.jpg': 'image/jpeg',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ThemeAppExtension < Default
SUPPORTED_BUCKETS = %w(assets blocks snippets locales)
BUNDLE_SIZE_LIMIT = 10 * 1024 * 1024 # 10MB
LIQUID_SIZE_LIMIT = 100 * 1024 # 100kb
SUPPORTED_ASSET_EXTS = %w(.jpg .jpeg .js .json .css .png .svg)
SUPPORTED_ASSET_EXTS = %w(.jpg .jpeg .js .json .css .png .svg .wasm)
SUPPORTED_LOCALE_EXTS = %w(.json)

def create(directory_name, context, getting_started: false)
Expand Down