Skip to content

feat: add Alpine.js integration#154

Open
hiranya25 wants to merge 3 commits into
AOSSIE-Org:mainfrom
hiranya25:feat/alpine-integration
Open

feat: add Alpine.js integration#154
hiranya25 wants to merge 3 commits into
AOSSIE-Org:mainfrom
hiranya25:feat/alpine-integration

Conversation

@hiranya25

@hiranya25 hiranya25 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Addressed Issues:

Fixes #49

Screenshots/Recordings:

N/A - No visual changes to the button itself, but added an Alpine.js demo section to index.html.

Additional Notes:

This PR introduces the official integration guide and demo for Alpine.js. Since Alpine.js shares the same zero-dependency, no-build-step philosophy as SocialShareButton, it perfectly aligns with the project.

Key changes include:

  • Added a dedicated "🏔️ Alpine.js Integration" section to index.html featuring copy-to-clipboard code snippets showing how to initialize via x-data and x-init.
  • Updated the README.md Quick Start Guide with a collapsible Alpine.js details block.
  • Standardized framework mentions across package.json (keywords), landing-page/src/components/Features.tsx, and index.html to include Alpine.js alongside React, Vue, Angular, etc.
  • No separate wrapper file was required, as integration is natively supported through HTML directives.

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

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Alpine.js framework support to SocialShareButton.
  • Documentation

    • Updated README with an Alpine.js Quick Start Guide, including CDN setup and example usage.
    • Added an Alpine.js Integration demo section with step-by-step initialization and cleanup guidance.
    • Updated framework-agnostic feature descriptions to explicitly include Alpine.js.

Signed-off-by: hiranya25 <hiranyapatil10@gmail.com>
@github-actions github-actions Bot added planned Planned feature - not final, may be dropped based on repo direction configuration Configuration file changes dependencies Dependency file changes documentation Changes to documentation files labels Jun 18, 2026
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 52b0ecdc-e58f-4390-88a6-a49434802624

📥 Commits

Reviewing files that changed from the base of the PR and between a8f42f0 and 6d3de40.

📒 Files selected for processing (3)
  • README.md
  • index.html
  • package.json

Walkthrough

Adds Alpine.js support wording across the README, demo page, landing page feature card, and package keywords. It also adds an Alpine.js Quick Start section in the README and a matching demo section in index.html with CDN setup and lifecycle examples.

Changes

Alpine.js Integration Documentation

Layer / File(s) Summary
Alpine.js added to framework support mentions
README.md, index.html, landing-page/src/components/Features.tsx, package.json
Alpine.js is added to the supported frameworks list in the README features bullet, the demo page feature paragraph, the landing page feature card description, and the package.json keywords array.
Alpine.js CDN setup and x-data/x-init usage examples
README.md, index.html
A new Alpine.js integration block is added to the README with a CDN setup snippet and an x-data/x-init/x-destroy example. A matching demo section with a copy-to-clipboard code block is inserted in index.html.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested labels: Documentation, Typescript Lang

Suggested reviewers: kpj2006

Poem

🐰 Hop hop, Alpine joins the show,
With CDN tags and x-data glow.
README and demo now agree,
Destroy on cleanup, tidy as can be.
A bunny cheers for docs so bright,
SocialShareButton fits Alpine just right!

🚥 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 clearly and concisely summarizes the main change: adding Alpine.js integration.
Linked Issues check ✅ Passed The PR matches issue #49 by adding the Alpine.js demo section, CDN usage snippet, copy button, and README support mention.
Out of Scope Changes check ✅ Passed The additional feature and package metadata updates are still aligned with the Alpine.js integration work and framework reference standardization.
✨ 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.

@github-actions github-actions Bot added frontend Changes to frontend code javascript JavaScript/TypeScript code changes size/M Medium PR (51-200 lines changed) repeat-contributor PR from an external contributor who already had PRs merged needs-review labels Jun 18, 2026
@hiranya25

Copy link
Copy Markdown
Contributor Author

