SSGOI

Migrate to 8.0

Every API that 8.0 removes, what replaces it, and a before and after for each.

SSGOI 8.0.0 is a cleanup release. It adds no new behavior: it deletes the compatibility code 7.x kept for older code. Every removed API already had a replacement in 7.x, so if your app uses <Ssgoi framework> with SsgoiLayoutBoundary and none of the names below, the upgrade is a version bump.

Upgrade every package together

All @ssgoi/* packages are versioned in lockstep. Move each one you install to the same 8.x version.

npm install @ssgoi/react@8   # or svelte, vue, solid, qwik, angular, react-native

The framework package brings @ssgoi/core with it; if you also import @ssgoi/core directly, upgrade it to 8 as well. The packages no longer list any router as an optional peer dependency.

Find what needs to change

Search the project for every removed name before you upgrade.

grep -rnE --exclude-dir=node_modules --exclude-dir=.next --exclude-dir=dist '@ssgoi/[a-z-]+/(nextjs|remix|react-router|tanstack-router|sveltekit|vue-router|nuxt|solid-router|solidstart|qwik-city|router|expo-router|unplugin)|(^|[^A-Za-z])SsgoiTransition\b|SsgoiRouteBoundary|ssgoiRouteBoundary|ssgoiTransition|routeKey|parallelRoutesKey|feel:|"crossfade"|background-scale|fade: true|data-hero-key|data-hero-aspect-ratio|data-hero-radius|data-zoom-radius|fromSpring|TrackPatch|SsgoiTransitionsOption' .

# Patterns too generic for one search; review these hits by hand:
grep -rnE --exclude-dir=node_modules --exclude-dir=.next --exclude-dir=dist '["'"'"']\*["'"'"']|\.set\(["'"'"']' .

Review every hit of the first search; routeKey can also match your own props. The second is noisy on purpose: a bare "*" pattern and a two-argument animation.set("in", …) cannot be told apart from other strings and Map.set calls by a pattern.

Removed subpaths and exports fail at build time, and TypeScript flags the removed options. A missing framework makes SsgoiLayoutBoundary throw an SSGOI: error. Without types, the changes below fail silently instead:

7.x codeWhat it does on 8.0
drill({ type: "crossfade" })Plays the default parallax drill.
sheet({ type: "background-scale" })Plays the default static sheet.
axis({ feel: "snappy" })Ignored; plays the default x axis.
zoom({ fade: true })Ignored; plays the default variant.
data-hero-keyNo pair is found, so Hero does nothing.
data-hero-aspect-ratio, data-hero-radius, data-zoom-radiusIgnored; geometry comes from the DOM and CSS.
"*"Read as /*: matches single-segment paths such as /posts only.
animation.set("in", { … })The string is taken as an empty patch; nothing changes.

Removed APIs at a glance

Each row is covered with a before and after snippet in the sections below.

Removed in 8.0Use instead
Router subpaths such as @ssgoi/react/nextjs, @ssgoi/svelte/sveltekit, @ssgoi/vue/nuxt and their SsgoiRouteBoundary / useSsgoiRouteBoundary<Ssgoi framework> plus SsgoiLayoutBoundary (Qwik: useSsgoiLayoutBoundary) from the package root
routeKey, Angular key: and useSsgoiRouteBoundary(key)A scope in config.layouts
resolve, parallelRoutesKey, fallback, selectedSegmentsToPathSee boundary props below; most have no prop equivalent
SsgoiTransition (every framework, Angular [ssgoiTransition])data-ssgoi-transition on the element your framework keys
@ssgoi/react/unpluginNothing: remove it from the bundler config
axis({ feel: "snappy" })axis({ variant: "snappy" })
axis({ feel: "fluid" })axis()
drill({ type: "crossfade" })drill({ type: "slide" })
sheet({ type: "background-scale" })sheet({ type: "scale" })
zoom({ fade: true })zoom({ variant: "fade" })
data-hero-keydata-hero-exit-key on the page you leave, data-hero-enter-key on the page you arrive at
data-hero-aspect-ratioNothing: the image's own dimensions and object-fit
data-hero-radius, data-zoom-radiusNothing: CSS border-radius on the keyed element or its clip
Route pattern "*""/**"
IntegratorProvider.fromSpring(config)IntegratorProvider.from({ spring: config })
animation.set(name, { integrator })animation.select(name).set({ integrator })

Router subpaths and SsgoiRouteBoundary

The provider now reads your router through a framework object, and the boundary comes from the package root.

In 7.x each router had its own entry (@ssgoi/react/nextjs, /remix, /react-router, /tanstack-router, @ssgoi/svelte/sveltekit, @ssgoi/vue/vue-router, /nuxt, @ssgoi/solid/solid-router, /solidstart, @ssgoi/qwik/qwik-city, @ssgoi/angular/router, @ssgoi/react-native/expo-router) that imported the router and exported a route boundary. In 8.0 those entries are gone. Pass a framework object to <Ssgoi> that reads your router, and replace the boundary with SsgoiLayoutBoundary from the same package root. Keep the object at module scope so it stays stable. Your config and transition rules do not change.

Next.js App Router

useRoute returns the pathname and the path the children slot renders, so an intercepted modal keeps its background mounted.

7.x

// app/ssgoi-provider.tsx
"use client";
import { Ssgoi } from "@ssgoi/react";

export function SsgoiProvider({ children }: { children: ReactNode }) {
  return <Ssgoi config={config}>{children}</Ssgoi>;
}

// app/layout.tsx
import { SsgoiRouteBoundary } from "@ssgoi/react/nextjs";

<SsgoiProvider>
  <SsgoiRouteBoundary>{children}</SsgoiRouteBoundary>
</SsgoiProvider>

8.0

// app/ssgoi-provider.tsx
"use client";
import { usePathname, useSelectedLayoutSegments } from "next/navigation";
import { Ssgoi, type SsgoiFramework } from "@ssgoi/react";

const INTERCEPTION_PREFIX = /^(?:\(\.\.\.\)|\(\.\.\)|\(\.\))+/;

const framework: SsgoiFramework = {
  useRoute: () => {
    const pathname = usePathname();
    const segments = useSelectedLayoutSegments();
    if (pathname == null) return null;
    const renderedPath = `/${segments
      .filter((segment) => !(segment.startsWith("(") && segment.endsWith(")")))
      .map((segment) => segment.replace(INTERCEPTION_PREFIX, ""))
      .filter(Boolean)
      .join("/")}`;
    return { pathname, renderedPath };
  },
};

export function SsgoiProvider({ children }: { children: ReactNode }) {
  return (
    <Ssgoi config={config} framework={framework}>
      {children}
    </Ssgoi>
  );
}

// app/layout.tsx
import { SsgoiLayoutBoundary } from "@ssgoi/react";

<SsgoiProvider>
  <SsgoiLayoutBoundary>{children}</SsgoiLayoutBoundary>
</SsgoiProvider>

Remix and React Router

Both return their own location. Import useLocation from @remix-run/react in Remix 2 and from react-router in React Router 6 or 7.

7.x

// app/root.tsx
import { Ssgoi } from "@ssgoi/react";

<Ssgoi config={config}>
  <Outlet />
</Ssgoi>

// app/routes/page-boundary.layout.tsx
import { SsgoiRouteBoundary } from "@ssgoi/react/react-router"; // or "@ssgoi/react/remix"

<SsgoiRouteBoundary>
  <Outlet />
</SsgoiRouteBoundary>

8.0

// app/root.tsx
import { Outlet, useLocation } from "react-router"; // or "@remix-run/react"
import { Ssgoi, type SsgoiFramework } from "@ssgoi/react";

const framework: SsgoiFramework = { useRoute: () => useLocation() };

<Ssgoi config={config} framework={framework}>
  <Outlet />
</Ssgoi>

// app/routes/page-boundary.layout.tsx
import { SsgoiLayoutBoundary } from "@ssgoi/react";

<SsgoiLayoutBoundary>
  <Outlet />
</SsgoiLayoutBoundary>

TanStack Router

Return the path of the leaf match the outlet renders, not location: TanStack moves location before pending matches render.

7.x

// app/routes/__root.tsx
import { Ssgoi } from "@ssgoi/react";
import { SsgoiRouteBoundary } from "@ssgoi/react/tanstack-router";

<Ssgoi config={config}>
  <SsgoiRouteBoundary>
    <Outlet />
  </SsgoiRouteBoundary>
</Ssgoi>

8.0

// app/routes/__root.tsx
import { Outlet, useRouterState } from "@tanstack/react-router";
import { Ssgoi, SsgoiLayoutBoundary, type SsgoiFramework } from "@ssgoi/react";

const framework: SsgoiFramework = {
  useRoute: () => ({
    pathname: useRouterState({
      select: (state) => {
        const location = state.location.pathname;
        const leaf = state.matches.at(-1)?.pathname;
        if (!leaf) return location;
        return leaf.length > 1 && leaf.endsWith("/") && !location.endsWith("/")
          ? leaf.slice(0, -1)
          : leaf;
      },
    }),
  }),
};

<Ssgoi config={config} framework={framework}>
  <SsgoiLayoutBoundary>
    <Outlet />
  </SsgoiLayoutBoundary>
</Ssgoi>

SvelteKit

Pass a route getter and SvelteKit's onNavigate. SvelteKit before 2.12 reads get(page).url from $app/stores instead of $app/state.

7.x

<!-- src/routes/+layout.svelte -->
<script>
  import { Ssgoi } from "@ssgoi/svelte";
  import { SsgoiRouteBoundary } from "@ssgoi/svelte/sveltekit";
  let { children } = $props();
</script>

<Ssgoi {config}>
  <SsgoiRouteBoundary>
    {@render children()}
  </SsgoiRouteBoundary>
</Ssgoi>

8.0

<!-- src/routes/+layout.svelte -->
<script>
  import { page } from "$app/state";
  import { onNavigate } from "$app/navigation";
  import { Ssgoi, SsgoiLayoutBoundary } from "@ssgoi/svelte";
  let { children } = $props();

  const framework = {
    getRoute: () => ({ pathname: page.url.pathname }),
    onNavigate,
  };
</script>

<Ssgoi {config} {framework}>
  <SsgoiLayoutBoundary>
    {@render children()}
  </SsgoiLayoutBoundary>
</Ssgoi>

Nuxt and Vue Router

Read router.currentRoute, the committed router state. In Nuxt useRouter is auto-imported; with plain Vue Router import it from vue-router and wrap the RouterView component instead of NuxtPage.

7.x

<!-- app.vue -->
<script setup>
import { Ssgoi } from "@ssgoi/vue";
import { SsgoiRouteBoundary } from "@ssgoi/vue/nuxt"; // or "@ssgoi/vue/vue-router"
</script>

<template>
  <Ssgoi :config="config">
    <SsgoiRouteBoundary>
      <NuxtPage />
    </SsgoiRouteBoundary>
  </Ssgoi>
</template>

8.0

<!-- app.vue -->
<script setup>
import { Ssgoi, SsgoiLayoutBoundary } from "@ssgoi/vue";

const router = useRouter();
const framework = {
  getRoute: () => ({ pathname: router.currentRoute.value.path }),
};
</script>

<template>
  <Ssgoi :config="config" :framework="framework">
    <SsgoiLayoutBoundary>
      <NuxtPage />
    </SsgoiLayoutBoundary>
  </Ssgoi>
</template>

Solid Router and SolidStart

Render the provider inside <Router> so useLocation works. SolidStart uses the same setup in its router root.

7.x

import { Ssgoi } from "@ssgoi/solid";
import { SsgoiRouteBoundary } from "@ssgoi/solid/solid-router"; // or "@ssgoi/solid/solidstart"

function Root(props: RouteSectionProps) {
  return (
    <Ssgoi config={config}>
      <SsgoiRouteBoundary>{props.children}</SsgoiRouteBoundary>
    </Ssgoi>
  );
}

8.0

import { useLocation, type RouteSectionProps } from "@solidjs/router";
import { Ssgoi, SsgoiLayoutBoundary } from "@ssgoi/solid";

function Root(props: RouteSectionProps) {
  const location = useLocation();
  return (
    <Ssgoi
      config={config}
      framework={{ getRoute: () => ({ pathname: location.pathname }) }}
    >
      <SsgoiLayoutBoundary>{props.children}</SsgoiLayoutBoundary>
    </Ssgoi>
  );
}

Qwik City

Pass Qwik City's location store where SSGOI is attached. useSsgoiLayoutBoundary takes no arguments; a stable key for a shell comes from config.layouts.

7.x

// src/routes/layout.tsx
useSsgoi(root, { config$ });

// a page or group layout
import { useSsgoiRouteBoundary } from "@ssgoi/qwik/qwik-city";

const boundary = useSsgoiRouteBoundary();
<article key={boundary.value.key} data-ssgoi-transition={boundary.value.id}>

8.0

// src/routes/layout.tsx
import { useLocation } from "@builder.io/qwik-city";
useSsgoi(root, { config$, framework: { location: useLocation() } });

// a page or group layout
import { useSsgoiLayoutBoundary } from "@ssgoi/qwik";

const boundary = useSsgoiLayoutBoundary();
<article key={boundary.value.key} data-ssgoi-transition={boundary.value.id}>

Angular Router

Bind an ssgoiFramework on the [ssgoi] element; the routed pages switch from *ssgoiRouteBoundary to *ssgoiLayoutBoundary, which takes no input.

7.x

// app.component.ts
template: `<main ssgoi [config]="config()"><router-outlet /></main>`

// page.component.ts
import { SsgoiRouteBoundary } from "@ssgoi/angular/router";

@Component({
  standalone: true,
  imports: [SsgoiRouteBoundary],
  template: `<article *ssgoiRouteBoundary="let boundary">…</article>`,
})
export class PageComponent {}

8.0

// app.component.ts
import { NavigationEnd, Router, UrlTree } from "@angular/router";
import { Ssgoi, type SsgoiFramework } from "@ssgoi/angular";

const framework: SsgoiFramework = {
  getRoute: (injector) => {
    const router = injector.get(Router);
    const { root } = router.parseUrl(router.url);
    return { pathname: router.serializeUrl(new UrlTree(root)) };
  },
  onNavigate: (injector, callback) => {
    const subscription = injector.get(Router).events.subscribe((event) => {
      if (event instanceof NavigationEnd) callback();
    });
    return () => subscription.unsubscribe();
  },
};

template: `
  <main ssgoi [config]="config()" [ssgoiFramework]="framework">
    <router-outlet />
  </main>
`

// page.component.ts
import { SsgoiLayoutBoundary } from "@ssgoi/angular";

@Component({
  standalone: true,
  imports: [SsgoiLayoutBoundary],
  template: `<article *ssgoiLayoutBoundary="let boundary">…</article>`,
})
export class PageComponent {}

Expo Router

Pass Expo Router's StackRouter and unstable_integrateWithRouter as framework, at module scope so the navigator is built once.

7.x

// app/_layout.tsx
import { Ssgoi } from "@ssgoi/react-native";
import { SsgoiRouteBoundary } from "@ssgoi/react-native/expo-router";

export default function Layout() {
  return (
    <Ssgoi config={config}>
      <SsgoiRouteBoundary />
    </Ssgoi>
  );
}

8.0

// app/_layout.tsx
import { StackRouter, unstable_integrateWithRouter } from "expo-router";
import { Ssgoi, SsgoiLayoutBoundary } from "@ssgoi/react-native";

const framework = { StackRouter, unstable_integrateWithRouter };

export default function Layout() {
  return (
    <Ssgoi config={config} framework={framework}>
      <SsgoiLayoutBoundary />
    </Ssgoi>
  );
}

Each framework guide has the complete files, including the layout shell around <Ssgoi>.

Boundary props: routeKey, resolve and the rest

SsgoiLayoutBoundary takes no SSGOI props. Its id is the route path and its key comes from config.layouts.

7.x prop8.0
routeKey (every framework), Angular key:, Qwik useSsgoiRouteBoundary(key)Declare the section in config.layouts. A boundary at depth N keys by the scope that matches at depth N, so it stays mounted while navigation stays inside it.
resolve(location) returning a custom idThe id is the route path. Strip locale or tenant prefixes with config.middleware; in React you can also return the path you want matched from useRoute. For anything else, write a keyed boundary yourself.
Next.js resolve with selectedSegments for a modalReturn renderedPath from useRoute, as in the Next.js snippet above.
Next.js parallelRoutesKeyPass the slot name to useSelectedLayoutSegments(slot) inside your useRoute. One useRoute serves every boundary under the provider.
Next.js fallbackNo replacement. The first boundary renders nothing until the route is known.
Next.js selectedSegmentsToPathNo export. Compute renderedPath inside useRoute.
Expo resolve and routeKeyNo replacement. Each screen keys by its own native route; Expo's nested navigators define shared layouts.

The most common case is a persistent shell that kept its tabs mounted with a fixed routeKey:

7.x

// app/shop/layout.tsx — 7.x
<SsgoiRouteBoundary routeKey="shop">
  <ShopTabs />
  <SsgoiRouteBoundary>{children}</SsgoiRouteBoundary>
</SsgoiRouteBoundary>

8.0

// ssgoi config — 8.0: declare the section once
const config = {
  layouts: [{ paths: "/shop/**" }],
  transitions: [/* unchanged */],
};

