Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying a site to Firebase Hosting using the IDE #2

Open
WillieCubed opened this issue Dec 15, 2018 · 1 comment
Open

Deploying a site to Firebase Hosting using the IDE #2

WillieCubed opened this issue Dec 15, 2018 · 1 comment

Comments

@WillieCubed
Copy link

I think this extension has great promise, so I propose an addition to the current Firebase Hosting functionality: a button that allows for easy deployment of an open folder to Firebase Hosting. The new functionality would:

  1. Check if the user is signed in and launch a sign-in flow if it isn't
  2. Check if the currently opened folder has been initialized with Firebase Hosting
  3. Use the Firebase Hosting REST API to upload the files
  4. Show the result with a link to the deployed site when finished (or error)

What do you think, @jsayol? Is this outside the scope of the project, or is it a worthwhile feature?

@jsayol
Copy link
Owner

jsayol commented Dec 15, 2018

Thanks @TheCraftKid, that's a great idea :)

This is something I've wanted to add to the extension and I thought about it a few days ago, but I couldn't come up with a good way to integrate it.

Options

There's several options when it comes to implementing this, and they all have some trade-offs.

As a global command

It would add a command named "Deploy current project to Firebase Hosting", which would be triggered from the command palette. Some issues:

  • The command is quite hidden. Users would either need to know it's there or would need to stumble upon it by chance. I don't think many people would end up using it this way.
  • What happens if there's more than one open workspace folders? Could probably show a quickpick to select which one to deploy.
  • What happens if the open/selected folder hasn't been initialized as a Firebase project? That is, if there's no .firebaserc and firebase.json files. The easiest option here is to simply show an error saying to initialize it using the CLI. Another option would be to replicate the whole firebase init functionality (the extension doesn't depend on firebase-tools), but I'd rather not.

As a right-click context menu on a folder

When right-clicking on a folder in the open workspace, it would show an entry saying "Deploy this folder to Firebase Hosting". Some issues:

  • Allowing to deploy any random folder is a bad idea. When creating a new release with the files int hat folder, all the files currently deployed would be removed from the Hosting site. (It is technically possible to maintain the currently-deployed files and just add new ones, but it would complicate things.)
  • To which project should this be deployed? Should we go up the path until we find an initialized Firebase project? should we ask the user to choose one of their projects?

As a right-click context menu anywhere on the list of files

Similar to the previous one, but it would only work if the root of the workspace folder is an initialized Firebase project (it has .firebaserc and firebase.json files). It would deploy the public folder specified in firebase.json to the default project specified in .firebaserc. It would basically do the same as running firebase deploy --only hosting from that folder.

Other considerations

  • If the project has more that one Hosting site (available to paying plans), should we deploy to the default one like the CLI does, or should we ask the user to choose one?

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

No branches or pull requests

2 participants