@kpj2006 Note for Maintainers: I think the Dependency & License Review check failed because the Dependency Graph feature is not enabled on this repository's security settings (Error: Dependency review is not supported on this repository). This is a repository configuration issue, not an issue with the code in this PR.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@index.html`:
- Around line 604-605: The `x-destroy` directive used on the div element is not
supported in Alpine.js v3 and the cleanup code for shareBtn will never execute.
Replace the `x-destroy` attribute with Alpine.js v3's official lifecycle
approach by either creating a custom init function with Alpine.data that
properly handles the destroy() method for shareBtn, or register a custom Alpine
directive that properly implements cleanup using Alpine's onCleanup or destroy
hooks. Remove the unsupported `x-destroy="shareBtn && shareBtn.destroy()"`
attribute and ensure the shareBtn cleanup logic is moved to the appropriate
Alpine.js v3 lifecycle method.
- Around line 589-591: The CDN URLs for the stylesheet and script tags
referencing social-share-button package are incorrect and should use the AOSSIE
package GitHub CDN URLs instead as documented in the project's README. Replace
the href attribute in the link tag and src attributes in both script tags (lines
589-591 in index.html) with the correct GitHub CDN URLs from the README's "Via
CDN (Recommended)" section. Additionally, update the same incorrect CDN URLs in
the README documentation (lines 499-503) to maintain consistency across the
project documentation.

In `@README.md`:
- Around line 516-525: The documentation example uses the unsupported x-destroy
directive instead of Alpine's standard lifecycle pattern. Replace the current
x-init and x-destroy directives with an x-data object that includes a shareBtn
property initialized to null, an init() method containing the SocialShareButton
instantiation logic, and a destroy() method containing the cleanup logic that
calls shareBtn.destroy(). Alpine will automatically invoke the destroy() method
when the component is removed from the DOM.
🪄 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: c607fdad-5daf-4cef-8eca-3e9956970078

📥 Commits

Reviewing files that changed from the base of the PR and between 6895348 and a8f42f0.

📒 Files selected for processing (4)
  • README.md
  • index.html
  • landing-page/src/components/Features.tsx
  • package.json

Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread README.md Outdated
Signed-off-by: hiranya25 <hiranyapatil10@gmail.com>
@hiranya25

Copy link
Copy Markdown
Contributor Author

