@gem-sdk/core 2.1.13-staging.15 → 2.1.13-staging.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -294,6 +294,8 @@ const RenderChildren = (props)=>{
|
|
|
294
294
|
const WrapRenderChildren = ({ uid, customProps }, codes)=>{
|
|
295
295
|
let liquid = '';
|
|
296
296
|
if (codes?.length) {
|
|
297
|
+
// Limit each child item of an element (e.g., marquee, ...) to ensure the total element size does not exceed 256KB.
|
|
298
|
+
const itemMaxSize = 200 / codes.length;
|
|
297
299
|
for(let i = 0; i < codes.length; i++){
|
|
298
300
|
const code = codes[i];
|
|
299
301
|
if (code) {
|
|
@@ -301,8 +303,7 @@ const WrapRenderChildren = ({ uid, customProps }, codes)=>{
|
|
|
301
303
|
// Fix limit 256kb
|
|
302
304
|
const textEncoder = new TextEncoder();
|
|
303
305
|
const size = newLiquid ? textEncoder.encode(newLiquid).length : 0;
|
|
304
|
-
|
|
305
|
-
if (Math.ceil(size / 1024) >= 50) {
|
|
306
|
+
if (Math.ceil(size / 1024) >= itemMaxSize) {
|
|
306
307
|
const fileName = `gp-section-snippet-${uid + i}`;
|
|
307
308
|
customProps.extraFiles[fileName] = code;
|
|
308
309
|
liquid += `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id, productSelectedVariant: productSelectedVariant, form: form %}`;
|
|
@@ -290,6 +290,8 @@ const RenderChildren = (props)=>{
|
|
|
290
290
|
const WrapRenderChildren = ({ uid, customProps }, codes)=>{
|
|
291
291
|
let liquid = '';
|
|
292
292
|
if (codes?.length) {
|
|
293
|
+
// Limit each child item of an element (e.g., marquee, ...) to ensure the total element size does not exceed 256KB.
|
|
294
|
+
const itemMaxSize = 200 / codes.length;
|
|
293
295
|
for(let i = 0; i < codes.length; i++){
|
|
294
296
|
const code = codes[i];
|
|
295
297
|
if (code) {
|
|
@@ -297,8 +299,7 @@ const WrapRenderChildren = ({ uid, customProps }, codes)=>{
|
|
|
297
299
|
// Fix limit 256kb
|
|
298
300
|
const textEncoder = new TextEncoder();
|
|
299
301
|
const size = newLiquid ? textEncoder.encode(newLiquid).length : 0;
|
|
300
|
-
|
|
301
|
-
if (Math.ceil(size / 1024) >= 50) {
|
|
302
|
+
if (Math.ceil(size / 1024) >= itemMaxSize) {
|
|
302
303
|
const fileName = `gp-section-snippet-${uid + i}`;
|
|
303
304
|
customProps.extraFiles[fileName] = code;
|
|
304
305
|
liquid += `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id, productSelectedVariant: productSelectedVariant, form: form %}`;
|