// app/shop/layout.tsx — the root boundary (depth 0) keeps one key for every
// /shop route, so the tabs stay; this boundary (depth 1) keys by the path.
<>
  <ShopTabs />
  <SsgoiLayoutBoundary>{children}</SsgoiLayoutBoundary>
</>

Persistent layouts covers nested scopes, per-instance shells such as /projects/:id, and tab layouts in depth.

SsgoiTransition

It only marked an element with data-ssgoi-transition. Write the attribute yourself.

SSGOI discovers marked elements under the provider on its own. The element still needs a key that changes when the route changes; the attribute names the route, the remount starts the transition. For routed pages, SsgoiLayoutBoundary sets both for you.

7.x

// React, Solid, Qwik
<SsgoiTransition id="/posts">…</SsgoiTransition>

<!-- Svelte -->
<SsgoiTransition id="/posts">…</SsgoiTransition>

<!-- Vue -->
<SsgoiTransition :id="route.path">…</SsgoiTransition>

<!-- Angular (imports: [SsgoiTransition]) -->
<section ssgoiTransition="/posts">…</section>

8.0

// React, Solid, Qwik
<div data-ssgoi-transition="/posts">…</div>

<!-- Svelte -->
<div data-ssgoi-transition="/posts">…</div>

<!-- Vue -->
<div :data-ssgoi-transition="route.path">…</div>