@kpj2006 could you please look into this why this [Dependency Review / Dependency & License Review is failing.

@hiranya25

Copy link
Copy Markdown
Contributor Author

@kpj2006 Please check and let me know about this issue!

@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

@hiranya25

Copy link
Copy Markdown
Contributor Author

@kpj2006 Could you please review this pr

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

492-506: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Align the CDN version across the docs

README.md still uses v1.0.3 for the SocialShareButton CDN assets, while other integration examples in index.html pin v1.0.4. Pick one version and make the snippets consistent.

🤖 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 `@README.md` around lines 492 - 506, README.md’s SocialShareButton CDN snippet
is out of sync with the rest of the docs: it still points to v1.0.3 while the
integration example uses v1.0.4. Update the version in the README snippet to
match the chosen canonical CDN version, keeping the <link> and <script>
references in the same version as the other examples so the documentation is
consistent.
🤖 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 `@index.html`:
- Around line 512-516: The CDN version pins in index.html are inconsistent
between the main examples and the Alpine snippet, so update the
SocialShareButton asset URLs to use the same release tag throughout. Check the
link and script references in the documented examples and align them to a single
version so copy-pasted snippets all point to the same SocialShareButton release.

In `@README.md`:
- Around line 604-605: There is a stray leftover dash immediately after the
Discord entry in the platform-message list. Remove the dangling standalone "-"
from the README content around that list so the section reads cleanly and only
contains the intended bullets.

---

Outside diff comments:
In `@README.md`:
- Around line 492-506: README.md’s SocialShareButton CDN snippet is out of sync
with the rest of the docs: it still points to v1.0.3 while the integration
example uses v1.0.4. Update the version in the README snippet to match the
chosen canonical CDN version, keeping the <link> and <script> references in the
same version as the other examples so the documentation is consistent.
🪄 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: 52b0ecdc-e58f-4390-88a6-a49434802624

📥 Commits

Reviewing files that changed from the base of the PR and between a8f42f0 and 6d3de40.

📒 Files selected for processing (3)
  • README.md
  • index.html
  • package.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
README.md (1)

492-506: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Align the CDN version across the docs

README.md still uses v1.0.3 for the SocialShareButton CDN assets, while other integration examples in index.html pin v1.0.4. Pick one version and make the snippets consistent.

🤖 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 `@README.md` around lines 492 - 506, README.md’s SocialShareButton CDN snippet
is out of sync with the rest of the docs: it still points to v1.0.3 while the
integration example uses v1.0.4. Update the version in the README snippet to
match the chosen canonical CDN version, keeping the <link> and <script>
references in the same version as the other examples so the documentation is
consistent.
🤖 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 `@index.html`:
- Around line 512-516: The CDN version pins in index.html are inconsistent
between the main examples and the Alpine snippet, so update the
SocialShareButton asset URLs to use the same release tag throughout. Check the
link and script references in the documented examples and align them to a single
version so copy-pasted snippets all point to the same SocialShareButton release.

In `@README.md`:
- Around line 604-605: There is a stray leftover dash immediately after the
Discord entry in the platform-message list. Remove the dangling standalone "-"
from the README content around that list so the section reads cleanly and only
contains the intended bullets.

---

Outside diff comments:
In `@README.md`:
- Around line 492-506: README.md’s SocialShareButton CDN snippet is out of sync
with the rest of the docs: it still points to v1.0.3 while the integration
example uses v1.0.4. Update the version in the README snippet to match the
chosen canonical CDN version, keeping the <link> and <script> references in the
same version as the other examples so the documentation is consistent.
🪄 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: 52b0ecdc-e58f-4390-88a6-a49434802624

📥 Commits

Reviewing files that changed from the base of the PR and between a8f42f0 and 6d3de40.

📒 Files selected for processing (3)
  • README.md
  • index.html
  • package.json
🛑 Comments failed to post (2)
index.html (1)

512-516: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect the exact HTML around the flagged line for unescaped characters
sed -n '505,525p' index.html

Repository: AOSSIE-Org/SocialShareButton

Length of output: 1122


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- lines around 660-670 ---'
sed -n '656,672p' index.html

echo '--- all SocialShareButton version references ---'
rg -n "SocialShareButton@v1\.0\.[34]" index.html

echo '--- nearby HTML entities around the Qwik snippet ---'
sed -n '516,522p' index.html

Repository: AOSSIE-Org/SocialShareButton

Length of output: 2600


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- version references in repo ---'
rg -n "v1\.0\.[34]" .

echo '--- package/version metadata candidates ---'
git ls-files | rg '(^|/)(package\.json|package-lock\.json|pnpm-lock\.yaml|yarn\.lock|README\.md|index\.html)$'

echo '--- git tags matching v1.0 ---'
git tag -l 'v1.0.*'

Repository: AOSSIE-Org/SocialShareButton

Length of output: 4041


Keep the CDN version pins aligned. index.html mixes v1.0.4 in the main examples with v1.0.3 in the Alpine snippet, so copy-pasted docs point to different releases.

🤖 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 `@index.html` around lines 512 - 516, The CDN version pins in index.html are
inconsistent between the main examples and the Alpine snippet, so update the
SocialShareButton asset URLs to use the same release tag throughout. Check the
link and script references in the documented examples and align them to a single
version so copy-pasted snippets all point to the same SocialShareButton release.

Source: Linters/SAST tools

README.md (1)

604-605: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Stray leftover character after the Discord bullet.

A dangling - on its own line appears right after the platform-message list, which looks like an editing artifact rather than intentional content.

Proposed fix
 - **Discord:** `title` + `description` + `hashtags` + link
-
🤖 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 `@README.md` around lines 604 - 605, There is a stray leftover dash immediately
after the Discord entry in the platform-message list. Remove the dangling
standalone "-" from the README content around that list so the section reads
cleanly and only contains the intended bullets.

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

Labels

configuration Configuration file changes dependencies Dependency file changes documentation Changes to documentation files frontend Changes to frontend code javascript JavaScript/TypeScript code changes needs-review planned Planned feature - not final, may be dropped based on repo direction repeat-contributor PR from an external contributor who already had PRs merged size/M Medium PR (51-200 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Add Alpine.js Integration — demo page section and usage guide

1 participant