# Migrating to 1.0.0

> Mechanical changes to move from 0.x to 1.0.0. Every breaking change with a before and after.

Source: https://pixi-reels.schmooky.dev/reference/migrating-to-1-0/

This page covers the 0.x to 1.0.0 step. Its `After` snippets are written in v2
form so they still run today, but several names changed again in 2.0.0. Do this
page's rewrites first, then [Migrating to 2.0](/reference/migrating-to-2-0/),
which starts with a codemod that handles the mechanical half.

Every breaking change in 1.0.0 is below with a before and after snippet. Each section is mechanical: find the pattern, apply the rewrite. Every pre-1.0 pattern appears verbatim in a `Before` code block, so a `git grep skip()` or `git grep visibleSymbols` in your repo lands on the matching rewrite here.

## visibleSymbols is gone

The deprecated `visibleSymbols` builder setter is removed. It aliased `visibleRows`, which 2.0.0 renamed again to `visibleCells`. Replace every call:

Before:

```ts
// Pre-1.0 code: .visibleSymbols(3) is removed in 1.0.
builder
  .reels(5)
  .visibleSymbols(3);
```

After:

```ts
builder.reels(5).visibleCells(3);
```

## setResult and initialFrame accept only ColumnTarget[]

The legacy `string[][]` form is removed, including the negative-index buffer-above mutation pattern. `ReelSet.setResult` and `ReelSetBuilder.initialFrame` accept only `ColumnTarget[]`.

Before (legacy form with a buffer-above prefill):

```ts
// Pre-1.0 code. Will not type-check against 1.0.
const grid: string[][] = [
  ['A', 'B', 'C'],
  ['A', 'B', 'C'],
];
// Buffer-above slot 0 was set via negative-index property assignment:
(grid[1] as any)[-1] = 'COIN';
reelSet.setResult(grid);
```

After:

```ts
reelSet.setResult([
  { visible: ['A', 'B', 'C'] },
  { visible: ['A', 'B', 'C'], bufferStart: ['COIN'] },
]);
```

If your server returns a plain `string[][]` of visible rows, convert at the boundary:

```ts
const response: string[][] = await server.spin();
reelSet.setResult(response.map((visible) => ({ visible })));
```

The same conversion applies to `ReelSetBuilder.initialFrame(...)` and to the `grid` field passed to `ReelSet.refill(...)`.

## Hidden exports from the package entry

Eight types and classes are no longer re-exported from `pixi-reels`. They remain in the source tree but are not part of the public API.

| Removed export | What it was | Replacement |
|---|---|---|
| `OCCUPIED_SENTINEL` | The cross-reel stub the engine paints into big-symbol non-anchor cells | Never produce or consume directly. `ReelSet.getVisibleGrid()` resolves stubs to anchor ids. |
| `ReelMotion` | Per-`Reel` Y-displacement and wrap helper | Wired by `Reel` itself. |
| `StopSequencer` | Per-`Reel` target-frame manager | Wired by `Reel` itself. |
| `ReelSetInternalConfig` | Shape internal to the builder-to-engine handoff | Use `ReelSetBuilder` to wire a `ReelSet`. |
| `ResolvedReelGridConfig` | Same | Same. |
| `SymbolFactory` | Pooling layer for symbol instances | Register symbol classes via `builder.symbols(registry => ...)`. |
| `RandomSymbolProvider` | Weighted symbol picker | Pass weights via `builder.weights({...})`. |
| `OffsetCalculator` | Geometry helper for `ReelViewport` | Internal. |

If you imported any of these from `pixi-reels`, remove the import. If you need the internal, import it from the source path; internals can change without a major bump.

## SpinController and the built-in phase classes are hidden

`SpinController`, `SpinControllerHooks` and the built-in phase classes (`StartPhase`, `SpinPhase`, `StopPhase`, `AnticipationPhase`, `AdjustPhase`, `CascadeFallPhase`, `CascadePlacePhase`, `CascadeDropInPhase`) are no longer exported. `ReelSet` wires the controller itself, so a game never constructs one. A custom phase extends `ReelPhase` rather than a built-in; the built-ins were not designed for subclassing.

The phase config types (`StartPhaseConfig`, `SpinPhaseConfig` and the rest) stay exported as stable shape descriptions.

Before:

```ts
// Pre-1.0 code. Removed in 1.0.
import { SpinController, StartPhase, SpinPhase } from 'pixi-reels';

class MyStartPhase extends StartPhase {
  // ...
}
```

After:

```ts
import { ReelPhase, type StartPhaseConfig } from 'pixi-reels';

class MyStartPhase extends ReelPhase<StartPhaseConfig> {
  // ...
}

builder.phases((f) => f.register('start', MyStartPhase));
```

## Internal-leaking methods lost their leading underscore

Three methods on `Reel` and `ReelSet` were called across files under the underscore convention. They lose the underscore, and their JSDoc now names the call sites.