<!-- Angular -->
<section data-ssgoi-transition="/posts">…</section>
<section [attr.data-ssgoi-transition]="path">…</section>

React unplugin

@ssgoi/react/unplugin and its /vite, /webpack, /rollup and /esbuild entries are removed with no replacement.

The plugin injected keys into calls to an element-level transition() helper that the packages no longer export, so it has nothing left to do. Remove it from your bundler config.

7.x

// vite.config.ts
import react from "@vitejs/plugin-react";
import ssgoiAutoKey from "@ssgoi/react/unplugin/vite";

export default defineConfig({
  plugins: [react(), ssgoiAutoKey()],
});

8.0

// vite.config.ts
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [react()],
});

Preset options

Four option names that were renamed in earlier releases lose their old spelling. The motion is the same.

7.x

axis({ feel: "snappy" });
axis({ feel: "fluid" });
drill({ type: "crossfade" });
sheet({ type: "background-scale" });
zoom({ type: "blur", fade: true });

8.0

axis({ variant: "snappy" });
axis();
drill({ type: "slide" });
sheet({ type: "scale" });
zoom({ type: "blur", variant: "fade" });

feel: "fluid" was already the default tone of the x axis, so drop it. The transition pages list every type and variant.

Hero and zoom markup

Shared elements are paired by explicit enter and exit keys, and their geometry is read from the DOM.

