redirect to init apphosting for webframeworks on init hosting#9887
redirect to init apphosting for webframeworks on init hosting#9887leoortizz merged 11 commits intojh-remove-wffrom
Conversation
When running `firebase init hosting`, run framework detection. If a Node.js webframework is found, terminate the flow with an error directing users to run `firebase init apphosting` instead.
Summary of ChangesHello @leoortizz, 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 enhances the Highlights
🧠 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. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request correctly implements the logic to guide users with web frameworks towards App Hosting during firebase init hosting. The changes are well-contained and include tests for the new behavior. I have a couple of suggestions to improve the robustness of the implementation and enhance test coverage.
6a980df to
cc05c02
Compare
ef7a087 to
759334a
Compare
egilmorez
left a comment
There was a problem hiding this comment.
One suggestion on the prompt text, thanks!
| setup.features?.unshift("apphosting"); | ||
| return; | ||
| } | ||
| break; |
There was a problem hiding this comment.
If the user chooses "n" we should exit. We don't want more users using this experiment.
I believe this is currently just continuing with the firebase init hosting flow?
There was a problem hiding this comment.
We should keep in mind that this would also prevent users whose apps trip the detection criteria from initializing Hosting (classic) as described in our Hosting onboarding docs (internally staged version): https://firebase.devsite.corp.google.com/docs/hosting/quickstart?db=egilmore#initialize
Toward the end of that section we're saying "You can proceed with App Hosting setup or continue with Hosting (classic) for static-only deploys," so the behavior and docs are in line; but is this fully desired behavior, to stop this subset of Hosting (classic) adopters as well as the CLI experiment?
There was a problem hiding this comment.
You're right eric, thanks for catching. The goal is to block new Web Framework participants (which I believe the current code is doing and my comment was incorrect).
If we DID just exit here and block hosting onboarding ideally it would be NOOP because ideally, what is detected as a would-be web framework participant would also NOT be a plain (non-web framework) hosting user.
but that's not true if the detection is imperfect.
So, i see no harm in keeping this code as is. wrong detection or no wrong detection, we're already telling users that the app might not work with hosting. They can continue with plain hosting and see what happens.
So no change here....but then I think we WOULD need to to change the code below. For any other ssr apps (that don't work out of the box with app hosting), to be consistent we should let users proceed with hosting if they wish.
There was a problem hiding this comment.
@egilmorez @annajowang Thanks for the feedback. I believe I have implemented the changes mentioned, please let me know if I missed anything
egilmorez
left a comment
There was a problem hiding this comment.
Question about the "n" interactive behavior that I think is important. PTAL, thanks!
| setup.features?.unshift("apphosting"); | ||
| return; | ||
| } | ||
| break; |
There was a problem hiding this comment.
We should keep in mind that this would also prevent users whose apps trip the detection criteria from initializing Hosting (classic) as described in our Hosting onboarding docs (internally staged version): https://firebase.devsite.corp.google.com/docs/hosting/quickstart?db=egilmore#initialize
Toward the end of that section we're saying "You can proceed with App Hosting setup or continue with Hosting (classic) for static-only deploys," so the behavior and docs are in line; but is this fully desired behavior, to stop this subset of Hosting (classic) adopters as well as the CLI experiment?
|
I'm getting the following error: It's happening even with |
yes that's happening to me too, it seems like there's a fix in main but not in the base branch |
@annajowang I merged latest from main in the base branch/here. The error should be gone now |
* Removing webframeworks questions from init hosting * Pr fixes * redirect to init apphosting for webframeworks on init hosting (#9887) * recommend apphosting for webframeworks on init hosting When running `firebase init hosting`, run framework detection. If a Node.js webframework is found, terminate the flow with an error directing users to run `firebase init apphosting` instead. * simplify message, use mayWantBackend instead * update tests * nextjs in test * redirect to apphosting * remove redundant comments * keep imports order * pr comments * split framework detection into categories, per-framework tests * PR comments --------- Co-authored-by: Leonardo Ortiz <83593673+leoortizz@users.noreply.github.com>
When running
firebase init hosting, run framework detection. If a webframework with a backend is found, triggerfirebase init apphostinginstead.Based on the following comments from #9843:
Description
Scenarios Tested
firebase init hostingin a webframework projectSample Commands
firebase init hosting