perf: remove JS side config validation#11897
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this comment.
Pull Request Overview
This PR removes Zod validation from Rspack's JavaScript configuration validation layer, aiming to improve startup performance by 20-40ms. The validation logic has been completely stripped from plugins, configuration files, and the core Rspack module, with Zod dependencies removed from the package.
Key changes:
- Removed all Zod schema validation from the JavaScript layer
- Eliminated validation-related environment variables and test cases
- Moved ValidationError to RspackError module for backward compatibility
Reviewed Changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/rspack/src/schema/ | Complete removal of Zod validation schemas and utilities |
| packages/rspack/src/rspack.ts | Removed validation calls from main rspack function |
| packages/rspack/src/builtin-plugin/ | Stripped validation from all builtin plugins |
| packages/rspack/src/exports.ts | Moved ValidationError export location |
| packages/rspack/src/RspackError.ts | Added deprecated ValidationError class |
| tests/rspack-test/ | Removed validation tests and environment variable settings |
| website/docs/ | Updated documentation to remove validation mode references |
| packages/rspack/package.json | Removed zod and zod-validation-error dependencies |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Binary Size-limit
❌ Size increased by 256bytes from 47.67MB to 47.67MB (⬆️0.00%) |
CodSpeed Performance ReportMerging #11897 will not alter performanceComparing Summary
|
Summary
This PR removes Zod validation, the validation logic has been stripped from various plugins and configuration files, and the Zod-related dependencies has been removed.
Motivation
*-
// @ts-checkis now added by default increate-rspack: feat(create-rspack): add type annotations to JS configs #11896swc-loaderoption validations, which provides clearer and more direct diagnostics than Zod:Performance
@rspack/core/dist/index.jsis 210.2KB smaller (863.5KB -> 653.3KB)TODO
#getInstancecallsswc-loaderChecklist