# typesafe-actions is on 5.1.0 and its documentation is still the version 4 text

> A Redux utility library with no runtime dependencies, a build step that deletes the size file its own README quotes, and a documentation trail that runs through three GitHub issues because the v5 reference was never written.

**piotrwitek/typesafe-actions** — Typesafe utilities for "action-creators" in Redux / Flux Architecture

- Repository: https://github.com/piotrwitek/typesafe-actions
- Website: https://codesandbox.io/s/github/piotrwitek/typesafe-actions/tree/master/codesandbox
- Stars: 2,404 · Forks: 109
- Language: TypeScript
- License: MIT
- Published: 2026-09-28 · Updated: 2026-09-28 · Language: en
- Canonical page: https://hysenlabs.com/projects/piotrwitek-typesafe-actions

## The status block at the top says the API docs are still v4

Near the top of the README, beside a line announcing TypeScript v3.7 support, a warning says the library was recently updated to v5 and that the current API docs and tutorial are outdated, from v4, with a link to issue 143 standing in as the v5 reference. The table of contents keeps the gap in its own anchor names: one entry reads Tutorial v4 with v5 is WIP 188, another reads API Docs v4 with v5 is WIP 189. So the version 5 documentation is spread across three issue numbers, 143, 188 and 189, in a repository with 59 open issues. Nothing else in the file closes that hole. After the tutorial's prerequisites warning, the Constants section opens with a recommendation about not exporting string constants and stops in the middle of the sentence.

## Snapshots sit next to the source and a git push rewrites them

The test script has two halves. Jest runs with a config file, then an external binary called dts-jest-remap walks ./src/*.spec.ts and renames each type snapshot through the template {{basename}}.snap.{{extname}}, and the --check flag makes a mismatch fail the run. The update script drops --check and adds jest --no-cache -u, so it overwrites the snapshots instead of comparing them. Both halves live in the husky pre-push hook, together with prettier:fix, lint and tsc and doctoc:

```bash
npm run prettier:fix && npm run lint && npm run tsc && npm run test:update && npm run doctoc
```

The consequence is that pushing is a rewriting operation. Your source gets reformatted, your type snapshots are regenerated, and the table of contents in the README is rebuilt, all before the commit leaves. The ci-check script does the read-only version of the same work: prettier, lint, tsc and test.

## main is a checked-in index.js while every other entry field points into dist

The manifest sets types to dist/index.d.ts, module to dist/typesafe-actions.es.production.js and browser to dist/typesafe-actions.umd.production.js. None of those files is in the tree, because dist is a build product. What is in the tree is a root index.js, which is what main points at, so a CommonJS consumer resolves the package from a file committed to the repository while ESM, UMD and type resolution all depend on a build having happened locally first. The build itself is two commands, and the step before it clears the output directory:

```bash
tsc -p ./tsconfig.build.json && rollup -c
```

The preceding script removes dist/ and .size-snapshot.json and then compiles with tsconfig.declaration.json, a third config file alongside tsconfig.json and tsconfig.build.json. One more detail: the manifest's homepage field points back at the GitHub repository rather than at the playground, while the repository homepage is a CodeSandbox tree.

## The size the README advertises comes from a file the build deletes

The goals section promises no third-party dependencies and attaches a figure to a tool called size-snapshot: 3.48 KB minified and 1.03 KB gzipped, with a bundlephobia link beside it. A .size-snapshot.json file is committed at the repository root, and the prebuild script deletes it along with dist before every compile. The committed copy therefore records whatever the last build on a contributor's machine produced, and the number in the README is a copy of that file rather than a fresh measurement. The same goals section describes three distribution formats, cjs, esm and umd, each with separate bundles for development and production, the way React ships them. Related root files include .npmignore, which decides what reaches the registry, and .browserslistrc, which the rollup config would use when emitting the browser build.

## engines allows node 4 while lint still runs tslint

The manifest declares an engines floor of node 4 or newer. Everything in the script list is newer than that floor suggests: tsc for the type check, rollup for the bundles, jest for the runtime tests, doctoc for the table of contents, prettier over src/**/*.ts, and tslint for linting with the project tsconfig.json. A tslint.json file is still at the root next to .prettierrc and .editorconfig. Type checking and declaration emit use different configs on purpose: the tsc script runs tsconfig.build.json with --noEmit, so it verifies without writing, while prebuild runs tsconfig.declaration.json, which is what produces the dist/index.d.ts that the types field promises. There is also a reinstall script that removes node_modules and dist before installing again.