| Before | After |
|---|---|
| `Reel._getAnchorCell(visibleRow)` | `Reel.getAnchorCell(visibleCell)` |
| `ReelSet._peekTargetShape()` | `ReelSet.peekTargetShape()` |
| `ReelSet._clearTargetShape()` | `ReelSet.clearTargetShape()` |

Do not call these from a game. They are marked `@internal` and stripped from the published `.d.ts` (next section).

## Internal methods stripped from .d.ts (`stripInternal`)

`tsconfig.json` now sets `"stripInternal": true`. Methods marked `@internal` in JSDoc stay in the runtime JS, so the engine's own cross-file callers keep working, but they are absent from the published `.d.ts` and no longer show up in autocomplete.

Affected methods on `Reel`:

- `setStopFrame`, `setCrossReelResolver`, `getAnchorCell`, `notifySpinStart`, `notifySpinEnd`, `notifyLanded`, `snapToGrid`, `reshape`.

If your code typechecked against `Reel.reshape(...)` or any of the above, switch to the public alternative:

- For reshape, `reelSet.setShape([...])`. It only runs on a MultiWays slot and migrates pins in the same step.
- For grid inspection, `reelSet.getVisibleGrid()`, `reelSet.getSymbolFootprint()` and `reelSet.getBlockBounds()`.

## skip is now skipSpin

`skip()` is renamed `skipSpin()`, so it reads alongside `skipNudge()`. `slamStop()` is unchanged: it lands now, unconditionally, with no boost.

Before:

```ts
// Pre-1.0 code: reelSet.skip() is removed in 1.0.
reelSet.skip();
```

After:

```ts
reelSet.skipSpin();
```

The three actions side by side:

```ts
reelSet.skipSpin();   // Round-aware spin land. Applies the boost / auto-slam side effect.
reelSet.skipNudge();  // Fast-forward an in-flight nudge() to its landed position.
reelSet.slamStop();   // Unconditional land-now. No boost. For tests, anti-cheat.
```

## refill() returns RefillResult, accepts a signal

`reelSet.refill()` takes a `RefillOptions` object and returns a `RefillResult`, shaped like the result of `runCascade`, instead of a `SpinResult`. A caller that discards the return value keeps working.

Before:

```ts
// Pre-1.0: refill returned SpinResult.
const result: SpinResult = await reelSet.refill({ winners, grid });
console.log(result.symbols); // string[][]
```

After:

```ts
import type { RefillOptions, RefillResult } from 'pixi-reels';

const result: RefillResult = await reelSet.refill({
  winners,
  grid,
  signal: ac.signal, // new: abort mid-refill, the await unblocks immediately
});
console.log(result.finalGrid, result.winnersRefilled, result.wasSkipped);
```

`finalGrid` and `wasSkipped` are the same fields `RunCascadeResult` has. `winnersRefilled` and `duration` belong to a refill and cover one stage.

## Testing utilities moved to pixi-reels/testing

The headless harness is a separate subpath export, so a production bundle never pulls it in, even when tree-shaking is imperfect.

Before:

```ts
// Pre-1.0. Removed from the main entry in 1.0.
import {
  createTestReelSet,
  FakeTicker,
  HeadlessSymbol,
  spinAndLand,
  captureEvents,
  expectGrid,
  countSymbol,
} from 'pixi-reels';
```

After:

```ts
import {
  createTestReelSet,
  FakeTicker,
  HeadlessSymbol,
  spinAndLand,
  captureEvents,
  expectGrid,
  countSymbol,
} from 'pixi-reels/testing';
```

The types (`TestReelSetOptions`, `TestReelSetHandle`) move with them. The Spine subpath (`pixi-reels/spine`) is unchanged.

## Concurrent calls during nudge() now throw

`spin()`, `setResult()`, `pin()` and `setShape()` throw while a `nudge()` is still tweening. Await the nudge promise before calling any of them.

Before (undefined behavior, no error):

```ts
const nudging = reelSet.nudge(2, { distance: 1, direction: 'forward', incoming: ['wild'] });
// reelSet.spin() here used to race the nudge tween silently.
```

After (the engine throws "ReelSet.spin: cannot be called while nudge() is in flight."):

```ts
const nudging = reelSet.nudge(2, { distance: 1, direction: 'forward', incoming: ['wild'] });
await nudging;
await reelSet.spin();
```

If your UI lets the player press spin during a nudge, call `reelSet.skipNudge()` first, which fast-forwards the nudge to its landed position, then call `spin()`.

## symbol:recycled event removed

The `'symbol:recycled'` field on the per-reel `ReelEvents` interface is removed. Nothing ever emitted it. Delete any listener you registered for it.

## /guides/spine-pins/ renamed to /guides/pins/

A pin works with `SpriteSymbol`, `AnimatedSpriteSymbol`, `SpineSymbol` or any other `ReelSymbol` subclass, so the old URL was misleading. The page is now at `/guides/pins/`. The old path redirects permanently, so bookmarks keep working.
