Hello,
There’s a bug where gsap.min.js is loaded on every page, even thought gsap is disabled in settings completely. This is related to the Node editor. Details below:
Versions: Bricksforge 4.0.2, Bricks 2.4.3. Active tools: Node Editor, Smooth Scroll (Lenis provider) and two others. No Animations/Interactions are active.
What happens
With the Node Editor active, gsap.min.js (70 KB, ~27.5 KB gzipped) is enqueued on every front-end page, along with the FOUC-prevention flag. None of our nodes use a GSAP action.
Cause
In includes/Frontend.php (Node Editor block, around lines 570–580 in 4.0.2), the decision is a plain substring search over the whole saved graph:
$stringified_data = json_encode($panel_nodes_data);...$has_gsap = strpos($stringified_data, 'gsap') !== false;...if ($has_gsapSet || $has_gsap || $has_gsapTo) { $needs_fouc_prevention = true; wp_enqueue_script('bricksforge-gsap');}
Every node is saved with a default settings key, "gsapObject":"{}", whatever its type. A setStyleProperty node, for example, is saved like this:
"settings":{"styleProperty":"transform","styleValue":"translateY(-60px)","timescale":1, "timelineAction":"play","flipDuration":1,"gsapObject":"{}","smoothValue":20, ...}
So strpos(..., 'gsap') always matches as soon as there is a single node. On our site, all 26 occurrences of “gsap” in brf_panel_nodes are this empty default key. Remove those and the count is 0.
How to reproduce
- Fresh site, activate the Node Editor.
- Create a graph with a non-GSAP node only, e.g. Page Load → Set Style Property.
- View any front-end page:
bricksforge-gsap-jsis in the page.
Workaround we’re using (snippet by Claude)
We dequeue bricksforge-gsap on the front end, except in the builder, unless another queued script depends on it or the node JSON still contains “gsap” after the empty default is stripped:
add_action('wp_enqueue_scripts', function () { if (function_exists('bricks_is_builder') && bricks_is_builder()) return; $scripts = wp_scripts(); if (!in_array('bricksforge-gsap', (array) $scripts->queue, true)) return; foreach ((array) $scripts->queue as $h) { if ($h === 'bricksforge-gsap') continue; $d = $scripts->query($h, 'registered'); if (strpos($h, 'bricksforge-gsap-') === 0 || ($d && in_array('bricksforge-gsap', (array) $d->deps, true))) return; } $json = preg_replace('/"gsapObject"\s*:\s*"\{\}"/', '', wp_json_encode(get_option('brf_panel_nodes'))); if (stripos($json, 'gsap') !== false) return; wp_dequeue_script('bricksforge-gsap');}, 9999);
Tested without GSAP: the node logic (scroll → set style, open popup, hide, confetti), Pro Forms and Lenis smooth scroll all work, with no console errors.
Suggested fix
- Decide from the node types (the GSAP actions such as
gsapSet/gsapTo/gsap), not from a substring of the serialized graph. - Or don’t save
gsapObjecton nodes that aren’t GSAP actions, or ignore the empty default. - The same substring approach is used for
gsapFlip,drawSVG,morphSVGandmakeConfetti. These don’t produce false positives today because the default key names don’t contain those words, but checking types would be more robust there too.
Please let me know if you can please address this.
Kind regards,
Barnabas