Skip to content

fix: Support json format in Firebase options for web for firebase CLI >=13.31.0 - #373

Merged
russellwheatley merged 1 commit into
invertase:mainfrom
yorifuji:fix/372
Feb 18, 2025
Merged

fix: Support json format in Firebase options for web for firebase CLI >=13.31.0#373
russellwheatley merged 1 commit into
invertase:mainfrom
yorifuji:fix/372

Conversation

@yorifuji

@yorifuji yorifuji commented Feb 14, 2025

Copy link
Copy Markdown
Contributor

Description

Updated to support the new output format of apps:sdkconfig command introduced in Firebase CLI v13.31.0, which changed from JavaScript to JSON format for web apps.

Old format (before Firebase CLI v13.31.0):

firebase.initializeApp({
  "projectId": "my-project",
  "appId": "1:1234567890:web:abcdef1234567890",
  "apiKey": "api-key",
  "authDomain": "my-project.firebaseapp.com",
  "messagingSenderId": "1234567890",
  "measurementId": "G-ABCDEF1234"
});

New format (Firebase CLI v13.31.0 and later):

{
  "projectId": "my-project",
  "appId": "1:1234567890:web:abcdef1234567890",
  "apiKey": "api-key",
  "authDomain": "my-project.firebaseapp.com",
  "messagingSenderId": "1234567890",
  "measurementId": "G-ABCDEF1234"
}

Updated convertConfigToOptions to handle both formats and added unit tests.

Related issue

fixes #372

Type of Change

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

@CLAassistant

CLAassistant commented Feb 14, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added the Needs Attention OP created or responded to issue and it needs attention. label Feb 14, 2025
@yorifuji
yorifuji marked this pull request as ready for review February 14, 2025 09:25
@russellwheatley russellwheatley changed the title fix: Support json format in Firebase options for web fix: Support json format in Firebase options for web for firebase CLI >13.3.0 Feb 18, 2025
@russellwheatley russellwheatley changed the title fix: Support json format in Firebase options for web for firebase CLI >13.3.0 fix: Support json format in Firebase options for web for firebase CLI >=13.31.0 Feb 18, 2025
@russellwheatley

Copy link
Copy Markdown
Member

@yorifuji - thank you for the effort. LGTM 🚀

@russellwheatley
russellwheatley merged commit 581e7c4 into invertase:main Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Attention OP created or responded to issue and it needs attention.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: type 'Null' is not a subtype of type 'String' in type cast

3 participants