Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support rsc #6700

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

yimingjfe
Copy link
Member

@yimingjfe yimingjfe commented Jan 6, 2025

Summary

This PR is for supporting RSC in Modern.js, and currently supports SSR + RSC, CSR + RSC, and server action, and a new configuration server.rsc has been added for the project to enable RSC capability.

It includes three parts of changes:

  1. Compilation
  • the bundler plugin and loader, the rsbuild plugin and the swc plugin needed to build the RSC, which are located in @modern-js/uni-builder.
  • Modifications to Entry, the entry of the RSC project is slightly different from the previous project, and this part of the code is mainly in @modern-js/runtime.
  1. Runtime, mainly for the SDK required for RSC rendering, which is mainly in @modern-js/render and it only supports React19 now.

  2. Server, mainly for injecting the RSC manifests into the runtime and handle the req of RSC, which is in @modenr-js/server-core.

The current implementation of the compilation section only supports webpack and will support rspack in the next release.

Related Links

Checklist

  • I have added changeset via pnpm run change.
  • I have updated the documentation.
  • I have added tests to cover my changes.

Copy link

changeset-bot bot commented Jan 6, 2025

⚠️ No Changeset found

Latest commit: af0f431

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Jan 6, 2025

Deploy Preview for modernjs-byted ready!

Name Link
🔨 Latest commit af0f431
🔍 Latest deploy log https://app.netlify.com/sites/modernjs-byted/deploys/6790a6fa991c1f0008d0e665
😎 Deploy Preview https://deploy-preview-6700--modernjs-byted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 83 (🟢 up 4 from production)
Accessibility: 90 (no change from production)
Best Practices: 100 (no change from production)
SEO: 91 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@yimingjfe yimingjfe changed the title feat: support rsc WIP: feat: support rsc Jan 6, 2025
@yimingjfe yimingjfe force-pushed the feat-next-rsc branch 2 times, most recently from 8f3659c to dc93c13 Compare January 10, 2025 06:13
@yimingjfe yimingjfe changed the title WIP: feat: support rsc feat: support rsc Jan 10, 2025
.gitignore Show resolved Hide resolved
packages/cli/uni-builder/src/shared/rsc/common.ts Outdated Show resolved Hide resolved
packages/toolkit/utils/src/cli/is/project.ts Show resolved Hide resolved
packages/runtime/render/src/server/ssr/ssr.tsx Outdated Show resolved Hide resolved
packages/runtime/render/src/server/rsc/rsc.tsx Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants