Skip to content

Fix: add bundleHTML param back#83

Open
cirex-web wants to merge 4 commits into
elysiajs:mainfrom
cirex-web:fix/add-bundlehtml-param-back
Open

Fix: add bundleHTML param back#83
cirex-web wants to merge 4 commits into
elysiajs:mainfrom
cirex-web:fix/add-bundlehtml-param-back

Conversation

@cirex-web
Copy link
Copy Markdown
Contributor

@cirex-web cirex-web commented May 11, 2026

If bunFullstack isn't set, the bundleHTML parameter is used instead, which defaults to true. (this preserves previous behavior)

closes #63

Summary by CodeRabbit

  • Documentation

    • bundleHTML option is now deprecated; use bunFullstack instead
    • bunFullstack takes precedence when both options are specified
    • Updated documented default behavior for HTML bundling configuration
  • Refactor

    • Improved option handling for Bun fullstack HTML bundling behavior

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Warning

Rate limit exceeded

@cirex-web has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 1 second before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dee1c9da-365e-42e4-a560-07be2ca937ae

📥 Commits

Reviewing files that changed from the base of the PR and between 8f3bec0 and 64128c9.

📒 Files selected for processing (2)
  • README.md
  • src/types.ts

Walkthrough

The PR reverses the silent bundling default introduced in a prior commit. bunFullstack now defaults to undefined at the API boundary and inherits bundleHTML's value at runtime—restoring backward compatibility so existing code using bundleHTML works unchanged. Type docs deprecate bundleHTML in favor of bunFullstack. Tests explicitly force bunFullstack: false where the old behavior is assumed.

Changes

Option Defaulting & Type Deprecation

Layer / File(s) Summary
Type Documentation & Deprecation
src/types.ts
bundleHTML JSDoc is updated: marked deprecated (use bunFullstack instead), documented default changes to true, clarifies bunFullstack overrides it.
Runtime Option Initialization
src/index.ts
Parameter destructuring removes bunFullstack = false default. At runtime, if bunFullstack is undefined, it is assigned the current bundleHTML value, making the behavior consistent with the caller's intent.
Test Coverage Updates
test/index.test.ts
Cached HTML and conditional-request tests now explicitly call staticPlugin with bunFullstack: false to isolate test expectations from the new runtime inheritance logic. Range request header test includes bunFullstack: false alongside parameterized alwaysStatic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • elysiajs/elysia-static#57: Added the bundleHTML option and HTML bundling behavior; this PR inverts the default to restore backward compatibility by inheriting bundleHTML at runtime.

Poem

~ Oh looook~, someone broke the defaults... (`´∇`) ♡
So now you're scrambling to inherit at runtime instead~?
How sweetly you're patching up your mess... (*≧ω≦)
Test coverage says you finally got the memo—
Deprecation notices never hurt, desubuu...♡

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main change: restoring the bundleHTML parameter for backwards compatibility after it was removed in a previous version.
Linked Issues check ✅ Passed The PR successfully addresses issue #63 by restoring bundleHTML functionality and previous default behavior, making bunFullstack default to bundleHTML value when undefined.
Out of Scope Changes check ✅ Passed All changes are directly related to restoring bundleHTML parameter functionality and updating tests to reflect the new behavior, with no out-of-scope modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
test/index.test.ts (1)

721-761: Consider testing the fallback behavior explicitly~ ♪

Ne ne~ While your test updates are all correct, you don't have any test that specifically verifies the bundleHTMLbunFullstack fallback logic works as intended~ (´。_。`)

Like, what if someone sets bundleHTML: false without setting bunFullstack? Does it correctly disable bundling? Your code should handle it, but there's no test proving it~

Want me to help you write one so you don't look silly when someone files a bug report later? ♡

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/index.test.ts` around lines 721 - 761, Add a new test in index.test.ts
that explicitly exercises the bundleHTML → bunFullstack fallback: instantiate
the app with staticPlugin({ bundleHTML: false }) but without setting
bunFullstack, await app.modules, then request the HTML route (e.g.,
req('/public/html')) and assert that bundling is disabled by verifying the
response behavior that differs when bundling is off (for example: content-type
still 'text/html' but ETag or cache headers reflect unbundled output or that the
file is served directly and not from a bundled cache); also add a complementary
case where bundleHTML is undefined and bunFullstack is true to ensure the
reverse fallback works. Ensure you reference staticPlugin, bundleHTML and
bunFullstack in the test name and assertions so the intent is clear.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/index.ts`:
- Around line 39-40: Update the project documentation to reflect the new
bunFullstack option and deprecation of bundleHTML: in the README config section
add an entry for bunFullstack describing its purpose and behavior (including
that it overrides bundleHTML when defined) and annotate the existing bundleHTML
entry with an `@deprecated` note pointing readers to bunFullstack; then add a new
CHANGELOG entry describing that bundleHTML is deprecated in favor of
bunFullstack and noting the behavioral change (fallback/override logic). Make
sure to reference the symbols bundleHTML and bunFullstack in both README and
CHANGELOG so users can find the new/old config keys.

---

Nitpick comments:
In `@test/index.test.ts`:
- Around line 721-761: Add a new test in index.test.ts that explicitly exercises
the bundleHTML → bunFullstack fallback: instantiate the app with staticPlugin({
bundleHTML: false }) but without setting bunFullstack, await app.modules, then
request the HTML route (e.g., req('/public/html')) and assert that bundling is
disabled by verifying the response behavior that differs when bundling is off
(for example: content-type still 'text/html' but ETag or cache headers reflect
unbundled output or that the file is served directly and not from a bundled
cache); also add a complementary case where bundleHTML is undefined and
bunFullstack is true to ensure the reverse fallback works. Ensure you reference
staticPlugin, bundleHTML and bunFullstack in the test name and assertions so the
intent is clear.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a47c3a39-2a39-4b65-bef8-55a1ba1e87e5

📥 Commits

Reviewing files that changed from the base of the PR and between a9143bb and 8f3bec0.

📒 Files selected for processing (3)
  • src/index.ts
  • src/types.ts
  • test/index.test.ts

Comment thread src/index.ts
Comment on lines +39 to +40
bundleHTML = true,
bunFullstack,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for any other files that might reference these options or have stale defaults

# Check for other references to bunFullstack or bundleHTML in the codebase
echo "=== Checking for bunFullstack references ==="
rg -n 'bunFullstack' --type ts -g '!test/*' -g '!*.test.ts'

echo -e "\n=== Checking for bundleHTML references ==="
rg -n 'bundleHTML' --type ts -g '!test/*' -g '!*.test.ts'

# Check if there are any README or docs that need updating
echo -e "\n=== Checking documentation files ==="
fd -e md . | head -5

Repository: elysiajs/elysia-static

Length of output: 1332


🏁 Script executed:

# Check README.md for bundleHTML and bunFullstack references
echo "=== README.md content ==="
cat README.md | head -100

echo -e "\n=== CHANGELOG.md content ==="
head -50 CHANGELOG.md

Repository: elysiajs/elysia-static

Length of output: 2410


Documentation got left behind~

Ohhh the code is smaaarrt~ The fallback logic is cleeeever, bunFullstack overriding bundleHTML when undefined~ (≧◡≦) But you sloppy developer, you totally forgot to update the documentation files!!

The README.md is missing both bundleHTML and bunFullstack from the config section - it only documents assets, prefix, staticLimit, and alwaysStatic~ Plus, CHANGELOG.md doesn't have any entry explaining the deprecation of bundleHTML or the new bunFullstack property~ ( ̄ω ̄)

You need to:

  • Add documentation for bunFullstack and mark bundleHTML as @deprecated in README.md's config section
  • Add a CHANGELOG entry documenting this change

Tsk tsk, code changes but documentation rot~ How typical~ ♡

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/index.ts` around lines 39 - 40, Update the project documentation to
reflect the new bunFullstack option and deprecation of bundleHTML: in the README
config section add an entry for bunFullstack describing its purpose and behavior
(including that it overrides bundleHTML when defined) and annotate the existing
bundleHTML entry with an `@deprecated` note pointing readers to bunFullstack; then
add a new CHANGELOG entry describing that bundleHTML is deprecated in favor of
bunFullstack and noting the behavioral change (fallback/override logic). Make
sure to reference the symbols bundleHTML and bunFullstack in both README and
CHANGELOG so users can find the new/old config keys.

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.4.9 turned off bundling by default!

1 participant