Repository navigation
Conversation
Bump the package to 3.2.0 and modernize the full build stack. This is a minor release: React 19 support is additive and nothing in the published API, typings or runtime requirements becomes stricter. - Widen peerDependencies to React ^18.2.0 || ^19.0.0 so existing React 18 consumers keep working while React 19 is now supported; move devDependencies to current versions (react/react-dom ^19.3.1, @babel/* 8, jest 30, jest-environment-jsdom 30, prettier 3, TypeScript 7). - Replace the unmaintained babel-preset-airbnb with the maintained @babel/preset-env and @babel/preset-react on Babel 8. Helpers are now inlined, so lib/ no longer requires the undeclared @babel/runtime. - Force modules: "commonjs" in .babelrc: Babel 8's CLI self-reports ESM support, so the default 'auto' mode would leave ESM in lib/ and break CommonJS consumers of main: lib/index.js. - Add @types/react and jest-environment-jsdom devDependencies for the typecheck and client-hydration test suite. - Refresh transitive dev dependencies with npm audit fix. The remaining sprintf-js advisory has no patched release and is reachable only through jest's coverage tooling; the package itself has no runtime dependencies.
react-dom/client always has hydrateRoot in React 18+, so the old check for whether hydrateRoot exists always chose hydration, and its createRoot fallback never ran. Hydrate containers that hold server markup, and render empty containers with createRoot instead. Hypernova falls back to an empty container when the server render fails; hydrating it made React 18 and 19 throw "Hydration failed" before recovering, reported as uncaught errors on window, so every server-side failure also showed up as client errors in error monitoring. A component that renders nothing on the server also takes the createRoot path, which gives the same result.
Serialize a server-rendered Hypernova payload (via renderToString + serialize), render it into a jsdom document, then call renderReact's client branch inside act() and assert that hydration actually ran: the server DOM node is reused, a click handler attached during hydration updates state, and React logs no hydration errors. The assertions fail if hydrateRoot is not called, since the server HTML alone already contains the initial text. Uses jest-environment-jsdom since the hypernova() client path runs only when a DOM is present, plus a jest setup file that provides TextEncoder, which jsdom lacks and React 18's browser react-dom/server build needs on import. A second test serializes an empty container, as Hypernova does when the server render fails, and checks that it is client-rendered without hydration errors.
- Type renderReact for its server branch and export the ServerRenderedComponent (props -> HTML string) mapping. A second overload for the client branch would take the same parameters and so could never be selected; the client return value is not used in practice. - Import only the types needed from react with `import type`, so the declarations do not depend on consumers enabling esModuleInterop. - Add tsconfig.json (strict, NodeNext module resolution) and tests/types.ts, a set of compile-time assertions (including @ts-expect-error cases for bad props), plus typecheck and check scripts, so npm run typecheck fails if the public types regress.
- Bump checkout and setup-node to v7 in both CI and publish workflows. - Test on Node 22.x, 24.x and 26.x instead of the old 16.x-20.x matrix (Babel 8 requires Node ^22.18.0 || >=24.11.0), and publish on Node 24 LTS. - Run every Node version against both React 18 and React 19, since the peer range supports both but the devDependencies only install 19. - CI now runs an explicit build plus tsc typecheck before the jest suite so compile output, type checking, and tests are all verified.
Update the README tagline to reflect the widened peer dependency range.
Hypernova's createVM, which createGetComponent uses to evaluate server bundles, runs them in a sandbox that only exposes Buffer, console, process and the timer functions. React 19's server renderer calls queueMicrotask as soon as it loads, and performance.now() while rendering in development, so with React 19 every bundle evaluated that way failed to load with "queueMicrotask is not defined", even with plain renderToString. React 18 does not need either. Provide both, only where they are missing, from a module imported before react-dom/server. queueMicrotask rethrows errors from a timer, like the native one; performance.now() falls back to Date.now(), which React only uses for render timing. A test compiles src/ and runs it through Hypernova's real createVM.
samiashi
force-pushed
the
chore/upgrade-dependencies
branch
from
October 15, 2026 07:37
42f657d to
45547e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds React 19 support to
@lyst/hypernova-reactalongside React 18, brings the toolchain up to date, and fixes two bugs found while testing it end to end against a real Hypernova server and browser. Released as 3.2.0: nothing in the published API, typings or runtime requirements gets stricter, so existing React 18 consumers can upgrade without changes.What changed
peerDependencieswidened toreact/react-dom^18.2.0 || ^19.0.0.createVM, whichcreateGetComponentuses to evaluate server bundles, runs them in a sandbox withoutqueueMicrotaskorperformance. React 19's server renderer needs both, so every server render failed. The package now provides them where they're missing. React 18 is unaffected.Hydration failederrors, so each server failure also showed up as client errors in error monitoring. Empty containers are now client-rendered withcreateRoot.@babel/preset-envand@babel/preset-reactreplaces the unmaintainedbabel-preset-airbnb.lib/is still CommonJS, and no longer requires@babel/runtime, which was never declared as a dependency.Verification
createVM, and hydrated in the browser. Results:lazy, effects, transitions anduseSyncExternalStorework.</script>), and nothing gets injected.<title>hoisting,use(), form actions anduseOptimisticalso work.require, Node ESMimport(named and default) and esbuild bundling work. The typings check undernodenext,node16andbundlerresolution with TypeScript 5.9 and 7, withskipLibCheck: false.