feat(server-rendered): add Rails, Django, and Laravel CDN integration…#124
feat(server-rendered): add Rails, Django, and Laravel CDN integration…#124Abhinandankaushik wants to merge 4 commits intoAOSSIE-Org:mainfrom
Conversation
… guide and demo section
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdded server-rendered framework integration docs for Rails, Django, and Laravel to README and index.html; inserted a new demo section with framework-specific snippets and refactored the index.html copy-to-clipboard handler into named success/failure handlers with a textarea fallback. Changes
Sequence Diagram(s)(omitted — changes are documentation + small DOM/clipboard handler refactor) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip You can disable poems in the walkthrough.Disable the |
There was a problem hiding this comment.
Pull request overview
This PR expands the project’s demo and documentation to cover CDN-based integration in common server-rendered frameworks (Rails, Django, Laravel), aligning with Issue #53’s goal of documenting template-only integration patterns.
Changes:
- Added a new “Server-Rendered Frameworks (Rails / Django / Laravel)” section to
index.htmlwith copy-to-clipboard code blocks. - Updated
README.mdto mention these frameworks and added copy/paste snippets under a new details section. - Minor refactor of the copy-to-clipboard promise handling in
index.html.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
index.html |
Adds a new server-rendered frameworks demo section and refactors copy-to-clipboard handling. |
README.md |
Documents server-rendered framework integration with dedicated snippets and updates supported frameworks list. |
package-lock.json |
Includes lockfile metadata changes ("peer": true) unrelated to the docs/demo scope. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@index.html`:
- Around line 487-489: Three <h3> headings currently use inline style attributes
(e.g., the heading "Ruby on Rails (app/views/layouts/application.html.erb)" and
the other two similar headings) — extract the styles into a reusable CSS class
(e.g., .framework-snippet-title { color: `#fff`; margin-top: 10px; }) and replace
the inline style="" on those <h3> elements with class="framework-snippet-title";
update all three occurrences of the inline-styled <h3> tags so they use the new
class for consistency and maintainability.
- Around line 751-753: The call to navigator.clipboard.writeText(text) must be
guarded to avoid a synchronous TypeError in environments without the Clipboard
API; update the code around the navigator.clipboard.writeText(...) promise chain
to first check that navigator.clipboard exists and that writeText is a function
(e.g., if (navigator.clipboard && typeof navigator.clipboard.writeText ===
'function') { navigator.clipboard.writeText(text).then(...).catch(...); } else {
/* fallback: use legacy execCommand or show an error/toast */ }), and apply the
same guard for the other clipboard usage block (the later navigator.clipboard
references).
- Around line 499-501: Replace the broken npm CDN snippets that reference
"social-share-button" with the GitHub CDN approach from the README: locate the
three framework snippets (ERB, Django, Laravel) that currently include href/src
pointing to "social-share-button" CSS/JS, update them to use the GitHub raw CDN
URLs for the repo (using the correct package/repo name
"social-share-button-aossie" and a stable tag/version as shown in the README) so
that the CSS and JS files load from raw.githubusercontent.net instead of the
failing npm CDN; apply this change to all three occurrences.
In `@README.md`:
- Around line 123-127: Update the three server-rendered examples
(Rails/Django/Laravel) that currently include the broken CDN links: replace
every occurrence of "social-share-button" with the published package name
"social-share-button-aossie" and change the path segment "dist" to "src" for
both the stylesheet and script URLs; specifically update the <link
rel="stylesheet" href="..."> and <script src="..."></script> snippets
surrounding the <div id="share-button"></div> so they point to the correct npm
CDN paths for the package and its source files.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 017f48df-1206-40f8-9b73-ff7df4caf247
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
README.mdindex.html
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
index.html (1)
503-507:⚠️ Potential issue | 🔴 CriticalUse a real CDN endpoint in snippet URLs (not
raw.githubusercontent.com).Line 504/506, Line 523/525, and Line 544/546 currently point to raw GitHub URLs. These are brittle for browser asset loading and can fail for copy-paste users. Use the jsDelivr GitHub endpoint used elsewhere in this repo docs.
🔧 Proposed fix
- href="https://raw.githubusercontent.com/AOSSIE-Org/SocialShareButton/v1.0.3/src/social-share-button.css" + href="https://cdn.jsdelivr.net/gh/AOSSIE-Org/SocialShareButton@v1.0.3/src/social-share-button.css" - src="https://raw.githubusercontent.com/AOSSIE-Org/SocialShareButton/v1.0.3/src/social-share-button.js" + src="https://cdn.jsdelivr.net/gh/AOSSIE-Org/SocialShareButton@v1.0.3/src/social-share-button.js"#!/bin/bash set -euo pipefail echo "Checking response headers for raw GitHub vs jsDelivr CDN..." urls=( "https://raw.githubusercontent.com/AOSSIE-Org/SocialShareButton/v1.0.3/src/social-share-button.css" "https://raw.githubusercontent.com/AOSSIE-Org/SocialShareButton/v1.0.3/src/social-share-button.js" "https://cdn.jsdelivr.net/gh/AOSSIE-Org/SocialShareButton@v1.0.3/src/social-share-button.css" "https://cdn.jsdelivr.net/gh/AOSSIE-Org/SocialShareButton@v1.0.3/src/social-share-button.js" ) for u in "${urls[@]}"; do echo "---- $u" curl -sI "$u" | awk 'BEGIN{IGNORECASE=1}/^HTTP\/|^content-type:|^cache-control:|^x-content-type-options:/{print}' doneAlso applies to: 523-526, 543-546
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@index.html` around lines 503 - 507, Replace the raw.githubusercontent.com asset URLs used in the <link rel="stylesheet"> and <script src=> tags that load social-share-button CSS/JS (and any repeated occurrences) with the jsDelivr GitHub CDN equivalents (e.g., cdn.jsdelivr.net/gh/AOSSIE-Org/SocialShareButton@v1.0.3/...) so browser users get a stable CDN-served file; update the href and src attributes where SocialShareButton is instantiated and referenced (the link/script tags around the SocialShareButton initialization block) to use jsDelivr paths and keep the same version tag.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@index.html`:
- Around line 497-501: The snippet duplicates an inline "visually hidden" style
on the element with class "copy-status" (and two other similar spans) — extract
that CSS into a reusable rule (e.g., .visually-hidden { position:absolute;
left:-9999px; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0);
white-space:nowrap; border:0; } or a simpler left:-9999px variant per project
conventions) and replace the inline style attributes on the <span
class="copy-status" aria-live="polite" ...> (and the other two matching spans)
with the new class (add class="copy-status visually-hidden" and remove the style
attribute) so presentation is centralized and consistent.
---
Duplicate comments:
In `@index.html`:
- Around line 503-507: Replace the raw.githubusercontent.com asset URLs used in
the <link rel="stylesheet"> and <script src=> tags that load social-share-button
CSS/JS (and any repeated occurrences) with the jsDelivr GitHub CDN equivalents
(e.g., cdn.jsdelivr.net/gh/AOSSIE-Org/SocialShareButton@v1.0.3/...) so browser
users get a stable CDN-served file; update the href and src attributes where
SocialShareButton is instantiated and referenced (the link/script tags around
the SocialShareButton initialization block) to use jsDelivr paths and keep the
same version tag.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 722fe0dc-6491-419e-8ae9-cd962f6e55bb
📒 Files selected for processing (2)
README.mdindex.html
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Please resolve the merge conflicts before review. Your PR will only be reviewed by a maintainer after all conflicts have been resolved. 📺 Watch this video to understand why conflicts occur and how to resolve them: |
Add server-rendered framework CDN integration guide and demo section
Addressed Issues:
Fixes #53
What Changed
Screenshots/Recordings:
Additional Notes:
Checklist
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Summary by CodeRabbit
New Features
Documentation
Improvements