Skip to content

#Enhancement: Opimizing response and the whole framework#85

Draft
arpan404 wants to merge 26 commits intosocioy:devfrom
arpan404:arpan404-optimizing-response
Draft

#Enhancement: Opimizing response and the whole framework#85
arpan404 wants to merge 26 commits intosocioy:devfrom
arpan404:arpan404-optimizing-response

Conversation

@arpan404
Copy link
Member

Experimenting

@arpan404 arpan404 changed the base branch from pro to dev February 12, 2025 16:33
@arpan404 arpan404 added experimental features or code that are still being tested and may change architecture discussions or changes related to the overall system design and structure labels Feb 12, 2025
@arpan404 arpan404 self-assigned this Feb 12, 2025
@arpan404 arpan404 marked this pull request as draft February 12, 2025 16:33
@arpan404 arpan404 linked an issue Feb 12, 2025 that may be closed by this pull request
@arpan404
Copy link
Member Author

arpan404 commented Apr 3, 2025

After a very long time, I got the time to work on this project. Will update the codebase as intended regularly.

@arpan404 arpan404 requested a review from Copilot April 3, 2025 03:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

const configData = (await import(configPath)).config as JOOR_CONFIG;
// Configuration.configData = validateConfig(configData);
Configuration.configData = validateConfig(configData);
Configuration.configData = configData;
Copy link

Copilot AI Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copilot uses AI. Check for mistakes.
@arpan404 arpan404 requested a review from Copilot April 3, 2025 23:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 39 out of 42 changed files in this pull request and generated no comments.

Files not reviewed (3)
  • .husky/pre-commit: Language not supported
  • .husky/pre-push: Language not supported
  • package.json: Language not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

architecture discussions or changes related to the overall system design and structure experimental features or code that are still being tested and may change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

#Enchancement: New way of sending Response

2 participants