Loading…
Topic
React
30 posts about React. Every summary links to the original.
- 30 posts
- 13 companies
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.
Newest first
Posts
Working with ChatGPT Functions on Heroku
Menu Maker is a Node.js web application that turns user-supplied ingredients into a dish name, fine-dining description, ingredient list, and recipe. Its React front end communicates with an Express back end, which adds prompt instructions and sends the request to OpenAI’s Chat Completions API. The application uses ChatGPT’s function calling feature to define an updateDish function with structured JSON fields for the title, description, ingredients, and recipe, so parsed arguments can update React state directly. The GitHub-hosted Node.js monorepo is deployed to Heroku, where an OPENAI_API_KEY config var authenticates requests, an optional CHATGPT_MODEL selects the model, and Heroku runs yarn build and yarn start.
Enterprise
This workshop shows SaaS developers how to add SCIM provisioning to an application so enterprise customers can manage users across systems, including people who have not yet logged in. It builds SCIM server functionality into a React and Express Todo application, connects it to an Okta client, and tests lifecycle operations such as importing, updating, deprovisioning, and reprovisioning users. The implementation follows SCIM 2.0 with JSON-based REST endpoints for creating, retrieving, filtering, updating, and deleting users, plus bearer-token authentication, SCIM content-type headers, logging, and soft deletion. It also explains production considerations, including unique identifiers and mapping each request’s API token to the correct organization for multitenancy. The completed application supports OIDC authentication alongside SCIM provisioning.
How to Get Going with the On
This workshop setup guide prepares a minimal Todo SaaS application for a series of enterprise-readiness workshops, while warning that the base app is not production quality and has intentional security shortcomings. It uses a React frontend, an Express API written in TypeScript, SQLite persistence, Prisma for ORM and database visualization, and an Nx workspace for shared project commands. Developers install Node.js v18 or higher, obtain the repository, run npm ci, seed two users with npm run init-db, and start the application with npm start. The frontend runs on localhost:3000, the API on localhost:3333, and Prisma Studio on localhost:5555 for inspecting users and todos. The guide concludes by directing developers to workshops covering OpenID Connect, SCIM, Terraform, Okta Workflows, and cross-application sign-out.
Prompt design
The post argues that “prompt design” better describes prompt construction than “prompt engineering,” comparing it with web design. It frames prompts as clear communication with dynamic inputs that must adapt to changing content and context-window limits, then identifies shared practices such as inspecting rendered output, using composable declarative components, and pursuing precise formatting. For LLM agents, the analogy extends to interactive websites whose prompts re-render after function calls, although text-only output and caching constraints differ. This perspective motivates Priompt, a React-like, JSX-based library used internally at Cursor, with a preview site that renders prompts using real request data and serialized props; the author considers JSX more ergonomic than string templates while noting that model capabilities and platform abstractions may weaken the analogy over time.
The JavaScript Ecosystem is Delightfully Weird
The post explains why the JavaScript ecosystem is “delightfully weird,” arguing that its defining feature is not JavaScript’s oddness but the layers of transformation surrounding it. Bundlers first changed source boundaries by minimizing, tree-shaking, code-splitting, and producing executable files different from those developers wrote; CoffeeScript, Babel, TypeScript, JSX, Svelte, and esbuild extended that pattern. Frameworks and tools also make the ecosystem a “Big Tent,” allowing imports of CSS or PNG files and adding semantics outside ECMAScript, such as Svelte’s reactive labels and TypeScript annotations. React Server Components push this further: “use server” and “use client” are valid no-op statements whose placement changes code meaning, while RSC compiles into a stream of tagged JSON and depends on bundlers. The post presents this cooperation among languages, frameworks, routers, and bundlers—including the server/client interaction demonstrated in Dan Abramov’s React talk—as profound and beneficial, especially for geographically distributed application styles.
A love letter to React
React’s 2013 release had a lasting impact on frontend development and influenced Phoenix LiveView through its reactive component model, JSX colocation, and efficiency. Chris McCord explains how a component’s state and render function create a simple programming model, then shows LiveView adapting that model to a stateful server process with HTML-aware function components and slots. The discussion argues that tightly coupled markup and code should live together, while extensible components preserve HTML structure and support customization without bespoke templates. For rendering efficiency, React computes virtual DOM diffs, whereas LiveView tracks static and dynamic HEEx template parts, sends minimal diffs over the network, and applies client-side patches with morphdom. The conclusion credits React with shaping Phoenix’s direction and argues that backend frameworks should provide HTML-aware component systems.
Want to Improve UI Performance? Start by Understanding Your User
Shopify’s team examined UI performance in the Marketing section of the Shopify admin, aiming to improve load time, perceived load time, and interactions after navigation. They tested the experience on a low-end Moto G3, profiled browser activity with Chrome Developer Tools and React DevTools, and used merchant workflows to reorder priorities. The work reduced unnecessary initial work by memoizing repeated date-formatting tasks, deferring the nonessential ImagePicker bundle, and prefetching that component and its data when a merchant hovered over its activator; memoization cut one component’s render time from about 64.7 ms to 0.5 ms. For loading states, the team recommends stable skeletons with static headings and immediately useful controls, such as the Create campaign button, so merchants can act before unrelated data arrives.
Building a Data Table Component in React
Building a responsive data table in React requires preserving a rigid grid while accommodating narrow screens, long words, readable alignment, contextual headings, and accessible markup. The Polaris example starts with headings and rows passed as props, then maps them into a stateful table component and a stateless Cell subcomponent. To contain overflow, the table sits in a max-width: 100vw wrapper with horizontal scrolling, while an absolutely positioned, explicitly sized first column remains fixed and later cells receive matching left spacing. Because absolute positioning breaks natural row-height behavior, refs, clientHeight measurements, Math.max, componentDidMount(), and resize handling recalculate and apply the tallest height for each row. The finished component adds a caption and scope attributes for screen readers, and the described result is a responsive, accessible table for comparing and analyzing data, with the full Polaris version adding truncation, totals, sorting, and navigation.
Modern Web Stack: Rails 5 API, ActiveAdmin, and Create React App on Heroku
Modern Rails applications can combine a Rails 5 API-only backend, ActiveAdmin for CMS capabilities, and a Create React App frontend in one Heroku-hosted project. The tutorial addresses the tension between Rails API mode, which omits views and middleware, and ActiveAdmin’s need to serve HTML and use cookies, flash, sessions, and assets. It restores those pieces by switching ApplicationController to ActionController::Base, adding forgery protection and middleware, reintroducing sprockets, and defining a separate ApiController that retains ActionController::API. The frontend uses Create React App, API proxying during development, React Router for client-side routes, and a build process that serves the compiled app from Rails on Heroku, including a React 404 for unmatched paths. A smoothie-recipes example demonstrates the resulting setup.
Introducing Heroku’s React Refetch Operations Console
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.
Related topics
All topics →Weekly digest
The best engineering reads, once a week.