Skip to content

feat(firestore): replace Type enum with raw string.#9725

Merged
dlarocque merged 3 commits intomainfrom
dl/type-string
Apr 7, 2026
Merged

feat(firestore): replace Type enum with raw string.#9725
dlarocque merged 3 commits intomainfrom
dl/type-string

Conversation

@dlarocque
Copy link
Copy Markdown
Contributor

Breaking Change

The Type string union was an enumeration of all the types that can be generated in the backend.
The string union did offer better DX, but we are choosing to change this to a raw string because we are prioritizing forward-compatibility in case more types are added in the future.

This breaking change is allowed because Firestore Pipelines is a feature in Public Preview

**Breaking Change**

The `Type` string union was an enumeration of all the types that can be
generated in the backend.
The string union did offer better DX, but we are choosing to change this
to a raw string because we are prioritizing forward-compatibility in
case more types are added in the future.

This breaking change is allowed because Firestore Pipelines is a feature
in Public Preview
@dlarocque dlarocque requested review from milaGGL and yvonnep165 March 16, 2026 19:18
@dlarocque dlarocque requested review from a team as code owners March 16, 2026 19:18
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 16, 2026

🦋 Changeset detected

Latest commit: 4f42988

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
firebase Minor
@firebase/firestore Minor
@firebase/firestore-compat Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dlarocque dlarocque changed the title feat: replace Type enum with raw string. feat(firestore): replace Type enum with raw string. Mar 16, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 refactors the type checking mechanism within the Firestore Pipelines API by transitioning from a predefined Type string union to a more flexible raw string for type parameters. This change enhances the API's ability to adapt to future backend type additions without necessitating client-side updates, ensuring greater long-term stability and extensibility for developers utilizing this Public Preview feature.

Highlights

  • API Breaking Change: The Type string union, previously used for type checking in Firestore Pipelines, has been replaced with a raw string type. This is considered a breaking change, but is permissible as Firestore Pipelines is currently in Public Preview.
  • Forward Compatibility: This modification prioritizes forward-compatibility, allowing for the introduction of new backend types in the future without requiring further API changes to the isType function.
  • Documentation Updates: All relevant API review and developer documentation files have been updated to reflect the change from Type to string for the isType function parameter, and the Type definition has been removed.

🧠 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
  • .changeset/thin-seas-accept.md
    • Added a new changeset file to document the minor breaking change for @firebase/firestore.
  • common/api-review/firestore-lite-pipelines.api.md
    • Updated the isType method signature in Expression to accept string instead of Type.
    • Modified the isType function overloads to use string for the type parameter.
    • Removed the Type type definition.
  • common/api-review/firestore-pipelines.api.md
    • Updated the isType method signature in Expression to accept string instead of Type.
    • Modified the isType function overloads to use string for the type parameter.
    • Removed the Type type definition.
  • docs-devsite/firestore_lite_pipelines.expression.md
    • Updated the isType function signature to reflect the change from Type to string.
    • Added a list of supported type values to the remarks section for the isType function.
  • docs-devsite/firestore_lite_pipelines.md
    • Updated internal links for the isType function to reflect new hash IDs.
    • Removed the Type definition from the API table.
  • docs-devsite/firestore_pipelines.expression.md
    • Updated the isType function signature to reflect the change from Type to string.
    • Added a list of supported type values to the remarks section for the isType function.
  • docs-devsite/firestore_pipelines.md
    • Updated internal links for the isType function to reflect new hash IDs.
    • Removed the Type definition from the API table.
  • packages/firestore/lite/pipelines/pipelines.ts
    • Removed the export of Type from the module.
  • packages/firestore/src/api_pipelines.ts
    • Removed the export of Type from the module.
  • packages/firestore/src/lite-api/expressions.ts
    • Removed the Type type definition.
    • Updated the isType method in Expression to accept a string parameter.
    • Added a detailed list of supported type values to the JSDoc for the isType method.
    • Updated the isType function overloads to accept string instead of Type.
    • Added a detailed list of supported type values to the JSDoc for the isType function overloads.
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 👍 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

  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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 16, 2026

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the Type enum with a raw string for forward compatibility. The changes are applied consistently across the codebase, including API definitions, source code, and documentation. I've found a minor maintainability issue related to duplicated documentation for the supported types, which I've commented on.

Comment thread packages/firestore/src/lite-api/expressions.ts
Comment thread packages/firestore/src/lite-api/expressions.ts
Copy link
Copy Markdown
Contributor

@yvonnep165 yvonnep165 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dlarocque dlarocque merged commit 0e343c8 into main Apr 7, 2026
42 of 45 checks passed
@dlarocque dlarocque deleted the dl/type-string branch April 7, 2026 15:34
@google-oss-bot google-oss-bot mentioned this pull request Apr 8, 2026
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

Successfully merging this pull request may close these issues.

5 participants