Skip to content

Feat/google3 typings support #9085

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eranc-google
Copy link

This PR adds a new Rollup build configuration to the analytics and remote-config packages. This is required to generate self-contained TypeScript definition (.d.ts) files, which are necessary for consuming these modular SDKs within google3.

This change follows the process outlined in the internal guide for this migration: go/how-to-migrate-to-modular-firebase-js-sdk.

Discussion
There is no public GitHub issue for this change. This work is part of an internal migration effort for Google's Chronicle SOAR UI (internal design doc: go/soar-custom-signals).

This was discussed internally with members of the Firebase team (Christina Holland), who pointed us to the migration guide that necessitates this PR.

Testing
These changes are additive and only affect the build configuration; they do not modify any of the core library source code in /src. As such, they should not impact existing tests.

The project builds successfully (yarn build) with these changes included. The ultimate test for this change will be its consumption by the internal google3 build process after the generated artifacts are imported.

API Changes
This PR introduces no changes to the public API. All modifications are confined to devDependencies in package.json and the addition of a new, non-default build step in rollup.config.js.

@eranc-google eranc-google requested review from a team, erikeldridge and hsubox76 as code owners June 8, 2025 13:25
Copy link

changeset-bot bot commented Jun 8, 2025

🦋 Changeset detected

Latest commit: 83e72ac

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

This PR includes changesets to release 5 packages
Name Type
@firebase/remote-config Patch
@firebase/analytics Patch
firebase Patch
@firebase/remote-config-compat Patch
@firebase/analytics-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

Copy link
Contributor

@dlarocque dlarocque left a comment

Choose a reason for hiding this comment

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

Our CI workflows do not work on forks. Do you have permission to push a new branch to this repository?

const google3TypingsBuild = {
input: 'dist/src/index.d.ts',
output: {
file: 'dist/esm/src/global_index.d.ts',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the output file should be in the same directory as the typings entrypoint.

Suggested change
file: 'dist/esm/src/global_index.d.ts',
file: 'dist/src/global_index.d.ts',

Same thing for remote-config.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks! I applied the changes. However, I do not have direct push permissions to this repository.

@eranc-google eranc-google force-pushed the feat/google3-typings-support branch from 962e48e to 83e72ac Compare June 11, 2025 12:10
@@ -49,6 +49,7 @@
"devDependencies": {
"@firebase/app": "0.13.1",
"rollup": "2.79.2",
"rollup-plugin-dts": "6.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you downgrade to match the version the other packages use here and in remote config?
https://github.com/firebase/firebase-js-sdk/blob/main/packages/firestore/package.json#L131

Suggested change
"rollup-plugin-dts": "6.1.0",
"rollup-plugin-dts": "5.3.1",

Sorry didn't catch this the first time

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I think that adding this dependency should cause the root yarn.lock file to be updated if you install the dependencies locally. Can you include this file in the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants