Skip to content

Conversation

@vorburger
Copy link
Member

Fixes #1895.

dependabot bot and others added 2 commits November 8, 2025 19:13
Bumps [@types/bun](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/bun) from 1.2.23 to 1.3.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/bun)

---
updated-dependencies:
- dependency-name: "@types/bun"
  dependency-version: 1.3.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @vorburger, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on maintaining the project's dependencies by upgrading the @types/bun package to its latest version. This update necessitated a minor adjustment to the Bun server configuration, specifically renaming the static property to routes for defining URL handlers, ensuring the application remains compatible with the updated type definitions and potentially benefiting from new features or fixes in the Bun ecosystem.

Highlights

  • Dependency Update: The @types/bun dependency has been updated from version 1.2.23 to 1.3.1, along with its corresponding bun-types package, ensuring the project uses the latest type definitions for Bun.
  • Bun Server Configuration Adjustment: The serve configuration in web/src/bun/develop.ts was modified to replace the static property with routes for defining path handlers, aligning with changes introduced in the updated @types/bun package.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the @types/bun dependency and correctly adapts the code to a breaking change in the Bun.serve API by renaming the static property to routes in web/src/bun/develop.ts. While this change is correct, I've identified a pre-existing bug in the server's routing logic that prevents static assets like CSS from being served, which will likely cause rendering issues. I've provided a detailed comment with a suggested refactoring to centralize the routing logic and fix this bug.

Comment on lines +34 to 37
routes: {
"/": index,
"/chat": chat,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

high

While renaming static to routes is correct for the updated @types/bun dependency, the overall routing logic is split between this routes object and the fetch handler that follows. This can be confusing to maintain.

Furthermore, the current fetch handler appears to have a bug where it doesn't serve static assets like enola.css (referenced in index.html), which will result in a 404 error and cause pages to render incorrectly.

To improve clarity and fix this bug, I recommend consolidating all routing logic within an async fetch handler. This centralizes routing and makes it easier to manage static assets.

Here's an example of how you could refactor the serve call:

serve({
  port: PORT,
  development: { hmr: false },

  async fetch(req) {
    const path = new URL(req.url).pathname;

    if (IGNORE.includes(path)) {
      return new Response("🪹 No Content ", { status: 204 });
    }

    switch (path) {
      case "/":
        return new Response(index);
      case "/chat":
        return new Response(chat);
    }

    // Serve other static files from the public directory
    const publicPath = `./public${path}`;
    const publicFile = file(publicPath);
    if (await publicFile.exists()) {
      return new Response(publicFile);
    }

    return new Response("🙅🏽‍♀️ Not Found", { status: 404 });
  },
});

This approach removes the routes object and handles all paths within fetch, including serving any existing file from the ./public directory, which would fix the issue with missing static assets.

Copy link
Member Author

Choose a reason for hiding this comment

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

The CSS actually works just fine (I've tested it).

@vorburger vorburger enabled auto-merge (rebase) November 8, 2025 18:22
@vorburger vorburger merged commit 3903192 into enola-dev:main Nov 8, 2025
14 checks passed
@vorburger vorburger deleted the dependabot/bun/web/types/bun-1.3.1 branch November 8, 2025 18:27
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