data-hero-key

Put data-hero-exit-key on the element you leave from and data-hero-enter-key on the element you arrive at, with the same value. The roles also hold on the way back, so Hero no longer needs the history direction to choose which side flies above the pages.

7.x

// list page
<img data-hero-key={item.id} src={item.thumbnail} />

// detail page
<img data-hero-key={item.id} src={item.full} />

8.0

// list page: the side you leave from
<img data-hero-exit-key={item.id} src={item.thumbnail} />

// detail page: the side you arrive at
<img data-hero-enter-key={item.id} src={item.full} />

Aspect ratio and radius hints

data-hero-aspect-ratio, data-hero-radius and data-zoom-radius are no longer read, and there is no override left. Put the key on an <img>, or on a wrapper with exactly one direct <img>child. The ratio comes from the image's natural size, or from its width and height attributes before it loads; the fit comes from a centered object-fit: cover or contain. Corners come from a uniform CSS border-radius on the keyed element or a clipping ancestor inside the page.

7.x

<div
  data-hero-exit-key={item.id}
  data-hero-aspect-ratio="4/3"
  data-hero-radius="12"
>
  <img src={item.thumbnail} />
</div>

<img data-zoom-exit-key={photo.id} data-zoom-radius="16" src={photo.thumbnail} />

8.0

