{"id":20516,"library":"reshow-runtime","title":"reshow-runtime","description":"Babel runtime alternative designed to replace @babel/runtime in projects using the Reshow ecosystem. Current stable version: 0.17.15. Release cadence: irregular; major breaking changes in v0.16.0 (switched to createReducer for all stores) and v0.13-beta (moved urlDispatch/UrlReturn to reshow-url). Key differentiators: lighter footprint, supports optional chaining (?.) and nullish coalescing (??), and provides helper functions for React/Redux-like patterns. Not recommended for projects outside the Reshow framework.","status":"active","version":"0.17.15","language":"javascript","source_language":"en","source_url":"https://github.com/react-atomic/reshow","tags":["javascript","babel"],"install":[{"cmd":"npm install reshow-runtime","lang":"bash","label":"npm"},{"cmd":"yarn add reshow-runtime","lang":"bash","label":"yarn"},{"cmd":"pnpm add reshow-runtime","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only since v0.16.0. Use import syntax in Node.js with { \"type\": \"module\" } or bundler.","wrong":"const { createReducer } = require('reshow-runtime');","symbol":"createReducer","correct":"import { createReducer } from 'reshow-runtime';"},{"note":"toMap is a named export, not default. Converts all first-level immutable object keys to JS.","wrong":"import toMap from 'reshow-runtime';","symbol":"toMap","correct":"import { toMap } from 'reshow-runtime';"},{"note":"connectHook is a named export for connecting React hooks to stores. Available since v0.13-beta.","wrong":"import connectHook from 'reshow-runtime';","symbol":"connect-hook","correct":"import { connectHook } from 'reshow-runtime';"}],"quickstart":{"code":"import { createReducer, toMap } from 'reshow-runtime';\n\nconst initialState = { count: 0 };\nconst reducer = createReducer({\n  increment: (state) => ({ count: state.count + 1 }),\n  decrement: (state) => ({ count: state.count - 1 }),\n}, initialState);\n\nconst state = { count: 0 };\nconst newState = reducer(state, { type: 'increment' });\nconsole.log(newState); // { count: 1 }\n\nconst immutableObject = { a: { b: 1 } };\nconst jsObject = toMap(immutableObject);\nconsole.log(jsObject.a.b); // 1 (JS object instead of immutable Map)","lang":"typescript","description":"Demonstrates use of createReducer and toMap from reshow-runtime with a simple counter reducer."},"warnings":[{"fix":"Migrate store definitions to use createReducer with handler maps.","message":"In v0.16.0, all stores must now use createReducer. Old store patterns (e.g., createStore with handlers) are removed.","severity":"breaking","affected_versions":">=0.16.0"},{"fix":"Install reshow-url and import urlDispatch/UrlReturn from there instead.","message":"In v0.13-beta, urlDispatch and UrlReturn moved from reshow-runtime to reshow-url.","severity":"breaking","affected_versions":">=0.13.0 <0.16.0"},{"fix":"Use import syntax. If using Node.js, ensure \"type\": \"module\" or use .mjs extension.","message":"CommonJS require() is no longer supported; package is ESM-only from v0.16.0.","severity":"deprecated","affected_versions":">=0.16.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install reshow-runtime or yarn add reshow-runtime.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'reshow-runtime'"},{"fix":"Use import { createReducer } from 'reshow-runtime';","cause":"Importing createReducer incorrectly, likely as default export.","error":"TypeError: createReducer is not a function"},{"fix":"Switch to import { ... } from 'reshow-runtime';","cause":"Using CommonJS require() in ESM-only version (v0.16.0+).","error":"SyntaxError: Unexpected identifier"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}