Skip to content

Release v6 - #587

Merged
nygardk merged 36 commits into
masterfrom
v6
Oct 12, 2026
Merged

nygardk merged 36 commits into
masterfrom
v6

Conversation

@nygardk

@nygardk nygardk commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

v6 is a cleanup release: it removes deprecated and dead APIs, gives share payload props explicit names, refreshes the icons, and adds native/mobile sharing. Upgrade steps are in docs/migrate-v5-to-v6.md.

Breaking

New

Fixes

nygardk and others added 28 commits October 12, 2026 09:08
Raise the supported React peer range to ^18 || ^19 for v6 and update the compatibility docs accordingly.

This is the planned v6 breaking change for React support, following the v5 line where React 17 remained supported through 5.3.
Remove the deprecated TwitterShareButton and TwitterIcon aliases from the public package surface, leaving XShareButton and XIcon as the canonical X exports in v6.

This follows the v5 deprecation where the X exports were introduced and the Twitter aliases were kept only for backwards compatibility.
Remove all share count components, the shared createShareCount implementation, and the jsonp dependency from the published package surface in v6.

This follows the v5 deprecation where share counts were kept only as best-effort compatibility and documented for removal in the next major release.
Remove the deprecated hashtags, related, and via props from ThreadsShareButton in v6.

These props were ignored in v5 and documented only as compatibility shims ahead of their planned removal in the next major release.
Replace the ambiguous share button title prop with explicit v6 payload names: text, message, shareTitle, and postTitle depending on the target network.

Keep htmlTitle as the native button tooltip/title attribute and update the demo, README, and button tests to reflect the renamed public API.
Export per-network build*ShareUrl helpers from the package root and expose openShareWindow(url, options) as the shared popup helper used internally by ShareButton.

This keeps the button components as thin wrappers over the same helper implementations and adds direct source and built-package coverage for the new advanced-usage API.
Add an ESLint no-default-export rule for src, demo, and test files, and convert local modules to named exports so the rule is enforced by construction.

The root barrel now re-exports one symbol per file line instead of aliasing defaults, while the published package surface remains the same through named root exports.
Address recurring mobile handoff reports from #577, #551, #529, and the earlier Messenger deep-link proposal in #357 without changing the default web-link behavior.

The new mobileBehavior prop keeps the existing web flow as the default and adds best-effort app-link behavior for WhatsApp, Telegram, Viber, and Messenger when consumers explicitly opt in.
Introduce a first-class native share surface for mobile and PWA flows instead of forcing those use cases through popup-based network URLs.

This addresses the file-sharing and platform-handoff needs behind #576 and complements the iOS/PWA limitations reported in #551 with canNativeShare(), shareNative(), and NativeShareButton.
Follow the LinkedIn compatibility reports in #550 and #362 by removing prefill props that no longer have a reliable public URL-based effect.

The LinkedIn button and helper now only model the URL that is being shared, which matches the current best-effort behavior more honestly for v6.
Add a dedicated v5-to-v6 migration guide and a native/mobile sharing behavior guide under docs/, and link both from the main README for discoverability.
Rename the existing badge-style icons to *LegacyIcon and reuse the
original *Icon names for raw SVG marks in v6.

Vendored Simple Icons data is used where there is a strong canonical
match, while unsupported networks and the generic native-share glyph
keep repo-local raw icons. The old badge visuals remain available
through the legacy exports.

The docs, migration guide, and package/tests are updated so the raw
icons are the default surface and the legacy family is the migration
path for preserving v5 visuals.
Upgrade Vite to 8.0.0 and move the React plugin to 6.0.0 so the
bundler stack stays on the supported peer range.

Vitest and @vitest/coverage-v8 are updated to 4.1.0 at the same time to
keep the test runner aligned with Vite 8 and avoid split peer ranges.

No library runtime API changes are included in this commit.
Upgrade ESLint and @eslint/js to the v10 line and keep the existing flat-config rule set working with ESLint's v10 rule API changes.

Wrap legacy React, hooks, and jsx-a11y plugins with @eslint/compat, replace the crashing import/no-default-export rule with an equivalent core selector rule, and add a local npm legacy peer deps setting while upstream plugin peer ranges catch up.

