Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
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
Introduces the new
@lazarv/rscpackage — a bundler-agnostic React Server Components (RSC) serialization and deserialization library — and migrates all internal RSC Flight protocol usage in@lazarv/react-serverto use it.New:
@lazarv/rscpackage (packages/rsc/)A standalone package that wraps
react-server-dom-webpack's Flight protocol behind a clean, bundler-agnostic API:@lazarv/rsc/server—renderToReadableStream()andprerenderToReadableStream()for server-side RSC serialization@lazarv/rsc/client—createFromReadableStream()andcreateFromFetch()for client-side RSC deserializationmoduleResolveroption pattern instead of requiring webpack-specific manifest objectstypes.d.ts)Migration in
@lazarv/react-serverRSC serialization (
cache/rsc.mjs)react-server-dom-webpack/server.edgeandclient.edgeimports with@lazarv/rsc/serverand@lazarv/rsc/clientmoduleResolveroptioncreateManifest()helper and its Proxy-based module map — no longer needed with the new APIfromBuffer()andfromStream()to pass options directlyrsc.mjsnow works in both server and browser environments by gracefully handling absentclientReferenceMapConsole logger (
client/error-overlay.mjs,lib/dev/logger-proxy.mjs)React.__SERVER_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADEand dynamically importingreact-server-dom-webpack/server.browserwith a direct import from@lazarv/rsc/serverDev server (
lib/dev/create-server.mjs)react-server-dom-webpack/client.edgeimport inhandleClientConsolewith@lazarv/rsc/clientserverConsumerManifestoption — no longer requiredStorage cache (
cache/storage-cache.mjs)Buffer.from().toString()calls with portableencodeBytes()/decodeBytes()helper functions usingUint8Arrayandbtoa/atobfor environments without Node.jsBufferLogger improvements (
lib/dev/create-logger.mjs)format()usage to handle format-string patterns even without an Error argumentlogger.error()call instead of one per lineuse-cacheplugin (lib/plugins/use-cache-inline.mjs)localandsessioncache providers now declaretype: "rsc"in their options, enabling proper RSC serialization for browser-side cacheshasRscProvider)CI & Release
packages/rscchangestest-rscCI job runspnpm test:coveragefor the@lazarv/rscpackage across Node 20/22/24 and multiple OSpublish-commit.ymlincludes@lazarv/rscinpkg-pr-newpublishrelease-experimental.ymladds steps to publish@lazarv/rscindependently and update@lazarv/react-server's dependency on itTests
use cache browser component— validates RSC-serialized component caching in localStorage/sessionStorage with TTL expiration