feat: support web preview in rspeedy dev#1893
Conversation
🦋 Changeset detectedLatest commit: 61aa18d The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughThis pull request adds web preview support to rspeedy dev by introducing a new middleware dependency, registering a web preview middleware during dev server initialization, and adding corresponding test coverage. The changes include a changeset entry, dependency configuration, conditional middleware registration, and test validation. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes The changes span multiple file types (changeset, config, implementation, test) with straightforward conditional middleware registration logic. Review requires verifying dependency integration, middleware correctness, and test adequacy across the cohesive feature addition. Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/rspeedy/core/test/plugins/dev.plugin.test.ts (1)
654-670: Consider verifying the middleware path parameter.The test successfully verifies that the middleware is installed, but doesn't check that it was called with the correct path
'/__web_preview'.Optionally strengthen the assertion:
await using server = await rsbuild.usingDevServer() await server.waitDevCompileDone() -expect(vi.mocked(middleware.createWebVirtualFilesMiddleware)).toBeCalled() +expect(vi.mocked(middleware.createWebVirtualFilesMiddleware)) + .toHaveBeenCalledWith('/__web_preview')
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
.changeset/twenty-places-pump.md(1 hunks)packages/rspeedy/core/package.json(1 hunks)packages/rspeedy/core/src/plugins/dev.plugin.ts(1 hunks)packages/rspeedy/core/test/plugins/dev.plugin.test.ts(1 hunks)packages/rspeedy/core/tsconfig.json(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md
📄 CodeRabbit inference engine (AGENTS.md)
For contributions, generate and commit a Changeset describing your changes
Files:
.changeset/twenty-places-pump.md
🧬 Code graph analysis (2)
packages/rspeedy/core/test/plugins/dev.plugin.test.ts (1)
packages/rspeedy/core/test/createStubRspeedy.ts (1)
createStubRspeedy(20-64)
packages/rspeedy/core/src/plugins/dev.plugin.ts (1)
packages/web-platform/web-rsbuild-server-middleware/src/node/index.ts (1)
createWebVirtualFilesMiddleware(22-89)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: build / Build (Ubuntu)
- GitHub Check: build / Build (Windows)
- GitHub Check: test-rust / Test (Ubuntu)
🔇 Additional comments (3)
packages/rspeedy/core/package.json (1)
59-59: LGTM! Dependency addition aligns with the new web preview feature.The workspace protocol is appropriate for internal monorepo dependencies.
packages/rspeedy/core/tsconfig.json (1)
24-24: LGTM! TypeScript project reference correctly configured.This reference aligns with the newly added dependency.
.changeset/twenty-places-pump.md (1)
1-7: LGTM! Changeset correctly documents the new feature.The patch-level bump is appropriate, and marking the feature as experimental sets clear expectations.
React Example#5936 Bundle Size — 237.5KiB (0%).61aa18d(current) vs 7570a5e main#5928(baseline) Bundle metrics
|
| Current #5936 |
Baseline #5928 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
165 |
165 |
|
67 |
67 |
|
46.77% |
46.77% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #5936 |
Baseline #5928 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
91.74KiB |
91.74KiB |
Bundle analysis report Branch PupilTong:p/hw/rspeedy-use-middl... Project dashboard
Generated by RelativeCI Documentation Report issue
Web Explorer#5932 Bundle Size — 364.68KiB (0%).61aa18d(current) vs 7570a5e main#5924(baseline) Bundle metrics
Bundle size by type
|
| Current #5932 |
Baseline #5924 |
|
|---|---|---|
238.77KiB |
238.77KiB |
|
93.8KiB |
93.8KiB |
|
32.11KiB |
32.11KiB |
Bundle analysis report Branch PupilTong:p/hw/rspeedy-use-middl... Project dashboard
Generated by RelativeCI Documentation Report issue
CodSpeed Performance ReportMerging #1893 will degrade performances by 9.68%Comparing Summary
Benchmarks breakdown
Footnotes
|
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @lynx-js/react@0.114.3 ### Patch Changes - Initialize `ctxNotFoundEventListener` before each test in testing library ([#1888](#1888)) - fix: main thread functions created during the initial render cannot correctly modify `MainThreadRef`s after hydration ([#1884](#1884)) ## @lynx-js/rspeedy@0.11.7 ### Patch Changes - Bump Rsbuild v1.5.17. ([#1889](#1889)) - feat: support web preview in rspeedy dev ([#1893](#1893)) - support web preview in rspeedy dev (experimental) - Updated dependencies \[]: - @lynx-js/web-rsbuild-server-middleware@0.18.1 ## @lynx-js/web-constants@0.18.1 ### Patch Changes - Updated dependencies \[]: - @lynx-js/web-worker-rpc@0.18.1 ## @lynx-js/web-core@0.18.1 ### Patch Changes - fix: mts freeze after reload() ([#1892](#1892)) The mts may be freezed after reload() called. We fixed it by waiting until the all-on-ui Javascript realm implementation, an iframe, to be fully loaded. - Updated dependencies \[[`70a18fc`](70a18fc)]: - @lynx-js/web-mainthread-apis@0.18.1 - @lynx-js/web-worker-runtime@0.18.1 - @lynx-js/web-constants@0.18.1 - @lynx-js/web-worker-rpc@0.18.1 ## @lynx-js/web-elements@0.8.9 ### Patch Changes - fix: layoutchange event result `detail.top` and `detail.left` was `0` incorrectly ([#1887](#1887)) - textarea placeholder inherits font-size by default ([#1874](#1874)) - feat: support <x-text text="content"></x-text> ([#1881](#1881)) - Updated dependencies \[]: - @lynx-js/web-elements-template@0.8.9 ## @lynx-js/web-mainthread-apis@0.18.1 ### Patch Changes - fix: mts freeze after reload() ([#1892](#1892)) The mts may be freezed after reload() called. We fixed it by waiting until the all-on-ui Javascript realm implementation, an iframe, to be fully loaded. - Updated dependencies \[]: - @lynx-js/web-constants@0.18.1 - @lynx-js/web-style-transformer@0.18.1 ## @lynx-js/web-worker-runtime@0.18.1 ### Patch Changes - Updated dependencies \[[`70a18fc`](70a18fc)]: - @lynx-js/web-mainthread-apis@0.18.1 - @lynx-js/web-constants@0.18.1 - @lynx-js/web-worker-rpc@0.18.1 ## create-rspeedy@0.11.7 ## upgrade-rspeedy@0.11.7 ## @lynx-js/web-core-server@0.18.1 ## @lynx-js/web-elements-template@0.8.9 ## @lynx-js/web-rsbuild-server-middleware@0.18.1 ## @lynx-js/web-style-transformer@0.18.1 ## @lynx-js/web-worker-rpc@0.18.1 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
#1806
Summary by CodeRabbit
New Features
Tests
Checklist