Skip to content

[FR]: Ability to remove emulator from a functions instance #15925

@SoylentGraham

Description

@SoylentGraham

Description

  1. During development of firebase functions, I want to use the emulator if I've spun it up locally, and I want to use the deployed version if it's not running. I create the Functions and associate with an emulator first and check a basic function call succeeds. If not, I make a new one, "without" an emulator.

  2. The SDK currently can't tell the difference between an instance with an emulator and without, and when "allocating" a new Functions it just does an app/region match, so returns the previous Functions with the emulator still associated.
    I cannot remove the old emulator association (to reverse useEmulator())
    I cannot remove the old instance to create a clean one.

  3. a) Provide emulator params when construction functions, and make this a core part of distinguishing between different Functions instances.
    b) Allow me to destroy my Functions instance once I'm done with it (seems like a sensible thing to add anyway :)
    c) Allow me to remove the emulator association on an existing instance (hacky!)

API Proposal

class Functions ....
{
@objc open func removeEmulator() {
    emulatorOrigin = nil
  }
}

Firebase Product(s)

Functions

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions