-
-
Notifications
You must be signed in to change notification settings - Fork 158
feat: add @vitejs/plugin-rsc
#521
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
Conversation
package.json
Outdated
@@ -51,7 +51,7 @@ | |||
"tsx": "^4.20.3", | |||
"typescript": "^5.8.3", | |||
"typescript-eslint": "^8.35.1", | |||
"vite": "^6.3.3", | |||
"vite": "^7.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a PR for Vite 7 bump separately #522
if (pkgName === 'plugin-rsc') return | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change will be removed later on, right? (and the one below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure yet if I switch to ## Unreleased
convention. For now, I'll let this skip and use my convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with that. Instead, could we have a small comment in generateChangelog
method so that it's easier to find how the changelog is generated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment. Probably the release flow will be to create a PR to just update CHANGELOG.md
, then merge it and then run pnpm release
on main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe calling run('pnpm', ['changelog'])
here would make it a bit easier? (run
function: https://github.com/vitejs/vite/blob/4fc9b6424c27aca8004c368b69991a56264e4fdb/scripts/releaseUtils.ts#L8-L14)
Or the generateChangelog
function I added recently can be used if you are fine with a slightly different output.
https://github.com/vitejs/vite/blob/41e83f62b1adb65f5af4c1ec006de1c845437edc/scripts/release.ts#L16-L19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generateChangelog
probably works. Let's try that 👍
Co-authored-by: 翠 <[email protected]>
commit: |
Co-authored-by: 翠 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new @vitejs/plugin-rsc
package—a copy of @hiogawa/vite-rsc
renamed and integrated into this monorepo.
Key changes:
- Included
plugin-rsc
in workspace, release scripts, and CI workflow - Added build and test configs (
vitest.config.ts
,tsdown.config.ts
,tsconfig*.json
) forplugin-rsc
- Introduced all source files under
packages/plugin-rsc
, including utilities, transforms, core logic, examples, and E2E setup
Reviewed Changes
Copilot reviewed 192 out of 208 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
scripts/release.ts | Added plugin-rsc to release pipeline and changelog generation |
pnpm-workspace.yaml | Included packages/plugin-rsc/examples/* in workspace |
packages/plugin-rsc/vitest.config.ts | Vitest setup for plugin-rsc |
packages/plugin-rsc/tsdown.config.ts | Documentation generator config for plugin-rsc |
packages/plugin-rsc/tsconfig*.json | TypeScript configuration for plugin-rsc |
packages/plugin-rsc/src/** | All plugin runtime, transform, and core implementation |
packages/plugin-rsc/examples/** | Starter example and configuration files |
Comments suppressed due to low confidence (1)
packages/plugin-rsc/src/vite-utils.ts:3
- The
vite-utils.ts
file provides many path and URL helpers but has no accompanying unit tests; adding tests for edge cases (Windows paths, query injection, ID wrapping) will help ensure reliability.
import fs from 'node:fs'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove this line in the future. But that can be done in a separate PR.
https://github.com/hi-ogawa/vite-plugin-react/blob/35577644c85c606015d4c23b866b34386424fb9c/eslint.config.js#L16
Description
This PR adds
@vitejs/plugin-rsc
, which is an exact copy of@hiogawa/vite-rsc
but simply the package is renamed.From my own development perspective, having the code in this repo doesn't seem to have any downside at least. Though the code added here is substantially large, its scope is limited to do nothing but enabling "React feature" on Vite, so I think including it here isn't too stretch. Please let me know what you think.
todo
ubuntu-latest / chromium
CI is required for PR merge.@hiogawa/vite-rsc
to@vitejs/plugin-rsc
todo (follow up)
@vitejs/plugin-rsc
@hiogawa/vite-rsc
with@vitejs/plugin-rsc
remix-run/react-router#13933@hiogawa/vite-rsc
and redirect people to@vitejs/plugin-rsc
chore: deprecate@hiogawa/vite-rsc
in favor of@vitejs/plugin-rsc
hi-ogawa/vite-plugins#1130