github meursyphus/ssgoi v6.6.0
v6.6.0 — functional transitions config ({ isMobile })

8 hours ago

@ssgoi/core 6.6.0

Functional transitions config

transitions in SsgoiConfig can now be a function of device context, in addition to the existing plain list — mirroring how preserveScroll already receives isMobile:

// existing form — unchanged, fully type-compatible
transitions: [
  { from: "/", to: "/about", transition: fade() },
]

// new functional form
transitions: ({ isMobile }) => [
  { from: "/", to: "/detail", transition: isMobile ? drawer() : fade() },
]

The functional form destructures ({ isMobile }) (vs. preserveScroll's positional (isMobile)) so the boolean's meaning is self-documenting and the args object can grow later without breaking signatures.

Internals

  • Both shapes are normalized to a single functional form at context creation, so no typeof branch leaks into the dispatcher.
  • Resolution + symmetric processing run lazily (once isMobile is reliably measured) and are memoized per device class, so a static list is processed at most once per isMobile value.
  • getIsMobile is shared with preserveScroll — a single source of truth for device detection.

Compatibility

Fully backwards-compatible (additive minor). Existing transitions: [...] configs are unchanged, and all framework adapters inherit the new option automatically via @ssgoi/core types.

npm: @ssgoi/core@6.6.0 (latest)
PR #358

Don't miss a new ssgoi release

NewReleases is sending notifications on new releases.