Load Json Render assets only when the module is used#35
Draft
sebastianthulin with Copilot wants to merge 4 commits into
Draft
Load Json Render assets only when the module is used#35sebastianthulin with Copilot wants to merge 4 commits into
sebastianthulin with Copilot wants to merge 4 commits into
Conversation
Agent-Logs-Url: https://github.com/helsingborg-stad/modularity-json-render/sessions/f2291d31-fe76-4f28-806a-24ce1d5588e8 Co-authored-by: sebastianthulin <797129+sebastianthulin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/helsingborg-stad/modularity-json-render/sessions/f2291d31-fe76-4f28-806a-24ce1d5588e8 Co-authored-by: sebastianthulin <797129+sebastianthulin@users.noreply.github.com>
Agent-Logs-Url: https://github.com/helsingborg-stad/modularity-json-render/sessions/f2291d31-fe76-4f28-806a-24ce1d5588e8 Co-authored-by: sebastianthulin <797129+sebastianthulin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix assets enqueued on all pages
Load Json Render assets only when the module is used
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Json Render assets were being registered from the app bootstrap, which loaded them on every page regardless of module usage. This change scopes frontend and admin assets to the module lifecycle so they are only added when the module is rendered or edited.
Stop global asset loading
AppLoad frontend assets from the module
JsonRender::script()now enqueues the actual frontend bundleJsonRender::style()now enqueues the frontend stylesheetLoad admin assets only on the module edit screen
JsonRender::adminEnqueue()now enqueues the real admin bundle instead of the placeholder scriptTighten enqueue configuration
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/carthage-software/mago/releases/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/zb3CNV /usr/bin/composer mago:install-binary --local git unit.git/'(http block)/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/IcVNyG /usr/bin/composer mago:install-binary git erator.git unit.git/'(http block)https://api.github.com/repos/carthage-software/mago/zipball/9e1e3d1a4566349d3b07d1275bca53f3c93dabeb/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/JOQdFp /usr/bin/composer install --no-interaction --prefer-dist(http block)https://api.github.com/repos/helsingborg-stad/acf-export-manager/zipball/9e1b282460cebf68ec4d83cd3c11d8fe7e3612fd/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/JOQdFp /usr/bin/composer install --no-interaction --prefer-dist(http block)https://api.github.com/repos/helsingborg-stad/wpservice/zipball/3ed37137b25defbc98e24904f8523ea2f86e3c24/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/JOQdFp /usr/bin/composer install --no-interaction --prefer-dist(http block)https://api.github.com/repos/helsingborg-stad/wputilservice/zipball/60afacdecc1aa72f14f135916bdffe80abd52dc0/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/JOQdFp /usr/bin/composer install --no-interaction --prefer-dist(http block)https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6aREDACTED, pid is -1(http block)https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82REDACTED, pid is -1(http block)https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176REDACTED, pid is -1(http block)https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45eREDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/comparator/zipball/85c77556683e6eee4323e4c5468641ca0237e2e8REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/environment/zipball/a5c75038693ad2e8d4b6c15ba2403532647830c4REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/exporter/zipball/70a298763b40b213ec087c51c739efcaa90bcd74REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467aREDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aaREDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4f7722aa9a7b76aa775e2d9d4e95d1ea16eeeef4REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/phpunit/zipball/75dfe79a2aa30085b7132bb84377c24062193f33REDACTED, pid is -1(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/f6458abbf32a6c8174f8f26261475dc133b3d9dc/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/JOQdFp /usr/bin/composer install --no-interaction --prefer-dist(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/f77d2d4e78738c98d9a68d2596fe5e8fa380f449/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/JOQdFp /usr/bin/composer install --no-interaction --prefer-dist(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/JOQdFp /usr/bin/composer install --no-interaction --prefer-dist(http block)https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163/usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/JOQdFp /usr/bin/composer install --no-interaction --prefer-dist(http block)https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3cREDACTED, pid is -1(http block)If you need me to access, download, or install something from one of these locations, you can either: