Skip to content

feat: upgrade scriptc to 0.4.8 and eliminate custom pino patches - #12

Open
sunjay-devbot wants to merge 3 commits into
mainfrom
feat/upgrade-scriptc-0.4.8
Open

sunjay-devbot wants to merge 3 commits into
mainfrom
feat/upgrade-scriptc-0.4.8

Conversation

@sunjay-devbot

Copy link
Copy Markdown
Collaborator

Summary

This PR upgrades scriptc from 0.1.7 to 0.4.8, eliminates custom JavaScript library patches, and enables pure native static binary compilation on FROM scratch without Node island dependencies.

Key Changes

  • Upgrade scriptc: Updated Dockerfile.scriptc to use scriptc@0.4.8 and removed the obsolete --dynamic compiler flag.
  • Eliminate Custom Pino Patches: Replaced pino with a zero-dependency structured JSON logger in src/utils/logging.ts, deleting scripts/patch_pino_events.mjs. This removes 5 Node island demotions (atomic-sleep, thread-stream, on-exit-leak-free, safe-stable-stringify, Error.prepareStackTrace), allowing pure static musl compilation.
  • Fix Headers Iteration: Replaced upstreamResponse.headers.entries() with upstreamResponse.headers.forEach() in src/proxy/handler.ts to resolve compiler issue SC2020.
  • Hono Compatibility: Added a build-time fix for Hono's escapeToBuffer to resolve SC9001.

Performance Comparison (scriptc Native vs Node.js 24 Alpine)

  • Image Size: 4.73 MB vs 190.27 MB (40.2x smaller)
  • Cold Start: 210 ms vs 355 ms (1.7x faster)
  • Idle Memory (RSS): 1.25 MiB vs 19.65 MiB (15.7x lower)
  • Memory Under Load: 1.90 MiB vs 36.34 MiB (19.1x lower)
  • /proxy Throughput: 4,953 req/s vs 2,321 req/s (+113% / 2.13x higher)
  • Tail Latency (P99): 7 ms vs 19 ms (2.7x lower)

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7493423a-0b97-4821-8ab8-bd04e91b3402
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

- remove pino and update pnpm-lock.yaml
- add scripts/patch_hono.mjs with strict pattern verification and idempotency
- enhance logger to serialize Error objects (type, message, stack) and filter by LOG_LEVEL
Comment thread src/utils/logging.ts Outdated
};

function shouldLog(level: string): boolean {
const envLevel = (process.env.LOG_LEVEL || "info").toLowerCase();

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think, we have a config/env.config.ts file

@sunjay-devbot sunjay-devbot Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in commit 0621496 — added LOG_LEVEL schema validation, allowed values, and parseLogLevel() to src/config/env.config.ts, and updated src/utils/logging.ts to source config.logLevel directly.

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