#Enhancement: Opimizing response and the whole framework#85
Draft
arpan404 wants to merge 26 commits intosocioy:devfrom
Draft
#Enhancement: Opimizing response and the whole framework#85arpan404 wants to merge 26 commits intosocioy:devfrom
arpan404 wants to merge 26 commits intosocioy:devfrom
Conversation
Member
Author
|
After a very long time, I got the time to work on this project. Will update the codebase as intended regularly. |
There was a problem hiding this comment.
Pull Request Overview
This PR aims to enhance the framework by refactoring several core components, updating error handling and response mechanisms, and cleaning up or removing deprecated code. Key changes include:
- Consolidation of error module imports and refactoring of error classes.
- Updates to the router files (including request type refinements and revised handler logic) and removal/commenting out of static file serving code.
- Removal of the legacy response preparation file and server implementation along with adjustments to configuration validation and README documentation.
Reviewed Changes
Copilot reviewed 40 out of 43 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/core/router/router.ts | Consolidated error imports. |
| src/core/router/match.ts | Replaced JoorRequest with Request type. |
| src/core/router/handle.ts | Refactored handler logic, updated response processing, and commented out static file code. |
| src/core/router/addMiddlewares.ts | Consolidated error imports. |
| src/core/response/prepare.ts | Removed obsolete response preparation logic. |
| src/core/response/index.ts | Removed legacy response export. |
| src/core/response.ts | Introduced new response handling methods on ServerResponse. |
| src/core/joor/server.ts | Entire server file removed; import now taken from src/core/server. |
| src/core/joor.ts | Updated server import path. |
| src/core/error/* | Updated error handling modules and added helper functions. |
| src/core/config.ts | Updated configuration validation logic. |
| README.md | Updated framework description to include Bun and Deno compatibility. |
Files not reviewed (3)
- .husky/pre-commit: Language not supported
- .husky/pre-push: Language not supported
- package.json: Language not supported
src/core/config.ts
Outdated
| const configData = (await import(configPath)).config as JOOR_CONFIG; | ||
| // Configuration.configData = validateConfig(configData); | ||
| Configuration.configData = validateConfig(configData); | ||
| Configuration.configData = configData; |
There was a problem hiding this comment.
The validated configuration returned by validateConfig is immediately overwritten by the following assignment of configData. Consider removing the subsequent assignment to ensure the validated configuration is used.
Suggested change
| Configuration.configData = configData; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Experimenting