Skip to content

change: Remove Deprecated Legacy Namespace Support#3164

Open
lahirumaramba wants to merge 3 commits into
v14from
lm-drop-ns
Open

change: Remove Deprecated Legacy Namespace Support#3164
lahirumaramba wants to merge 3 commits into
v14from
lm-drop-ns

Conversation

@lahirumaramba
Copy link
Copy Markdown
Member

@lahirumaramba lahirumaramba commented May 27, 2026

This PR removes the legacy, deprecated namespaces support from the SDK. Namespaces have been replaced by modular imports (since v10), and this completes the transition of the Firebase Admin Node.js SDK into a purely modular SDK for v14.

All legacy files have been deleted, the main entry points and build systems have been modernized, and the test suites have been fully cleaned up and verified.

This is a breaking change

Key Changes

1. Deleted Legacy Namespace Implementation & Test Files

Removed all *namespace.ts, *namespace.d.ts, and obsolete test files:

  • Legacy Namespace Components (src/):
    • src/default-namespace.ts / src/default-namespace.d.ts
    • src/index.d.ts
    • src/firebase-namespace-api.ts
    • src/app/firebase-namespace.ts
    • src/app-check/app-check-namespace.ts
    • src/auth/auth-namespace.ts
    • src/database/database-namespace.ts
    • src/firestore/firestore-namespace.ts
    • src/instance-id/instance-id-namespace.ts
    • src/installations/installations-namespace.ts
    • src/machine-learning/machine-learning-namespace.ts
    • src/messaging/messaging-namespace.ts
    • src/project-management/project-management-namespace.ts
    • src/remote-config/remote-config-namespace.ts
    • src/security-rules/security-rules-namespace.ts
    • src/storage/storage-namespace.ts
  • Obsolete Test Suites:
    • test/unit/app/firebase-namespace.spec.ts
    • test/unit/firebase.spec.ts
    • test/integration/postcheck/typescript/example.test.ts
    • test/integration/postcheck/typescript/example.ts

2. Modernized Root Entry Point & Build Configuration

  • src/index.ts: Rewritten to directly export the core modular App APIs (such as initializeApp, getApp, getApps, deleteApp, cert, refreshToken, SDK_VERSION, etc.) while retaining the environment compatibility check.
  • entrypoints.json: Removed the "legacy": true flag for "firebase-admin" and redirected the root "typings" to ./lib/index.d.ts.
  • gulpfile.js: Removed the obsolete copyTypings gulp task and updated build and compile_all task dependency pipelines.
  • tsconfig.json: Added ts-node configuration block defining moduleTypes to enforce CommonJS compilation for all .ts files during execution. This prevents Node's native TypeScript loader (--experimental-strip-types) in Node 23.6.0+ from resolving extension-less imports as ES modules, ensuring a robust and compatible test runner setup.

3. Refactored and Cleaned Up Test Suites

  • Integration Tests (test/integration/): Removed legacy namespace assertions from app.spec.ts, firestore.spec.ts, and database.spec.ts. Updated assertions to verify modular APIs and modular service bindings.
  • Unit Tests (test/unit/):
    • Removed all obsolete legacy service methods tests from app/firebase-app.spec.ts (preserving core state and token verification logic).
    • Updated test/unit/index.spec.ts to remove deleted legacy spec imports.
    • Corrected mock/utility imports in test/resources/mocks.ts and test/unit/utils.ts to import AppOptions from modular locations.

@lahirumaramba lahirumaramba added release-note release:stage Stage a release candidate labels May 27, 2026
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 removes the legacy namespaced API (firebase-admin namespace, default-namespace.d.ts, firebase-namespace.ts, etc.) and transitions the codebase entirely to the modular API. This includes removing the copyTypings gulp task, updating entrypoints, deleting legacy namespace declaration files, removing legacy integration and unit tests, and updating the main entrypoint src/index.ts to export only modular APIs.

Copy link
Copy Markdown
Collaborator

@jonathanedey jonathanedey left a comment

Choose a reason for hiding this comment

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

LGTM with one comment, Thanks!

Comment thread src/index.ts
Comment on lines 20 to 36
@@ -35,4 +35,14 @@ https://firebase.google.com/docs/web/setup
console.error(message);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

src/index.ts is now a mirror copy of src/app/index.ts except for this extra environment check.

  1. Should we also have this warning in src/app/index.ts?
  2. Is there a way we can de-duplicate this while keeping the same functionalty?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:stage Stage a release candidate release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants