Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Heroku Engineering 2 min read Announcement mediumAdept

Front-End Web Deep Dive: Runtime Config

Heroku's Front-End Web Cloud Native Buildpack provides runtime configuration for static web apps by writing PUBLIC_WEB_-prefixed environment variables into the HTML <head> as data-* attributes each time the bundled static server starts. JavaScript reads them via document.head.dataset, so values like API URLs can change between staging and production without a rebuild. Unlike the older create-react-app-buildpack, which rewrote the JS bundle, this approach is framework-agnostic and does not conflict with CSP or Subresource Integrity. Existing apps may need refactoring so config values are read at runtime rather than captured at build time.

Assumes: environment variablesstatic site buildsHTML data attributes

Related posts

  • Migrate a Rails App from Heroku to Render

    Render mediumAdept

    Migrating the open-source git-scm.org Rails app from Heroku to Render means mapping Heroku concepts (web/worker processes, dynos, Heroku Postgres/Redis, Scheduler, config vars) to Render equivalents and codifying the whole stack in a render.yaml Blueprint. The walkthrough defines a Ruby web service, wires PostgreSQL and Redis connection strings in through environment variables, and adds a bin/render-build.sh script for asset precompilation and migrations that Heroku's buildpack used to handle. It also prompts for secrets like the Bonsai Elasticsearch URL with sync: false, schedules nightly rake tasks as a standalone Cron Job, and deduplicates shared variables with an Environment Group. Practical tips include copying SECRET_KEY_BASE from Heroku so users stay logged in, adding a .ruby-version file, and checking Procfile, app.json and heroku.yml to discover the app's components.

  • Best-in-Class Developer Experience with Vite and Hydrogen

    Shopify Engineering easyNovice

    Shopify's Hydrogen storefront framework is built on Vite. Vite serves user code as native ES Modules and pre-bundles and caches only third-party dependencies, which speeds up dev-server startup and hot module replacement compared with bundle-based tools like Webpack. Other reasons cited for the choice are ESBuild-based transforms, Rollup plugin compatibility, automatic CJS-to-ESM conversion, and SSR hooks that allow environment-specific transforms needed for React Server Components. Hydrogen wraps this in a single Vite plugin that composes four sub-plugins (hydrogen-config, react-server-dom-vite, hydrogen-middleware, plugin-react), while Webpack remains a fit for some advanced use cases.

  • Optimizing Our Build Times by Migrating from Webpack to Rspack

    Yelp Engineering mediumAdept

    Yelp moved its JavaScript monorepo builds from Webpack to Rspack and cut integration build time by about 52% on average. Rspack was chosen over Vite because it is compatible with Webpack config. The team built an adapter that copies the existing Webpack config and swaps in Rspack-compatible plugins and values, then rolled it out in stages with per-page opt-in on CI and deployment previews. The switch alone gave about a 25% speedup on SSR builds. Codemods replacing star re-exports and import-then-export patterns with named true re-exports added more gains, and Rspack's portable persistent cache cut warm CI builds by up to 80%.

  • How to add Monaco to a Next.js app and securely run untrusted user code

    Deno mediumAdept

    A Next.js 14 app can host a browser IDE by embedding the Monaco editor via @monaco-editor/react, then sending the editor contents to server-side API routes that call the Deno Deploy Subhosting API. One route creates a uniquely named project, one creates a deployment from the submitted code, and one fetches deployment status. The client polls that status until it leaves 'pending' and, on success, loads the deployment URL in an iframe. Isolation of the untrusted code is handed off to Subhosting rather than implemented in the app. Suggested next steps include persisting projects, adding a filesystem and adding authentication.

  • The Best Declarative Deploy Configs in 2026

    Railway mediumAdept

    Railway, Render, Fly.io, Vercel and Netlify differ mainly in how much of an application's infrastructure their deploy config can reproduce. Railway's TypeScript-based IaC (Python and Go in beta) and Render's render.yaml Blueprints can declare services, databases, variables and environments, and Railway adds a plan/apply review step. Fly.io's fly.toml gives explicit per-app control over Machines, ports, health checks and regions but leaves databases and cross-app wiring to separate workflows. Vercel and Netlify configs cover builds, routing, functions and deploy contexts for frontend-centric apps. A worked Node frontend, FastAPI and Postgres example for staging and production shows that programmatic config avoids the duplication static YAML needs across environments.

The quest for software engineering knowledge.

Look:
Layout: