feat: export compression constants and auto-wrap ModuleRef#55
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
uWestJS Benchmark Results
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/websocket/adapter/uws.adapter.ts`:
- Around line 172-179: The code should normalize explicit nulls from
options?.moduleRef to undefined before constructing HandlerExecutor so the "no
DI container" path is always represented consistently; update the flow around
the moduleRef variable (originating from options?.moduleRef) so that if
moduleRef === null it is set to undefined, then keep the existing check that
wraps NestJS ModuleRef via NestJsModuleRef.create(moduleRef as unknown as
NestModuleRef) when needed, and finally pass the normalized moduleRef (never
null) into new HandlerExecutor({ moduleRef }).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4d8e11d6-0061-403b-a0a8-8ca799f9b38c
📒 Files selected for processing (8)
README.mddocs/websocket/Adapter.mddocs/websocket/Middleware.mdsrc/websocket/adapter/uws.adapter.spec.tssrc/websocket/adapter/uws.adapter.tssrc/websocket/constants.tssrc/websocket/index.tssrc/websocket/interfaces/uws-options.interface.ts
- Export WebSocket compression constants (SHARED_COMPRESSOR, DISABLED, etc.) and App/SSLApp functions from uwestjs - Add auto-wrapping for NestJS ModuleRef to simplify DI setup - Update all documentation to use uwestjs imports instead of uWebSockets.js - Add comprehensive tests for ModuleRef auto-wrapping behavior
5ebfbfd to
dbd1091
Compare
Improves developer experience by exporting WebSocket compression constants and auto-wrapping NestJS
ModuleReffor dependency injection.Changes
Compression Constants Export: (Fixes #53)
constants.tsexporting all compression/decompression constants andApp/SSLAppfunctionsindex.tsto export constantsuwestjsinstead ofuWebSockets.jsModuleRefAuto-Wrapping: (Fixes #54)UwsAdapterconstructor to auto-detect and wrap NestJSModuleRefUwsAdapterOptionstype to accept bothModuleReftypesit.eachAll changes are backward compatible. Users can still manually wrap
ModuleRefif preferred.Summary by CodeRabbit
New Features
Documentation
Tests