## The tutorial stops on its first recommendation

The install block is two commands and a comment above each:

```bash
# NPM
npm install typesafe-actions

# YARN
yarn add typesafe-actions
```

After it comes the tutorial heading, still labelled v4, a warning that asks the reader to be comfortable with type inference, control flow analysis, tagged union types, generics and advanced types, and then the Constants section. That section opens with a recommendation that you will not need to export and reuse string constants, because action creators carry a static property holding the action type that helpers read, and it ends on the words use it in reducers, epics, sagas, with a comma and nothing after it. The rest of the file that this heading promises, actions, action helpers, reducers and async flows, exists only as table of contents entries.

## v5.1.0 from 2019 is the newest tag and the branch was pushed in 2026

Three releases are published: v5.1.0 on 2019-11-05, v4.4.2 on 2019-06-23 and v4.4.1 on 2019-06-14. The manifest version matches the newest tag, so nothing is out of sync there, and the default branch master was last pushed 2026-05-09. The gap is between those two facts: the published artifact has not moved since 2019 while the branch has taken pushes. The migration section reflects a library that has changed shape often, with guides for v4 to v5, v3 to v4, v2 to v3 and v1 to v2, plus one for moving from redux-actions. The comparison against redux-actions is a table of contents entry too, and so is the recipe for restricting the meta type in the action creator.

## Conclusion

Adopt it if you want typed action creators and reducers with nothing added to your bundle and you are willing to read the API from issue 143 instead of the site. Keep the version you already have pinned rather than tracking the default branch, since the newest published tag is v5.1.0 from 2019-11-05 while the branch was pushed as recently as 2026-05-09. Before you rely on the size figure or the tutorial, remember that a build regenerates .size-snapshot.json from scratch and that the tutorial text in this README stops on its first recommendation.

## FAQ

### How do I install typesafe-actions?

Two package managers appear in one bash block: npm install typesafe-actions and yarn add typesafe-actions, with npm listed first. Nothing else is required, because the goals section states the package carries no third-party dependencies.

### Which TypeScript version does typesafe-actions support?

The status block at the top announces support for TypeScript v3.7. The newest release is v5.1.0, published 2019-11-05, and the manifest carries the same 5.1.0.

### How does typesafe-actions test its types?

The test script runs jest --config jest.config.json, then dts-jest-remap over ./src/*.spec.ts with --check, which fails when the generated snapshots differ. The update script rewrites them with jest --no-cache -u and the same rename template.

### What is the typesafe-actions API surface?

The reference lists five action creator functions, action, createAction, createStandardAction, createCustomAction and createAsyncAction, one reducer factory called createReducer, three helpers called getType, isActionOf and isOfType, and two type helpers called ActionType and StateType.

### How does typesafe-actions compare to redux-actions?

Both the comparison and a migration guide from redux-actions are entries in the table of contents. Neither is written out in the text that is there, since the file stops at the Constants section of the tutorial.

### What size does typesafe-actions add to a bundle?

The goals section quotes 3.48 KB minified and 1.03 KB gzipped, attributed to size-snapshot, with a bundlephobia link. The prebuild script deletes .size-snapshot.json and dist before each compile, so the file behind those figures is regenerated by every build.

## Sources

- [License: MIT](https://github.com/piotrwitek/typesafe-actions/blob/master/LICENSE)
- [piotrwitek/typesafe-actions on GitHub](https://github.com/piotrwitek/typesafe-actions)
- [Project website](https://codesandbox.io/s/github/piotrwitek/typesafe-actions/tree/master/codesandbox)
- [README](https://github.com/piotrwitek/typesafe-actions/blob/master/README.md)
- [Releases](https://github.com/piotrwitek/typesafe-actions/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/piotrwitek-typesafe-actions