<div
  data-hero-exit-key={item.id}
  style={{ borderRadius: 12, overflow: "hidden" }}
>
  <img
    src={item.thumbnail}
    width={800}
    height={600}
    style={{ width: "100%", height: "100%", objectFit: "cover" }}
  />
</div>

<img
  data-zoom-exit-key={photo.id}
  src={photo.thumbnail}
  style={{ borderRadius: 16 }}
/>

Route patterns

A bare "*" is no longer an alias for every path.

7.x

const config = {
  transitions: [{ on: "*", transition: fade() }],
};

8.0

const config = {
  transitions: [{ on: "/**", transition: fade() }],
};

Check on, except, from, to and config.layouts paths. A bare "*" left in place is read as /*, which matches only single-segment paths.

Motion APIs

Two helpers that predate select() are removed.

7.x

import { IntegratorProvider } from "@ssgoi/core";

export const integrator = IntegratorProvider.fromSpring({ stiffness: 300, damping: 30 });

drill({}, {
  override: {
    forward({ animation }) {
      animation.set("in", {
        integrator: { spring: { stiffness: 300, damping: 30 } },
      });
    },
  },
});

8.0

import { IntegratorProvider, drill, spring } from "@ssgoi/core";

export const integrator = IntegratorProvider.from({
  spring: { stiffness: 300, damping: 30 },
});

export const tunedDrill = drill(
  {},
  {
    override: {
      forward({ animation }) {
        animation.select("in").set({
          integrator: spring({ stiffness: 300, damping: 30 }),
        });
      },
    },
  },
);
select(name).set() takes an integrator instance, not the { spring } shape the old two-argument set accepted. Wrap physics with spring() or IntegratorProvider.from(); anything without step and isSettled throws.

Removed types

Type-only exports that described the removed APIs.

Removed typeUse instead
TrackPatchAnimationPatch
SsgoiTransitionsOptionNonNullable<SsgoiConfig["transitions"]>
AxisFeelDeprecatedAxisXVariant
DrillTypeDeprecatedDrillType
SheetTypeDeprecatedSheetType
RouteBoundaryState, SsgoiRouteBoundaryProps and the router location types (NextjsRouteLocation, RemixRouteLocation, SveltekitRouteLocation, AngularRouteLocation, ExpoRouteLocation)SsgoiFramework for the route object; SsgoiLayoutBoundaryProps where the package exports it

Staying on 7.5

If you are not ready to migrate, keep every package on 7.

npm install @ssgoi/react@7

7.5 has the new interface alongside the deprecated one, so you can migrate to the current names there first and upgrade to 8 once nothing from the tables above is left.

Read next

Agent-oriented version: /llms/migration-v8.txt