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

[stable] Increase extension locale file size limit #5026

Merged
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 .changeset/tidy-drinks-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/app': patch
---

Increase extension localization file size limit
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe('loadLocalesConfig', () => {

await mkdir(localesPath)
await writeFile(enDefault, JSON.stringify({hello: 'Hello'}))
const bigArray = new Array(5000).fill('a')
const bigArray = new Array(6000).fill('a')
await writeFile(es, JSON.stringify(bigArray))

// When
Expand Down Expand Up @@ -101,7 +101,7 @@ describe('loadLocalesConfig', () => {
const es = joinPath(localesPath, 'es.json')

await mkdir(localesPath)
const bigArray = JSON.stringify(new Array(3000).fill('a'))
const bigArray = JSON.stringify(new Array(4000).fill('a'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we have to increase this? We are only increasing the per file size limit, so was only expecting to see the above test changed ("Throws if one locale is too big") and not this one ("Throws if bundle is too big")?


await writeFile(en, JSON.stringify(bigArray))
await writeFile(es, JSON.stringify(bigArray))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {glob} from '@shopify/cli-kit/node/fs'
import {AbortError, BugError} from '@shopify/cli-kit/node/error'
import fs from 'fs'

const L10N_FILE_SIZE_LIMIT = 16 * 1024
const L10N_FILE_SIZE_LIMIT = 20 * 1024
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 20? Do we have any limit server-side?

const L10N_BUNDLE_SIZE_LIMIT = 256 * 1024

export async function loadLocalesConfig(extensionPath: string, extensionIdentifier: string) {
Expand Down
Loading