Skip to content

Commit

Permalink
Add wasm asset support for theme app extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjustriley committed Jul 22, 2024
1 parent 03be941 commit 2387329
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
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

0 comments on commit 2387329

Please sign in to comment.