Playing around with native adapter
Summary of Changes
Hello @Yuangwang, I'm Gemini Code Assist[^1]! 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 refactors the Next.js adapter for the app hosting platform, moving towards a more 'native' integration with Next.js. The changes leverage Next.js's built-in standalone output and internal server capabilities, streamlining the deployment and serving of Next.js applications. The new architecture aims to improve compatibility and performance by relying more directly on Next.js's own mechanisms for building and serving.
Highlights
-
Native Next.js Adapter Implementation: A new
NextAdapterhas been introduced to integrate more deeply with Next.js's build process. This adapter forces standalone output and serializes the build configuration into afirebase-next-config.jsonfile, enabling a more direct use of Next.js's internal server. -
Simplified Build Process: The
build.tsscript has been refactored to delegate the primary Next.js build tonpx next build. It now focuses on organizing the output by copying the standalone build, public assets, and static files to a.apphostingdirectory, and bundling the newadapter-server.js. -
Dedicated Serve Script: A new
serve.tsscript has been added, which acts as the entry point for serving the Next.js application. This script directly boots and runs the Next.js standalone server using the serialized configuration, providing a more 'native' serving experience. -
Tooling and Dependency Updates: The project now uses
esbuildfor optimized bundling of adapter components. Thenextdev dependency has been updated to15.6.0-canary.54, andfastifyhas been added as a dependency, indicating a shift in the underlying server technology.
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 :thumbsup: and :thumbsdown: 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.
[^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.