feat: use jsDelivr CDN as default CSS source for Bricks - #74
Conversation
Co-authored-by: Jack Granatowski <contact@codeslash.net>
📝 WalkthroughWalkthroughThe PR updates the Bricks integration's CSS bundle loading mechanism to default to the jsDelivr CDN instead of requiring a local ChangesCSS Bundle CDN Default
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@integrations/bricks/slashed-bricks.php`:
- Around line 39-40: The default CDN URL in $default_url currently pins to the
mutable `@main`; change it to point at the published/dist artifact (or pin to a
specific release tag/commit) so styles are reproducible—update the $default_url
value in slashed-bricks.php (the $default_url variable) to use the stable dist
path or a tagged/commit URL instead of '`@main`'.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 608f9276-ed15-45cf-ac08-a016b3f798ba
📒 Files selected for processing (2)
integrations/bricks/README.mdintegrations/bricks/slashed-bricks.php
| // Default: jsDelivr CDN pointing to main branch latest. | ||
| $default_url = 'https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@main/dist/slashed.optimal.css'; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
urls=(
"https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@main/dist/slashed.optimal.css"
"https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@dist/slashed.optimal.css"
)
for u in "${urls[@]}"; do
code="$(curl -s -o /dev/null -w "%{http_code}" "$u")"
ctype="$(curl -sI "$u" | awk -F': ' 'tolower($1)=="content-type"{print $2}' | tr -d '\r')"
echo "$code | $ctype | $u"
doneRepository: codeslash-dev/SLASHED
Length of output: 284
Default CDN URL should not track mutable @main.
Both @main/dist/slashed.optimal.css and @dist/slashed.optimal.css currently return 200 text/css, so this isn’t an immediate break—but defaulting to @main makes styling non-reproducible and subject to future changes. Point the default at the published dist artifact instead (or pin to a tag/commit).
Suggested fix
- $default_url = 'https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@main/dist/slashed.optimal.css';
+ $default_url = 'https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@dist/slashed.optimal.css';📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Default: jsDelivr CDN pointing to main branch latest. | |
| $default_url = 'https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@main/dist/slashed.optimal.css'; | |
| // Default: jsDelivr CDN pointing to main branch latest. | |
| $default_url = 'https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@dist/slashed.optimal.css'; |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@integrations/bricks/slashed-bricks.php` around lines 39 - 40, The default CDN
URL in $default_url currently pins to the mutable `@main`; change it to point at
the published/dist artifact (or pin to a specific release tag/commit) so styles
are reproducible—update the $default_url value in slashed-bricks.php (the
$default_url variable) to use the stable dist path or a tagged/commit URL
instead of '`@main`'.
This pull request was created by @kiro-agent on behalf of @jackgranatowski 👻
Comment with /kiro fix to address specific feedback or /kiro all to address everything.
Learn about Kiro autonomous agent
Summary
Changes the default CSS source for the Bricks Builder integration plugin to load from jsDelivr CDN instead of requiring local files.
Default URL:
https://cdn.jsdelivr.net/gh/codeslash-dev/SLASHED@main/dist/slashed.optimal.cssChanges
slashed_bricks_get_css_url()now defaults to jsDelivr CDN (main branch latest)dist/folder) still take precedence if presenttrigger_errorfallback since CDN always provides a working defaultBehavior
slashed_bricks/css_bundle_urlfilter still availableThis means users can activate the plugin immediately without copying any CSS files.
Summary by CodeRabbit
Documentation
Features