Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Marks Java 11 and below as deprecated. Support will be dropped in Firebase CLI v15. Please upgrade to Java version 21 or above to continue using the emulators.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The changelog entry is inaccurate. The code changes deprecate Java versions < 21, not just 11 and below. To avoid confusion, please update the changelog to reflect this. A more active phrasing would also improve readability.

For example: Deprecated Java versions below 21. Support will be dropped in Firebase CLI v15. Please upgrade to Java version 21 or above to continue using the emulators.

Suggested change
- Marks Java 11 and below as deprecated. Support will be dropped in Firebase CLI v15. Please upgrade to Java version 21 or above to continue using the emulators.
- Deprecated Java versions below 21. Support will be dropped in Firebase CLI v15. Please upgrade to Java version 21 or above to continue using the emulators.

- Fixed an issue with deploying indexes to Firestore Enterprise edition databases where explicit `__name__` fields could be incorrectly handled.
- The `experimental:mcp` command has been renamed to `mcp`. The old name is now an alias.
- `firebase_update_environment` MCP tool supports accepting Gemini in Firebase Terms of Service.
Expand Down
6 changes: 3 additions & 3 deletions src/emulator/commandUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ export async function checkJavaMajorVersion(): Promise<number> {
});
}

export const MIN_SUPPORTED_JAVA_MAJOR_VERSION = 11;
export const MIN_SUPPORTED_JAVA_MAJOR_VERSION = 21;
export const JAVA_DEPRECATION_WARNING =
"firebase-tools no longer supports Java versions before 11. " +
"Please install a JDK at version 11 or above to get a compatible runtime.";
"firebase-tools will drop support for Java version < 21 soon in firebase-tools@15. " +
"Please install a JDK at version 21 or above to get a compatible runtime.";
Comment on lines 591 to +593
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For improved readability, you can combine this into a single string on one line, removing the need for concatenation.

Suggested change
export const JAVA_DEPRECATION_WARNING =
"firebase-tools no longer supports Java versions before 11. " +
"Please install a JDK at version 11 or above to get a compatible runtime.";
"firebase-tools will drop support for Java version < 21 soon in firebase-tools@15. " +
"Please install a JDK at version 21 or above to get a compatible runtime.";
export const JAVA_DEPRECATION_WARNING =
"firebase-tools will drop support for Java version < 21 soon in firebase-tools@15. Please install a JDK at version 21 or above to get a compatible runtime.";

3 changes: 2 additions & 1 deletion src/emulator/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,11 @@ export async function startAll(
`No emulators to start, run ${clc.bold("firebase init emulators")} to get started.`,
);
}
const deprecationNotices: string[] = [];
if (targets.some(requiresJava)) {
if ((await commandUtils.checkJavaMajorVersion()) < MIN_SUPPORTED_JAVA_MAJOR_VERSION) {
utils.logLabeledError("emulators", JAVA_DEPRECATION_WARNING, "warn");
throw new FirebaseError(JAVA_DEPRECATION_WARNING);
deprecationNotices.push(JAVA_DEPRECATION_WARNING);
}
}
if (options.logVerbosity) {
Expand Down
Loading