Skip to content

HOG-522: Exclude Image Guide from JS concatenation on Atomic/WoW#47918

Draft
LiamSarsfield wants to merge 2 commits intotrunkfrom
hog-522/fix-concatenate-image-guide
Draft

HOG-522: Exclude Image Guide from JS concatenation on Atomic/WoW#47918
LiamSarsfield wants to merge 2 commits intotrunkfrom
hog-522/fix-concatenate-image-guide

Conversation

@LiamSarsfield
Copy link
Copy Markdown
Contributor

Resolves https://linear.app/a8c/issue/HOG-522/jetpack-boost-image-guide-disappears-with-concatenate-js-enabled-on

Proposed changes

  • Exclude jetpack-boost-guide from platform-level JS concatenation on Atomic/WoW sites by adding it to the js_do_concat exclusion list in compatibility/js-concatenate.php.

Other information

The Image Guide script (guide.js) is a webpack IIFE bundle that also uses wp_localize_script to inject inline data. Boost's own concatenation logic already skips scripts with inline content via has_inline_content(), but the Atomic/WoW platform's JS concatenation does not have this safeguard. When the platform concatenates this script with others, the resulting bundle is malformed, producing "Uncaught SyntaxError: Unexpected end of input" and causing the Image Guide to silently disappear.

This follows the existing pattern used for other problematic scripts (WooCommerce, Event Tickets, etc.) in the same file.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  1. Enable Jetpack Boost with the Image Guide module on an Atomic or WoW site
  2. Enable "Concatenate JS" (via the site's performance settings or the page_optimize option)
  3. Visit the frontend as a logged-in admin
  4. Verify the Image Guide appears in the admin bar and functions correctly
  5. Open browser dev tools console — confirm no Uncaught SyntaxError: Unexpected end of input errors

Verification

  • Lint: PASS
  • Tests: PASS (jp test php plugins/boost)
  • Phan: PASS (0 issues)
  • Diff review: PASS — minimal 3-line addition, no unintended changes

Confidence

HIGH — This is a straightforward exclusion-list addition following an established pattern. The root cause is well-understood: webpack IIFE bundles with inline script data are not safe to concatenate at the platform level.

  • Generate changelog entries for this PR (using AI).

🤖 This PR was created autonomously by the Boost Linear Solver.
Triage complexity: medium | Linear issue

LiamSarsfield and others added 2 commits April 3, 2026 07:14
…oW sites

The jetpack-boost-guide script is a webpack IIFE bundle that uses
wp_localize_script for inline data. When the Atomic/WoW platform's JS
concatenation combines it with other scripts, the resulting bundle is
malformed, producing "Uncaught SyntaxError: Unexpected end of input"
and causing the Image Guide feature to silently disappear.

Boost's own concatenation logic already skips scripts with inline
content, but the platform-level concatenation on Atomic/WoW does not.
Adding the handle to the existing js_do_concat exclusion list prevents
the platform from concatenating this script.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added [Focus] Compatibility Ensuring our products play well with third-parties [Plugin] Boost A feature to speed up the site and improve performance. [Status] In Progress labels Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • 🔴 Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Apr 3, 2026
@jp-launch-control
Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/boost/compatibility/js-concatenate.php 0/13 (0.00%) 0.00% 1 ❤️‍🩹

Full summary · PHP report · JS report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Focus] Compatibility Ensuring our products play well with third-parties [Plugin] Boost A feature to speed up the site and improve performance. [Status] In Progress [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant