Skip to content

Conversation

@joehan
Copy link
Member

@joehan joehan commented Jan 29, 2026

Description

Removing the web frameworks set up flow from firebase init hosting, and adding a unit test while we are here.

@joehan joehan requested review from annajowang and falahat January 29, 2026 23:19
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @joehan, 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 significantly simplifies the firebase init hosting command by removing the experimental web frameworks setup flow. The change streamlines the initialization process, making it more straightforward for users setting up static hosting without the complexities of framework-specific configurations. Accompanying this removal, new unit tests have been introduced to validate the core hosting setup logic, ensuring stability and correctness of the simplified flow.

Highlights

  • Web Frameworks Removal: The experimental web frameworks setup flow has been completely removed from the firebase init hosting command.
  • Simplified Hosting Initialization: The askQuestions and actuate functions for hosting initialization have been streamlined to focus solely on traditional static site configurations, such as defining the public directory and configuring single-page application (SPA) rewrites.
  • New Unit Tests: A new unit test file (src/init/features/hosting/index.spec.ts) has been added to ensure the correct behavior of the simplified hosting initialization logic, covering scenarios like public directory prompts, SPA configuration, and new site creation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 successfully simplifies the hosting initialization flow by removing questions related to web frameworks, which aligns with the stated goal. The addition of unit tests for this streamlined process is a valuable improvement. My review includes a few suggestions to enhance the code's robustness and maintainability, both in the core logic and the new tests.

sandbox.restore();
});

describe("askQuestions", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The mock options object is created inline with as any in multiple tests. To improve readability, reduce repetition, and make it easier to manage, consider defining a constant for these mock options at the top of the describe block and reusing it in your tests.

});
});

describe("actuate", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The stub for Client.prototype.get is repeated across all tests within this describe block. To reduce code duplication and improve maintainability, consider moving this common setup into a beforeEach hook.

await config.askWriteProjectFile(
`${hostingInfo.public}/index.html`,
INDEX_TEMPLATE.replace(/{{VERSION}}/g, response.body.current.version),
`${hostingInfo.public}/404.html`,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using string interpolation to construct file paths can be brittle. For example, if hostingInfo.public is an empty string, the path becomes '/404.html', which might not be what you intend. Using path.join() is more robust for constructing paths as it correctly handles path segments.

You will need to add import { join } from 'path'; at the top of the file.

Suggested change
`${hostingInfo.public}/404.html`,
join(hostingInfo.public, "404.html"),

const c = new Client({ urlPrefix: "https://www.gstatic.com", auth: false });
const response = await c.get<{ current: { version: string } }>("/firebasejs/releases.json");
await config.askWriteProjectFile(
`${hostingInfo.public}/index.html`,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For robustness, use path.join to construct this file path instead of string interpolation.

Suggested change
`${hostingInfo.public}/index.html`,
join(hostingInfo.public, "index.html"),

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