Skip to content

Prepare v5.3 release#579

Merged
nygardk merged 34 commits intomasterfrom
v5.3
Mar 9, 2026
Merged

Prepare v5.3 release#579
nygardk merged 34 commits intomasterfrom
v5.3

Conversation

@nygardk
Copy link
Owner

@nygardk nygardk commented Mar 8, 2026

  • add XShareButton as the canonical X share export while keeping TwitterShareButton as a deprecated compatibility alias
  • deprecate share count exports and legacy Threads props ahead of the planned v6 cleanup
  • tighten share button behavior and presentation, including native disabled semantics, safer defaults, updated focus treatment, and current Reddit/WhatsApp share URLs
  • refresh the v5 demo, README, tests, and build/tooling support around the updated component surface

nygardk added 30 commits March 8, 2026 07:59
Add Vitest, jsdom, and Testing Library coverage for the shared button behavior so network-specific fixes can land with regression tests and CI coverage.
PR #572 and issue reports like #571 showed that Reddit's /web/submit share URL now fails with a page-not-found flow. Switch the button back to /submit and add regression coverage for the public component.
Issue #533 reported that disabled share buttons only looked disabled while still allowing clicks. Set the native disabled attribute and bail out before link generation so the shared button abstraction matches button semantics.
PR #459 and follow-up issue #575 both point to the same platform change: WhatsApp now handles desktop and mobile share handoff through api.whatsapp.com. Stop branching between web and api hosts and cover the generated URL in a regression test.
Document aria-label passthrough for icon-only buttons in response to issue #578, clarify LinkedIn's best-effort text fields around issue #550, and add troubleshooting notes for popup blockers and mobile app handoff behavior that repeatedly surfaced in support issues.
Cover the full share-button matrix, JSONP-backed share counts, package exports, and shared button edge cases.\n\nAlso enable coverage reporting across the full src surface and ignore generated coverage artifacts.
Add a post-build smoke test that imports dist/index.js, requires dist/index.cjs, and verifies the published entry files and public export surface.\n\nRun the new test in CI between build and lint-package so publint and Are the Types Wrong continue validating the package.json exports map alongside the real build outputs.
Share counts are legacy, best-effort integrations whose upstream endpoints can disappear without notice.\n\nMark every public share count export as deprecated in the generated types, document the deprecation in the README, and note that the feature will be removed in v6.
Convert every icon module into a real React component backed by a shared internal IconBase instead of the createIcon runtime factory.\n\nPreserve the icon prop API and rendered output, move the shared icon logic out of hocs, and replace the factory-specific test with IconBase coverage.
…ents

Convert each network share button into a plain component over ShareButton while preserving existing URL generation, popup sizing, and special behavior such as Email navigation and Tumblr option remapping.

Replace the factory-level coverage with direct component tests for prop stripping and ref forwarding, then remove the now-unused createShareButton helper.
Clarify the v5 share-button surface without breaking compatibility by introducing a shared internal ShareButtonProps alias, documenting why htmlTitle exists alongside network-specific title props, and marking ThreadsShareButton's ignored hashtags, related, and via props as deprecated no-ops for planned v6 removal.

Expand tests to cover htmlTitle/title coexistence and the continued no-op behavior of the legacy Threads props, and include the minor changeset in the same commit.
Update the badge background colors for the affected v5 share icons to match current brand colors without changing the legacy glyph paths.

The SVG/glyph normalization work was intentionally deferred for a later v6-focused pass because some official logos now carry their own enclosing shapes.
Replace the oversized share button props table with per-button reference sections and link the supported networks from Features to their API docs.

This keeps the README easier to scan while preserving shared prop guidance and only calling out extra required props where a button actually needs them.
Remove deprecated share count components from the demo so the example only shows supported share button usage.

Also drop the unused demo share-count styling and update the demo page title to stop advertising share counts.
Render reset share buttons as inline-flex so icon-only share buttons do not include extra bottom space in the button bounding box from the inline baseline.
Infer the reset button border radius from bundled icon props so native focus outlines follow round and rounded icon shapes, and add a 2px outline offset to separate the ring from the icon edge.
Drop the stale README link to the old Codesandbox example and leave the maintained deployed demo and local demo instructions as the supported entry points.
Include test files in the main TypeScript project so editor diagnostics match the Vitest setup and jest-dom matcher augmentations are visible in test files.

Split build-only compiler settings into a dedicated tsconfig for declaration generation, add direct Node types for Node-based tests, and tighten existing test typings that were previously hidden by the narrower typecheck scope.
Default share buttons to type=button so they do not accidentally submit enclosing forms. Also add fallback accessible names for unlabeled icon-only share buttons while keeping explicit aria-label and aria-labelledby props authoritative.
Label every icon-only button in the demo and add a regression test that asserts each rendered share button has an accessible name. Also teach jsx-a11y to treat the exported share button components as buttons and ignore generated assets so linting stays focused on source files.
Clarify that icon-only share buttons need an accessible name, that htmlTitle is only a tooltip, and that standalone icons should either be decorative with aria-hidden or carry their own accessible name.
Remove the jsx-a11y custom component registry for share buttons to avoid ongoing maintenance when exports change. Keep the generated-asset ignores and rely on the demo accessibility regression test for repo-owned example coverage.
nygardk added 3 commits March 8, 2026 13:35
Add XShareButton as the canonical X sharing component while keeping TwitterShareButton as a deprecated compatibility alias.

Include a minor changeset because this adds a new public API export and marks the legacy export as deprecated in the shipped types.
Update X sharing examples and API docs to point users at XShareButton, while noting that TwitterShareButton remains available as a deprecated alias for backwards compatibility.
Reorder the demo share buttons to follow a rough social media popularity sequence so the example better matches how consumers are likely to scan the list. Refresh example.png in the same commit to keep the repository preview aligned with the updated demo.
@changeset-bot
Copy link

changeset-bot bot commented Mar 8, 2026

🦋 Changeset detected

Latest commit: 5c06993

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-share Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Write the built demo to demo/dist instead of demo/ so build-demo no longer deletes the checked-in demo source files.

Also switch the demo image reference to use new URL(..., import.meta.url).href, which avoids the TypeScript 5.9 asset import resolution failure seen in CI during check-types.

Add a regression test for the demo build config and ignore only demo/dist.
@nygardk nygardk marked this pull request as ready for review March 9, 2026 16:23
@nygardk nygardk merged commit a88ae97 into master Mar 9, 2026
4 checks passed
@nygardk nygardk deleted the v5.3 branch March 9, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant