Conversation
- Remove outdated CHANGELOG.md from types, user-agent, and vm packages - These files are no longer needed as changelog is managed elsewhere
- Migrate turbo.json from deprecated 'pipeline' to 'tasks' for v2.0+ compatibility - Simplify primitives build outputs configuration - Update pnpm lockfile with latest dependency versions
- Update types package: v2.2.9 → v4.0.0, update description and license - Update user-agent package: v1.4.1 → v4.0.0, update dependencies and license - Update vm package: v3.2.0 → v4.0.0, update dependencies and license - Standardize Node.js requirement to >=18 across all packages - Change license from MPL-2.0 to MIT across all packages
- Update types package README: 'Runtime Edge' → 'Edge Runtime' - Update user-agent package README: 'Runtime Edge' → 'Edge Runtime' - Add website reference links to both README files
- Update global type declaration: RuntimeEdge → EdgeRuntime - Consistent with package rebranding from 'Runtime Edge' to 'Edge Runtime'
- Add env.d.ts with multer module declarations and Edge Runtime polyfills - Add test-if.ts with conditional test execution guard and Edge Runtime detection - Support for testing in both Node.js and Edge Runtime environments
- Test error stack trace preservation in VM context - Test custom error classes with additional properties (digest, cause) - Verify proper error serialization and formatting in Edge Runtime VM
- Add stream.js to export Web Stream APIs from node:stream/web - Provides ReadableStream, WritableStream, TransformStream and related classes - Enables stream/web module compatibility for Edge Runtime primitives
- Add ESLint configuration with Next.js recommended rules - Add Nextra app component for documentation theme - Enable TypeScript linting for docs
- Update VM source files with improved event handling and error management - Update runtime CLI and server modules to use EdgeRuntime naming - Consistent API naming throughout the Edge Runtime implementation - Improve error handling and unhandled rejection management in VM context
- Update runtime test fixtures: RuntimeEdge → EdgeRuntime imports - Update VM test files with EdgeRuntime naming consistency - Maintain test coverage for API naming changes
- Update Twitter handle from @vercel to @khulnasoft in runtime and vm packages - Consistent social media branding across documentation
- Update format package: v2.2.1 → v4.0.0, standardize description and license - Update cookies package: v4.1.1 → v4.0.0, update description and license - Update runtime package: v2.5.9 → v4.0.0, update dependencies and remove dev deps - Standardize Node.js requirement to >=18 across all packages - Change license from MPL-2.0 to MIT across all packages
- Update fetch.js example: 'Runtime Edge' → 'Edge Runtime' in marquee text - Update html.js example: 'Runtime Edge' → 'Edge Runtime' in generated markup - Consistent branding in example code
- Update fetch.d.ts: remove deprecated getAll method, reorganize Headers export - Update structured-clone.d.ts: add constructor export pattern - Improve type definitions for better compatibility
- Update primitives package.json: standardize Node.js requirement to >=18 - Update dependencies: esbuild 0.24.0, undici 6.21.0 - Change license from MPL-2.0 to MIT - Simplify clean:build script
- Update undici-core-request.js patch to v6.21.0 compatibility - Remove unused util-types.js patch file - Update blob.js and fetch.js implementations - Remove unused load.js and structured-clone.js files - Clean up deprecated patches and implementations
- Remove outdated CHANGELOG.md from runtime package - Consistent with other package CHANGELOG removals
- Update fetch-event and request tests: RuntimeEdge → EdgeRuntime imports - Consistent API naming in node-utils test suite
- Update ponyfill package.json: standardize Node.js requirement to >=18 - Update dependencies: acorn 8.14.0, acorn-walk 8.3.4 - Update test environment variable: RUNTIME_EDGE_EXISTS → EDGE_RUNTIME_EXISTS - Change license from MPL-2.0 to MIT
- Remove outdated CHANGELOG.md from primitives package - Update primitives README with any necessary changes
- Update all remaining package configurations and dependencies - Standardize naming from RuntimeEdge to EdgeRuntime across all packages - Update Node.js requirements to >=18 across the entire monorepo - Change license from MPL-2.0 to MIT across all packages - Remove outdated CHANGELOG files and update documentation - Update test suites and examples with new naming conventions - Clean up deprecated code and patches - Prepare codebase for Edge Runtime v4.0.0 release
- Add polished README with Vercel/Supabase-style layout - Include project badges, architecture diagram, and feature highlights - Add quick start guide and usage examples - Document ecosystem packages and contributor information - Responsive design with dark/light theme support - Professional branding consistent with Edge Runtime v4.0.0
- Update branding from 'Runtime Edge' to 'Edge Runtime' throughout - Replace generic content with accurate package descriptions based on actual codebase - Add complete package ecosystem table with all 10 published packages - Update features table with real functionality (Web APIs, VM, testing tools) - Improve quick start with realistic CLI commands and usage examples - Add architecture section explaining monorepo structure and package relationships - Enhance testing and contributing sections with pnpm workflows - Update 'What's New in v4.0.0' section with specific improvements made - Remove placeholder content and replace with production-ready documentation
…cve-vu-98kr4r Fix React Server Components CVE vulnerabilities
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
|
@vercel[bot] is attempting to deploy a commit to the devsec Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Sorry @neopilotai, your pull request is larger than the review limit of 150000 diff characters
|
Caution Review failedThe pull request is closed. WalkthroughThis PR is a major v4.0.0 release that renames "Runtime Edge" to "Edge Runtime" across the codebase, upgrades Node.js minimum version from 16 to 18, changes license from MPL-2.0 to MIT, updates dependencies, refactors the primitives module, removes historical changelogs, and updates documentation and branding throughout. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
✨ 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 |
Review Summary by QodoMajor v4.0.0 release with RuntimeEdge→EdgeRuntime rename, MIT license adoption, and comprehensive test/documentation updates
WalkthroughsDescription• **Major version bump to v4.0.0** across all packages with standardized versioning • **Renamed RuntimeEdge class to EdgeRuntime** throughout the entire codebase for improved naming clarity • **License change from MPL-2.0 to MIT** across all packages and documentation • **Updated Node.js minimum requirement from >=16 to >=18** across all packages • **Comprehensive test reorganization** with describe blocks, guard utilities, and improved test structure • **Enhanced error formatting** to include full stack traces instead of simplified error strings • **Simplified stream conversion** by using native Node.js Readable.fromWeb API • **Refactored build configuration** with custom esbuild plugins replacing esbuild-plugin-alias • **Updated all documentation** to reflect new naming conventions and expanded README with badges and architecture details • **Dependencies updates** including esbuild 0.20.2→0.24.0, @types/node 16→18, Turborepo v1→v2 configuration format • **Removed deprecated code** including blob polyfills, CHANGELOG files, and unused dependencies like http-body and node-fetch • **Improved cookie handling** with simplified deletion logic and max-age parsing tests • **Added test utilities** including guard function and isEdgeRuntime checks for conditional test execution • **Enhanced type definitions** with explicit exports and removal of deprecated Headers methods Diagramflowchart LR
A["RuntimeEdge Class"] -- "Rename to" --> B["EdgeRuntime Class"]
C["MPL-2.0 License"] -- "Change to" --> D["MIT License"]
E["Node.js >=16"] -- "Bump to" --> F["Node.js >=18"]
G["Simplified Errors"] -- "Enhanced with" --> H["Stack Traces"]
I["Custom Stream Code"] -- "Simplified to" --> J["Native Node API"]
K["Test Organization"] -- "Improved with" --> L["Describe Blocks & Guards"]
M["Documentation"] -- "Expanded with" --> N["Badges & Architecture"]
O["Dependencies"] -- "Updated & Cleaned" --> P["v4.0.0 Packages"]
File Changes1. packages/integration-tests/test/body.test.ts
|
Code Review by Qodo
1. ESM build uses require
|
|
|
||
| return readable | ||
| } | ||
| export const toToReadable = require('stream').Readable.fromWeb |
There was a problem hiding this comment.
1. Esm build uses require 🐞 Bug ✓ Correctness
• @runtime-edge/node-utils is built/published with an ESM entry (dist/index.mjs), but stream.ts now uses CommonJS require() at module top-level. • In ESM execution, require is not defined, so importing the ESM bundle can crash immediately with ReferenceError: require is not defined. • This is a hard correctness/reliability break for ESM consumers (the package explicitly advertises ESM via the module field).
Agent Prompt
## Issue description
`@runtime-edge/node-utils` emits an ESM build (`dist/index.mjs`) but `packages/node-utils/src/edge-to-node/stream.ts` now references `require(...)` at top-level. In ESM, `require` is not defined and can cause an immediate runtime crash for ESM consumers.
## Issue Context
The package is configured to build both CJS and ESM via tsup and advertises an ESM entrypoint via the `module` field.
## Fix Focus Areas
- packages/node-utils/src/edge-to-node/stream.ts[1-1]
## Suggested change
Prefer an import that works in both outputs:
```ts
import { Readable } from 'node:stream'
export const toToReadable = Readable.fromWeb
```
If you want to preserve a fallback for older Nodes (even though engines are `>=18`), you can optionally add a guarded fallback implementation.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary by CodeRabbit
New Features
Bug Fixes
Breaking Changes
RuntimeEdgeclass nowEdgeRuntime.Chores