Skip to content

Allow Firestore to auto-generate typings, separate internal vs external APIs #986

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

Merged
merged 5 commits into from
Aug 11, 2020

Conversation

MathBunny
Copy link
Contributor

Context

The goal is to bridge the gap between today's Admin SDK (manually curated d.ts files, nested namespaces) and a modularized SDK that has auto-generated typings.

This is the eighth milestone from: go/firebase-node-auto-typing.

Goals for this PR

  1. Allow to auto-generated typings for Firestore
  2. Split the internal and external APIs
  3. Still use the previous manually curated typings
  4. Be a non-breaking change

Prerequisites

None.

Test Plan

  1. Unit tests:

npm test

  1. Integration tests:

export TYPE_GENERATION_MODE=nonauto && npm run integration && export TYPE_GENERATION_MODE=auto && npm run integration

  1. Sanity tests:

export TYPE_GENERATION_MODE=nonauto && npm pack && ./.github/scripts/verify_package.sh firebase-* && export TYPE_GENERATION_MODE=auto && npm pack && ./.github/scripts/verify_package.sh firebase-*

@MathBunny MathBunny marked this pull request as ready for review August 10, 2020 22:13
@MathBunny MathBunny requested a review from hiranya911 August 10, 2020 22:13
Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

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

Looks good, but I don't see why the code changes in firestore-internal was needed. Can we revert them and just make it a simple file rename?


import * as validator from '../utils/validator';
import * as utils from '../utils/index';

export function getFirestoreOptions(app: FirebaseApp): Settings {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this file contain code changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, it shouldn't have any changes. I had originally put some code in firestore.ts, but after realizing it wasn't necessary and adding it back in a different order polluted the diff. Fixed.

@hiranya911 hiranya911 assigned MathBunny and unassigned hiranya911 Aug 11, 2020
@MathBunny
Copy link
Contributor Author

Thanks for the feedback. Also, for visibility, the Firestore service will require manual re-exporting in the barrel export even past this project because of the previous issue we ran into when prototyping this in #948 with the export = .

@MathBunny MathBunny assigned hiranya911 and unassigned MathBunny Aug 11, 2020
Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM 👍

@hiranya911 hiranya911 assigned MathBunny and unassigned hiranya911 Aug 11, 2020
@MathBunny MathBunny merged commit be4b539 into master Aug 11, 2020
@MathBunny MathBunny deleted the hlazu-modularizing-firestore branch August 12, 2020 18:28
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.

2 participants