PRNext 0.2: more efficient rendering, broader compatibility
PRNext 0.2.0-alpha changes several stages of the same page: producing HTML, transporting values, loading JavaScript and activating components. The compiler recognizes more presentation blocks and prepares their rendering. The browser loads the client references needed by the route. Applications using TanStack Query gain a dedicated SSR integration that restores prepared data without immediately repeating the work already done on the server.
Moving from 0.1 to 0.2 reflects this combined work across the compiler, runtime and compatibility APIs. The alpha status remains explicit. The goal is practical: remove avoidable conversions and allocations while preserving expected React behavior and ordinary rendering whenever an optimization cannot be verified.
Compile the blocks a page presents
A product table often repeats one structure with different values. Rebuilding that structure at every stage costs time even when the visual result is simple. PRNext automatically extracts verified presentation blocks from production Node App Router Server Components. Surrounding imports, asynchronous work and interactive siblings stay in place; developers do not need to split the source into additional files by hand.
Recognition also covers selected JSX conditions, local scalar helpers whose properties can be proven, and literal SVG without external resources. Inactive branches do not contribute values to the compact packet. Getters, proxies, unknown consumers and custom JSX pipelines can retain ordinary rendering. The .prnext/presentation-report.json report explains these decisions. Eligibility must be checked against the real application rather than inferred from its component count.
For comparison, the following setting disables this path and keeps ordinary rendering.
export default {
presentationComponents: false,
};Keep the React root while updating verified DOM
For verified descendants, a compiled DOM plan updates the relevant text and attributes directly. React keeps the actual host root, its attributes and the component lifecycle. Server and browser HTML remain identical at hydration. This boundary avoids some presentation objects while keeping React's protocol and hydrateRoot requirements intact.
Tests cover keys, transitions between compact and ordinary rendering, focus, selection and keyboard interaction. Removal or changes that make DOM ownership uncertain return to React's recovery path. Repeated structures are a useful target for this work. It does not turn an arbitrary interactive component into an independent block, and a small static section does not automatically become faster.
Shorten SSR and reduce intermediate structures
The presentation path collects scalar values into a flat pool instead of rebuilding a small array for every row. For suitable data sets, an estimate can select binary columns and a string dictionary using official Flight records. The compact format is chosen when its estimated cost justifies the change, allowing small cases to keep a simpler representation.
An HTML writer generated at build time reads verified packets directly. It avoids reconstructing intermediate rows and React elements for the presentation hosts. Outer Flight decoding remains, along with streaming boundaries, Suspense and Server Actions. Application expressions and authorization still execute on the server. This work does not introduce a shared response cache between users.
Load the client references for the visited route
The production App bootstrap resolves client entries from verified Flight references instead of carrying an import table for every route. Origin, directory and chunk-name checks constrain that resolution. Entries remain in the same build to preserve shared React and style instances, without an intermediate manifest request.
Navigation subscriptions also separate stable pathname, search and parameter values. A query-string change does not need to notify every router consumer as though its entire context had changed. Activity snapshots and Cache Components read boundaries remain part of the model. The benefit depends on the size of the route catalogue and on how application components consume those values.
Choose when an expensive component becomes active
The explicit experimental deferHydration() API preserves a component's SSR HTML while delaying its dynamic import and hydration. Activation can follow visibility, idle time or interaction. A chart farther down a page can remain readable without immediately paying its full JavaScript cost. The loaded component still follows the normal Client Component contract.
The work moves to a later point in time. A first click may wait for code and activation, so critical controls should stay eager. Qualification covers the first click, keyboard use, forms, focus and cancellation during navigation. In a separate local measurement of a 5000-row widget, initial CPU moves from 76.1 to 42.5 ms while the first click moves from 67.8 to 105 ms. This tradeoff is not a comparison between two eagerly loaded pages.
'use client';
import { deferHydration } from '@thomas.f/prnext/hydration';
const Chart = deferHydration(() => import('./Chart'), {
when: 'visible',
rootMargin: '400px',
});Reuse the data prepared during SSR
The optional Query adapters use a QueryClient owned by the logical request. Page and metadata calls can obtain the same client without creating a global server cache. Unchanged standard snapshots share dehydration, avoiding an additional serialization of the same state on the verified path. TanStack Query packages remain optional application dependencies.
In the browser, freshness defaults on a provider created by the adapter allow received data to be reused instead of immediately fetched again. An existing provider and the application's own query options stay authoritative. The example puts the authenticated account in the key and scope; the developer supplies the authorization and data helpers. Query SSR adapters target Node and do not support Edge.
The qualified versions of @tanstack/react-query and @tanstack/query-core are 5.107.1.
import { getQueryClient, dehydrateQuery } from '@thomas.f/prnext/query/server';
import { QueryProvider } from '@thomas.f/prnext/query';
import { getAuthenticatedAccountId, loadAuthorizedProducts } from './data';
import ProductList from './ProductList';
export default async function ProductsPage() {
const accountId = await getAuthenticatedAccountId();
const client = getQueryClient();
await client.prefetchQuery({
queryKey: ['products', accountId],
queryFn: () => loadAuthorizedProducts(accountId),
});
return <QueryProvider state={dehydrateQuery(client)} scopeKey={accountId}>
<ProductList accountId={accountId} />
</QueryProvider>;
}Keep caches bounded on smaller servers
The runtime uses bounded SIEVE eviction for selected worker metadata and already parsed partial artifacts. Entry-count and byte limits remain in place, and authoritative cached data is still checked. Faster metadata handling should not be confused with the validity of a business result. Applications remain responsible for the private data they cache and the rules that invalidate it.
Fixed admission remains the default. The experimental controller enabled through PRNEXT_RESOURCE_ADMISSION=1 exists to study resource-aware admission, but constrained-CPU comparisons still show latency regressions. It is not a qualified VPS performance improvement and is not enabled automatically. Worker counts, memory limits and actual route behavior still need to fit the machine's resources.
Expand form and navigation behavior
Form accepts URL actions and React functions. Compatible same-origin GET submissions use the router while preserving native validation, repeated fields and overrides that require real navigation. Function actions retain Server Action and useActionState behavior, including submissions without JavaScript.
useLinkStatus exposes pending state for the containing App link and ends that state at the React commit, cancellation or replacement of navigation. Client instrumentation can run before hydration, while useReportWebVitals uses the official library and shares observers. A metric unavailable in the browser stays unavailable; the runtime does not manufacture measurements to fill a report.
Improve compiler and style compatibility
Recognized options for styled-components, Emotion, Relay, console or property removal and styled-jsx use their official Babel plugins. Automatic JSX style processing and response-owned HTML insertion also cover streaming and resume. Applications keep the runtime libraries and generated GraphQL artifacts required by those tools.
The imgix, cloudinary and akamai image loaders, deferred Edge work and native-adapter lifecycle hooks expand this scope. Compatibility remains partial: Next-specific executables, arbitrary private modules and complete webpack or Turbopack engines are not supplied. The three React peers remain pinned to exactly 19.3.1. A migration must be checked through application behavior, beyond the success of an import.
export default {
compiler: {
styledComponents: { ssr: true },
removeConsole: { exclude: ['error'] },
},
};One portable command for Windows, Linux and macOS
The command to use on every platform is prnext, including login, deploy and update. Windows reserves PRN as a device name even with .cmd or .ps1 extensions. npm can create prn files that PowerShell cannot execute, including through an absolute path. The prn shortcut remains available on Unix; a file on disk does not become a Windows compatibility promise.
CLI help and Cloud recovery messages now recommend prnext. Tests install the actual npm pack into a prefix with spaces and run launchers through Windows PowerShell 5, PowerShell 7 and CMD, with Node 22, 24 and 26. Linux and macOS check both names. A restrictive PowerShell script policy can use prnext.cmd without editing a profile, the registry or system policy.
npm install -g @thomas.f/prnext
prnext --version
prnext login --server https://app.prnext.devRead the SSR table gains with their conditions
A local campaign on a PR80 candidate compares PRNext with Next.js 16.4.6 using Node 24.22.1 and application React dependencies at 19.3.1. The shared workstation has a Ryzen 5 3600 and 32 GB of RAM, without CPU or memory isolation. Only one server runs at a time: one PRNext Node worker or one Next process. Six alternating repetitions use eight SSR connections, one second of preparation and five seconds of measurement, across a total of 60 HTTP windows. The application corpus also contains 200 unvisited routes.
For the verified 1000-row table, observed mean throughput moves from 46.4 to 349.8 requests per second, about 7.5 times, and p95 from 194 to 25 ms. The observed sum of process working sets moves from about 395 to 260 MiB. It is neither an exact memory peak nor a measurement of unique physical RAM. Next's effective renderer is a React canary version, while PRNext uses stable 19.3.1. These figures describe that candidate and workload, not the final 0.2 package bytes or every website.
Other results qualify that picture. Streaming is almost unchanged, and a cold navigation reaches DOMContentLoaded later with PRNext under this protocol. Query is properly integrated on both sides, with 32 hydrated values and no immediate refetch for either implementation. Optimizations should therefore be assessed by execution path, retaining latency results and unfavorable cases.
Animations keep their own limits
A separate campaign uses 24 distinct React Bits components, followed by 48 instances on one page. Sources and props are identical, both stacks load eagerly, and Chromium uses a GTX 1660 SUPER. Under normal conditions both sit around 55.2 FPS in a browser itself limited to about 55.4. The measured cadence is requestAnimationFrame, not a count of every physical frame displayed.
With Chromium CPU throttling at 4x, the 48-instance gallery reaches about 27 FPS with Next and 25.1 with PRNext. It becomes ready in about 444 versus 595 ms; PRNext transfers 7.8% fewer gzipped script bytes, with similar JavaScript heap usage. This result does not demonstrate a general FPS improvement. Animation, GPU and component costs still belong to the page, and browser CPU emulation does not represent a VPS.
Upgrade a coherent set and qualify the application
Moving to 0.2.0-alpha retains experimental status. A dependency range beginning with ^0.1 does not automatically select 0.2. Review that boundary, install matching framework and native packages, rebuild the application and restart its workers. Node 22.23.4+, 24.22.1+ or 26.12.1+ remains required. Check the terminal's Node version separately from the success of an npm install.
The presentation report supports comparison with presentationComponents: false. Useful checks also cover authentication, forms, Server Actions, images, styles, old browser tabs and rollback. Stop an existing persistent supervisor with its current CLI before replacing packages. Multiplatform tests and installed archives provide framework evidence; application qualification determines deployment readiness.
Qualification exposed intermittent failures in development navigation, deployment cutover and recovery after a worker crash. Some reruns pass without an established fix for the causes. On Windows, the test for recovering the build lock after its owner is forcibly terminated also fails in CI. These issues remain open in this alpha: verify these paths in your application before a production rollout.
npm install @thomas.f/prnext
npx --no-install prnext check
npx --no-install prnext typecheck
npx --no-install prnext buildDocumented code, protocols and boundaries
The upgrade guide explains the 0.2 scope, and implementation pull requests retain their changes and validation. The figures above come from earlier local campaigns on identified candidates. They are neither production certification nor a memory-consumption promise for every VPS. The public React, Query and Windows contracts provide references for the boundaries these optimizations preserve.
Client loading and Query integration
Next.js compatibility contracts
Windows CLI diagnosis and validation