Also add @testing-library/dom explicitly so clean installs keep tests runnable, ignore demo/dist in lint, and refresh formatting in files touched by the stricter lint pass.
The flat ESLint config no longer references the Babel plugin since the
TypeScript and Vite migration, so it was only adding install weight and
peer-dependency noise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
XShareButton still identified itself as "twitter" internally, a leftover
from the TwitterShareButton era. With the Twitter aliases gone in v6, key
the default aria-label on "x" instead. No public API change; a test now
covers the default aria-label for icon-only X buttons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pocket shut down in July 2025 and Workplace from Meta shut down in June
2026. Their share endpoints no longer accept shares, so keeping the
buttons only shipped broken UI. v6 is the breaking release, so remove the
share buttons, raw and legacy icons, and URL builders for both networks.

Tests now assert the removed symbols stay out of the source and built
package surfaces, and the migration guide lists the removals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
X, Threads, and Telegram moved their canonical hosts to x.com,
threads.com, and t.me. The old twitter.com, threads.net, and telegram.me
URLs still work only through redirects, which add a hop and can drop the
share intent if they are retired. Point the builders straight at the
current endpoints.

Requested in #536.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When beforeOnClick returned a promise, the share popup was opened only
after awaiting it. By then the click's user activation had expired, so
Safari and other strict popup blockers silently blocked the share window
(#525, #506, #529).

Open a blank popup synchronously during the click and load the share URL
into it once beforeOnClick resolves. A rejected promise now cancels the
share and closes the popup instead of surfacing as an unhandled
rejection. The synchronous path is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apps had no way to tell whether the share popup actually opened, so a
popup blocker made the share button silently do nothing (#525). Popup-
based buttons now call onShareWindowOpen with the opened window, or null
when the popup was blocked, so apps can offer a fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Bluesky, Email, Viber, and WhatsApp builders relied on their button
components to supply the default " " separator. Calling the newly
exported build*ShareUrl helpers directly without a separator produced
URLs such as "Helloundefinedhttps://...". Default the separator in the
builders themselves.

The builders are unreleased v6 API, so the existing helpers changeset
covers this.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EmailShareButton joined body and URL with a space, so the link ran into
the body text in the composed email (#582). Default the separator to a
newline in both the button and buildEmailShareUrl. This changes the
generated mailto: body, so it ships in the v6 major; pass separator=" "
to keep the old formatting.

The blank lines above the body shown in #582 come from the mail client's
composer, not from the mailto: URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Share buttons attach click handlers, so importing them from a Server
Component (for example a Next.js App Router page) failed unless the app
added its own "use client" wrapper (#491). Emit a "use client" banner on
both the ESM and CJS bundles so frameworks treat the package as a client
module, and assert it in the dist tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The v5 to v6 guide predated onShareWindowOpen, the "use client" banner,
and the share endpoint updates, and its checklist did not mention the
new beforeOnClick rejection and email separator behavior. Add an "Other
improvements" section and the missing checklist steps.

Fix two facts carried over from intermediate v6 states: v5's
LinkedinShareButton took `title` (not `shareTitle`), and NativeShareIcon
is new in v6, so it is not a v5 rename. Split the checklist into
required, behavior, and optional steps, merge the two icon steps into
one either/or step, and warn that plain JavaScript silently ignores the
old `title` prop.

Also point v5 users at the guide right under the install instructions,
since the Guides section is easy to miss further down the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinkedinIcon and GabIcon still reused the 64x64 glyphs from the badge
icons without their backgrounds, so they only filled 40-55% of the icon
box. Next to the full-bleed Simple Icons marks they looked tiny and
inconsistent.

LinkedIn now uses its full rounded-square "in" mark in the current
#0A66C2 brand blue. Gab knocks the wordmark out of a rounded green
square, matching the VK and Hatena marks. Both are drawn on a 24x24
viewBox like the other raw icons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The raw EmailIcon and NativeShareIcon reused small badge glyphs on a
64x64 viewBox and looked undersized next to the other raw icons. Swap
them for the Lucide "mail" and "share" icons, which fill the 24x24 box
like the brand marks do.

Lucide icons are stroke-based, so RawIconBase gains an internal
`outlined` mode that renders fill="none" with a round 2px stroke. The
`color` (or `fill`) prop drives the stroke in that mode, so every raw
icon can be recolored the same way. The README now documents `color`
and credits Lucide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 552fde3

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 Major

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

nygardk and others added 7 commits October 12, 2026 13:20
Raw X, Weibo, Bluesky, Email, native share, Instapaper, and Tumblr
icons were bare glyphs. Next to the circular brand marks (Facebook,
Telegram, Reddit, Pinterest) they looked heavier or lighter and lost
the consistent look the v5 badges had.

RawIconBase gains an internal `badge` option that scales the glyph down
around the center and draws it in white on a filled circle, so the
glyph stays legible on dark backgrounds too. The outlined Lucide glyphs
of Email and native share keep their round stroke, painted white.

NativeShareIcon used the current text color, which on dark pages turns
the circle white and hides the white glyph. It now uses a fixed blue
(#0A84FF), the color of NativeShareLegacyIcon.

The README, migration guide, and the raw/legacy icon changeset no
longer describe raw icons as background-free.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Threads introduced a new app icon in 2026: a white glyph on a black
rounded square. The raw ThreadsIcon still drew the old bare glyph,
which also looked lighter than the other raw icons.

Draw the new icon from the official SVG, scaled to the 24x24 viewBox.
The glyph is a fixed white path, so it stays legible on dark
backgrounds and `color` only recolors the square.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OK's current logo, served as the ok.ru favicon, is a white figure on an
orange (#FF7700) rounded square. The raw OKIcon still drew the old bare
glyph in an older orange.

Draw the new logo from the official SVG, scaled to the 24x24 viewBox.
The figure is fixed white, so it stays legible on dark backgrounds and
`color` only recolors the square.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Many raw icons cut their details out of the brand shape: the Facebook
"f", the LinkedIn "in", the LINE lettering, the inside of the WhatsApp
and Viber bubbles. On a dark page those holes showed the page
background, so the logos turned into dark blobs.

RawIconBase gains an internal `backdrop`: a white shape painted behind
the mark. For the solid marks it is inset just inside the outline so it
does not leave a light fringe on the anti-aliased edge; Facebook and
Pinterest extend it only where their "f" and "P" stems open onto the
edge. WhatsApp and Viber reuse the inner contour of their bubble
outline, so the white fills the bubble exactly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Simple Icons LiveJournal mark is one color: the pencil body and
lead are cut out of the blue circle. On a dark page they took on the
page background, and on a light page the pencil showed as white,
neither of which matches the official logo.

Layer the mark from the same geometry instead: blue circle and eraser
cap, navy (#15374C) pencil body and lead, and a white wooden tip, so
the pencil looks the same on any background. `color` still recolors
the blue parts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Several raw icons still used older or Simple Icons approximations of
their brand colors. Switch them to the networks' current brand colors:

- Bluesky: #1185FE -> #0560FF
- LINE: #00C300 -> #06C755
- Pinterest: #BD081C -> #E60023
- Tumblr: #36465D -> #001935
- Gab: #00D178 -> #30CE7D

The legacy badge icons keep their v5 colors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
example.png was a hand-made screenshot that had drifted: it still
showed the v5 badges and the removed Pocket and Workplace buttons.

Replace it with example.svg, built by a test that renders the demo and
lays out its icons in demo order. toMatchFileSnapshot keeps the file in
sync: `npm run update-example` rewrites it, and CI fails while the
committed preview is stale. As SVG the preview stays sharp, diffs
readably, and keeps a transparent background on GitHub's dark theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The README had grown section by section through the v6 work and was
hard to follow: there was no quick start, the network list was buried
in Features, and broken list markup ran required, all-button and
popup-only props together. Accessibility, mobile handoff and versioning
notes were scattered across several sections.

Reorganize it around install, a runnable quick start and a supported
networks table. Common props become real tables, each network section
gets a props table with its example in a collapsible block, and the
accessibility, mobile handoff and compatibility notes each live in one
place. Add a table of contents and a development section.

Drop the icon sources section, which no longer describes where the
icons come from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nygardk
nygardk merged commit 6b777d3 into master Oct 12, 2026
4 checks passed
@nygardk
nygardk deleted the v6 branch October 12, 2026 10:46
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