Skip to content

v5.0.0

Choose a tag to compare

@winrid winrid released this 15 Jun 22:50
· 41 commits to main since this release

Summary

Major release (5.0.0). A complete visual redesign built on a semantic theme-token layer, a new FastCommentsLiveChat widget, first-class web support via react-native-web, and an upgrade of the dev/test/example toolchain to React Native 0.81 / React 19. The break is the RN/React floor (New Architecture is now required), hence the major bump.

Why 5.0.0 (breaking)

  • React Native 0.69 -> 0.81 and React 18 -> 19 on the dev/test side. The Fabric editor (react-native-enriched) requires the New Architecture, the default since RN 0.76, so consumers on older RN cannot take this as a minor.
  • Complete UI redesign: theme tokens, restyled composer/toolbar, the LiveChat preset, anchored web dropdowns + notification popover.
  • Dependency + behavior shifts: fastcomments-sdk 3.3.1 method renames and the notification page-subscription fix.

The SDK source only uses stable RN APIs, so a consumer's integration code is unaffected; what changes is the supported RN/React floor.

Theming

  • New FastCommentsTheme semantic token layer (colors, spacing, radius, font sizes, font weights, avatar sizes; token names mirror the Android SDK). The entire default style tree is generated from tokens.
  • Optional theme prop on FastCommentsLiveCommenting, FastCommentsFeed, and FastCommentsLiveChat (typed FastCommentsThemeOverrides); getLightTheme() / getDarkTheme() / resolveTheme() exported. Dark mode is one token set.
  • Back-compat: styles + theme merges on top (styles win); styles alone keeps the legacy full-replace behavior. The dark/erebus skins derive from the dark theme; setupDarkModeSkin is deprecated in favor of the theme prop.

Visual redesign ("modern neutral")

Hairline separators, pill vote buttons and chips, filled primary buttons, round shadow-free avatars, a consistent type scale, and themed link colors through render-html tagsStyles. The editor toolbar and mention popup no longer hardcode colors.

New widget: FastCommentsLiveChat (Android LiveChatView parity)

Chronological messages, composer below the list, a live header strip (connection dot + user count), auto-scroll to new messages (pauses while scrolled up, resumes at the bottom or on your own message), older history on scroll-to-top, votes and reply threading disabled. All presets overridable via config. config.maxReplyDepth: 0 hides reply buttons.

Web support

  • First-class web rendering via react-native-web. Overlays the virtualized list would otherwise clip (comment/sort menus, GIF popover, notification list) are portaled to the body and anchored under their trigger through shared useAnchoredPosition / useDismissOnOutsideClick hooks (capture-phase outside-click that excludes the trigger and content; selection closes the menu explicitly).
  • shadow* styles emit CSS boxShadow on web (react-native-web deprecates shadow*); native keeps shadow* + elevation.

New config / features

  • hideTopBar (FastCommentsRNConfig): hide the logged-in user + notification-bell strip above the composer.
  • On web the notification list opens as an anchored popover under the bell instead of a full-screen modal.
  • "Subscribe to this page" now persists: getUserNotifications sends urlId, so the server returns the correct per-page isSubscribed and the checkbox no longer resets on reopen.
  • onScroll top-pagination guarded with a ref to close a double-fire window.

Bug fixes

  • Feed posts composed in the SDK rendered with literal <p> text (the server entity-escapes <p>). Now sends <br>-separated content like the web feed widget.
  • Multi-paragraph comments glued together: editor HTML is normalized (editorHtmlToServerHtml) before comment create and edit.

Dependency note

Migrates to fastcomments-sdk 3.3.1. Renames/reshapes applied across the SDK: search/getTrending/getLarge -> getGifsSearch/getGifsTrending/getGifLarge; logout -> logoutPublic; page reacts -> getV2PageReacts/createV2PageReact/deleteV2PageReact/getV2PageReactUsers; getUserNotifications gains urlId; getCommentsForUser reshaped (dropped tenantId/urlId/sso/cursor params); reactFeedPostPublic dropped urlId. Enum value imports moved to fastcomments-sdk/server (the bare entry is type-only).

Testing

  • tsc --noEmit clean on the RN 0.81 / React 19 stack.
  • Unit (RN stubbed): 137 passing, including theme-styles and editor-normalization (red-green) and the new editorHtmlToServerHtml single-quote case.
  • Web lane (vitest + jsdom + real react-native-web/tiptap): 12 passing (mount/loaded-state, GIF attach, ModalMenu select/dismiss/sub-modal, notification popover anchor + outside-click dismiss).
  • tests-ui harness loads and renders under the new stack (smoke + render-smoke via RTL render under React 19). The full live E2E suite needs a backend key (FC_E2E_API_KEY) and was not re-run for the upgrade delta.
  • README refreshed: current screenshots, RN 0.81 guidance, and the FastCommentsRNConfig options (including hideTopBar).

Not covered: an on-device native iOS/Android build (the example app's native projects are still RN 0.69 and need regeneration on a machine with the RN toolchain), and the erebus skin on device.