HerokuRyan BrainardAnnouncement
Introducing Heroku’s React Refetch Operations Console
Summary
Heroku built an operations console for Private Spaces to provide a bird’s-eye view of the platform and detailed investigation of individual spaces. It is a single-page React application backed by a reverse proxy, but its constituent applications originally used jQuery state, mixins, or classic Flux. The team considered Redux, then rejected a global store for server-rendered data because application state was already represented in the URL. React Refetch instead maps component props to remote requests, injects immutable PromiseState props, and recalculates requests when URL parameters change. Its declarative model removes stores, callbacks, actions, reducers, and switch statements while supporting composed and chained requests, periodic refresh, custom headers and methods, lazy loading, and server writes; the team presents it as a simpler alternative when client-side state need not persist.
Context
Heroku needed new operational tooling for the infrastructure introduced with Heroku Private Spaces. The console combined applications that loaded data through incompatible patterns, while the team found component state too mutable and Redux potentially excessive for data fetched from servers. The application’s state was already represented in the URL, which also needed to remain shareable for diagnosing issues.
Approach / What changed
React Refetch wraps components in a connector and uses a pure function to map URL-derived props to remote requests. It injects each request as a PromiseState prop, automatically fetches data on mount, recalculates requests when props change, and represents loading, fulfilled, and rejected states explicitly without a global store. The library also supports composed and chained requests, periodic refreshes, custom headers and methods, lazy loading, and server writes.
Takeaways
React Refetch maps component props to requests instead of loading server data into a global Redux or Flux store.
PromiseState represents pending, fulfilled, and rejected request states as one composable prop for rendering.
Changing a URL parameter changes the corresponding prop, recalculates the request, and fetches new data automatically.
Source and freshness
- Source
- heroku.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.