Skip to content

feat(server-rendered): add Rails, Django, and Laravel CDN integration…#124

Open
Abhinandankaushik wants to merge 4 commits intoAOSSIE-Org:mainfrom
Abhinandankaushik:feat/framework-cdn-integration
Open

feat(server-rendered): add Rails, Django, and Laravel CDN integration…#124
Abhinandankaushik wants to merge 4 commits intoAOSSIE-Org:mainfrom
Abhinandankaushik:feat/framework-cdn-integration

Conversation

@Abhinandankaushik
Copy link
Copy Markdown
Contributor

@Abhinandankaushik Abhinandankaushik commented Mar 21, 2026

Add server-rendered framework CDN integration guide and demo section

Addressed Issues:

Fixes #53

What Changed

  • Added a new demo section for Server-Rendered Frameworks (Rails / Django / Laravel) in the demo page.
  • Added separate integration snippets for Rails, Django, and Laravel.
  • Ensured copy-to-clipboard buttons are available on the new demo code blocks.
  • Updated documentation to mention Rails, Django, and Laravel as supported server-rendered CDN integration patterns.
  • Added a dedicated README section with copy-paste snippets for all three frameworks.

Screenshots/Recordings:

Additional Notes:

  • No new wrapper file was introduced (integration is template/CDN-only as required).
  • Changes are limited to documentation/demo integration scope.

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

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

    • Added support and demo snippets for Rails, Django, and Laravel server-rendered integrations, including example CDN setup and share-button initialization.
  • Documentation

    • Updated framework compatibility list and added a new server-rendered frameworks section with copy-paste implementation guidance.
  • Improvements

    • More reliable copy-to-clipboard behavior with a fallback path and preserved success/failure messages.

Copilot AI review requested due to automatic review settings March 21, 2026 20:21
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 21, 2026

Warning

Rate limit exceeded

@Abhinandankaushik has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 20 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 195b7ddb-0f2c-4ff7-9b14-524304aff53e

📥 Commits

Reviewing files that changed from the base of the PR and between 130e7dd and 4f9a9a9.

📒 Files selected for processing (1)
  • index.html

Walkthrough

Added 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

Cohort / File(s) Summary
Documentation Updates
README.md
Added Rails, Django, and Laravel to "Framework support" and added a "Server-Rendered Frameworks (Rails / Django / Laravel)" integration guide with CDN CSS/JS placement and initialization snippets.
Demo Section & Handler Refactor
index.html
Added demo section containing Rails (ERB), Django, and Laravel (Blade) code snippets that render div#share-button and initialize new SocialShareButton({...}). Refactored copy-to-clipboard logic to use handleCopySuccess / handleCopyFailure with a Clipboard API path and a hidden <textarea> fallback, preserving messages and 2s reset behavior.

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

Documentation, Typescript Lang

Suggested reviewers

  • kpj2006

Poem

🐰
Hopping through templates, I cheer and sing,
Rails, Django, Laravel — CDN bling!
Paste CSS in head, the script before close,
Render the div, initialize — watch it pose.
Share joy, nibble a carrot, and dance with a spring.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main changes: adding Rails, Django, and Laravel CDN integration documentation and demo sections.
Linked Issues check ✅ Passed All acceptance criteria from issue #53 are met: index.html updated with server-rendered frameworks section, copy-to-clipboard added, README updated, no new wrapper files introduced.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #53 objectives: README documentation updates, index.html demo section with copy-to-clipboard refactoring, no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can disable poems in the walkthrough.

Disable the reviews.poem setting to disable the poems in the walkthrough.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.html with copy-to-clipboard code blocks.
  • Updated README.md to 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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1427157 and bcafbf9.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • README.md
  • index.html

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
index.html (1)

503-507: ⚠️ Potential issue | 🔴 Critical

Use 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}'
done

Also 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

📥 Commits

Reviewing files that changed from the base of the PR and between bcafbf9 and 130e7dd.

📒 Files selected for processing (2)
  • README.md
  • index.html

@Abhinandankaushik
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 21, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
Copy link
Copy Markdown

⚠️ This PR has merge conflicts.

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:
https://www.youtube.com/watch?v=Sqsz1-o7nXk

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Add Server-Rendered Framework Integration (Rails / Django / Laravel) — demo page section and CDN usage guide

2 participants