Early development: IFLoom can change until 1.0. What's stable
IFLoom

Upgrade IFLoom

Move a game to a newer IFLoom release by raising every @ifloom range together and fixing what TypeScript and the checker report.

Use this when a new IFLoom release is out and you want your game on it. The engine carries players' saves and older packs forward by itself, so the work is in your own content and code. You need the game's package.json and a passing ifloom check on the release you have now.

Read the changelog

Read the changelog from the release you have to the one you're moving to. Each release lists what it added, changed, removed and fixed, written for someone making a game. The changes under Changed and Removed are the ones your content may need.

Raise every @ifloom range together

Change the range of every @ifloom/* package in package.json to the new release, in dependencies and devDependencies alike. The packages are released together, and each plugin and the React UI peer on the engine, so a game uses one version of all of them. A move from 0.1 to 0.2 changes every line:

{
  "dependencies": {
    "@ifloom/engine": "^0.2.0",
    "@ifloom/plugin-places": "^0.2.0",
    "@ifloom/react": "^0.2.0"
  },
  "devDependencies": {
    "@ifloom/cli": "^0.2.0"
  }
}

A caret on a 0.x version accepts later releases of the same minor version only, so a new minor release always needs this edit. Then install:

npm install

Fix what TypeScript and the checker report

Run the typecheck, then the content checker:

npm run typecheck
npm run check

The engine never upgrades your own content, because you build it with the engine it runs on. TypeScript reports a field or a function the release renamed or removed. The checker reports content that still type-checks but is written in an older form, such as a label that names a prose key, with the way to write it now. Content written in an older form lists those problems, and Schema history says what each schema changed.

Check that the story still reads the same

Run ifloom snapshot and ifloom playtest, as Playtest and snapshot describes. A snapshot written on the old release prints changed: <scene> @ <probe> for each scene that now reads differently, so you can read each one and decide whether the release meant it. Run your own tests too, since a test that plays a route catches a choice that's no longer offered.

Check your packs and mods

loadGame upgrades each pack it's given, mods and unlocked content included, from the schema the pack records. A pack you wrote in TypeScript with schema: SCHEMA always matches. A pack kept as JSON, such as a mod file a player added, comes in through upgradePack and needs no change.

A pack written for a newer schema than the engine reads is skipped whole, with a problem like this one:

mod:night-market · pack · written for schema 2, this engine reads 1

A player sees it when they load a mod made for a newer build of your game than the one they have. A pack from before the engine's oldest step is too old to upgrade, and is skipped with written for schema <n>, too old for this engine to read (it reads 1).

Check players' saves

A player's saves need nothing from you for the engine's own changes. loadState carries a save from any older engine forward when it loads, and Older saves says how. A plugin carries its own state the same way.

Your game's changes are yours to carry. When the update renames a kv key, reshapes the game's own state or adds a stat that starts above 0, give the game a new version and a migration step, as Migrate your players' saves shows. Load a save from the old release in a test before you ship.

These pages describe what the upgrade uses:

Last updated on

On this page