Skip to content

Fr: Update externs for Closure users #4592

Open
@GlennKnight

Description

@GlennKnight

[REQUIRED] Describe your environment

  • Operating System version: N/A
  • Browser version: N/A
  • Firebase SDK version: 8.2.8
  • Firebase Product: firebase-js-sdk

[REQUIRED] Describe the problem

The externs available at firebase-js-sdk/packages/firebase/externs/ are currently incomplete and incorrect which causes issues when using the Closure Compiler.

Products that are missing externs:

  • Analytics
  • Performance
  • RemoteConfig

The externs for Firestore are missing definitions for the withConverter() method.

I think the get() method for firebase.firestore.Query should return a Promise to reflect the extern's comments and the documentation for this method:

/**
 * Executes the query and returns the results as a `QuerySnapshot`.
 *
 * @param {!firebase.firestore.GetOptions=} options An options object to
 *   configure how the data is retrieved.
 *
 * @return {!firebase.firestore.QuerySnapshot}
 *   A promise that will be resolved with the results of the query.
 */
firebase.firestore.Query.prototype.get = function (options) {};

would become:

/**
 * Executes the query and returns the results as a `QuerySnapshot`.
 *
 * @param {!firebase.firestore.GetOptions=} options An options object to
 *   configure how the data is retrieved.
 *
 * @return {!Promise<!firebase.firestore.QuerySnapshot>}
 *   A promise that will be resolved with the results of the query.
 */
firebase.firestore.Query.prototype.get = function (options) {};

The externs also produce several warnings when using --jscomp_warning=lintChecks due to use of var over let or const.

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