Skip to content

1.4.8 patch#1440

Merged
SaltyAom merged 4 commits intomainfrom
next
Sep 27, 2025
Merged

1.4.8 patch#1440
SaltyAom merged 4 commits intomainfrom
next

Conversation

@SaltyAom
Copy link
Copy Markdown
Member

@SaltyAom SaltyAom commented Sep 27, 2025

Improvement:

  • automatically clear up sucrose cache when not used
  • remove Bun.hash from checksum calculation

Change:

  • make file-type optional to reduce bundle size
  • #1432 missing context (set) in mapResponse for ElysiaFile
  • #1435 missing cookies in SSE

Summary by CodeRabbit

  • New Version

    • Release 1.4.8
  • Bug Fixes

    • Fixed missing context in file responses, ensuring correct handling and headers.
    • Restored cookies support in Server-Sent Events (SSE).
  • Chores

    • Marked certain dependencies as optional to reduce bundle size and lighten installs (e.g., file-type, TypeScript).
    • Updated peer dependency metadata for clearer, more flexible setups.
  • Documentation

    • Updated changelog with details for version 1.4.8.

@SaltyAom SaltyAom merged commit 0288157 into main Sep 27, 2025
2 of 3 checks passed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 27, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Updates dependency metadata to make file-type and TypeScript optional, adjusts example routing, fixes handler file-response paths to pass set/context, updates compose to pass hooks into sucrose, and adds debug logs in sucrose. CHANGELOG reflects these updates.

Changes

Cohort / File(s) Summary
Release notes
CHANGELOG.md
Added entry for v1.4.8 noting optional file-type, ElysiaFile context fix, and SSE cookies fix.
Example app update
example/a.ts
Replaced root GET with /:id GET returning 'hello'; removed error wrapper, onError block, and manual handler usage; kept listener; added unused sucrose import.
Manifest and deps
package.json
Removed peerDeps for @sinclair/typebox, openapi-types; removed optionalDependencies; added peerDependenciesMeta marking file-type and typescript as optional.
Bun adapter: file handling
src/adapter/bun/handler.ts
Updated imports; now passes set to handleFile for ElysiaFile/File/Blob in mapResponse and early branches.
Web-standard adapter: file handling
src/adapter/web-standard/handler.ts
Replaced set as any with set when calling handleFile for File/Blob across response paths.
Inference and hooks
src/compose.ts, src/sucrose.ts
compose: passes { handler, ...hooks } to sucrose via Object.assign; sucrose: added debug logs for event functions and checksum key.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant A as Adapter (Bun/Web)
  participant H as Route Handler
  participant M as mapResponse
  participant F as handleFile

  C->>A: HTTP Request
  A->>H: invoke handler(context)
  H-->>A: Response (ElysiaFile/File/Blob)
  A->>M: mapResponse(response, set)
  M->>F: handleFile(response, set)  %% changed: pass set/context
  F-->>A: Response with headers
  A-->>C: HTTP Response
  %% Note: Passing set ensures headers/cookies are applied
Loading
sequenceDiagram
  autonumber
  participant B as Builder
  participant CP as compose
  participant S as sucrose

  B->>CP: initialize app ({handler}, hooks)
  CP->>S: sucrose(Object.assign({handler}, hooks))
  Note right of S: Logs event functions and checksum key
  S-->>CP: inference result
  CP-->>B: composed app
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

A hop, a skip—new routes in sight,
Files now set with headers right.
Hooks entwined with sugared art,
Sucrose logs its checksum heart.
Optional bits to trim the load—
I thump my paws and hit the road! 🐇✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch next

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a5d2069 and ab37c4d.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • CHANGELOG.md (1 hunks)
  • example/a.ts (1 hunks)
  • package.json (1 hunks)
  • src/adapter/bun/handler.ts (4 hunks)
  • src/adapter/web-standard/handler.ts (3 hunks)
  • src/compose.ts (1 hunks)
  • src/sucrose.ts (1 hunks)

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant