Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 +1,2 @@
- 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.

- Fix Functions MCP log tool to normalize sort order and surface Cloud Logging error details (#9247)
6 changes: 3 additions & 3 deletions src/emulator/commandUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
* specify an emulator address.
*/
export function printNoticeIfEmulated(
options: any,

Check warning on line 85 in src/emulator/commandUtils.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
emulator: Emulators.DATABASE | Emulators.FIRESTORE,
): void {
if (emulator !== Emulators.DATABASE && emulator !== Emulators.FIRESTORE) {
Expand Down Expand Up @@ -110,7 +110,7 @@
* an emulator port that the command actually talks to production.
*/
export async function warnEmulatorNotSupported(
options: any,

Check warning on line 113 in src/emulator/commandUtils.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
emulator: Emulators.DATABASE | Emulators.FIRESTORE,
): Promise<void> {
if (emulator !== Emulators.DATABASE && emulator !== Emulators.FIRESTORE) {
Expand All @@ -137,8 +137,8 @@
}
}

export async function errorMissingProject(options: any): Promise<void> {

Check warning on line 140 in src/emulator/commandUtils.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 140 in src/emulator/commandUtils.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Missing JSDoc comment
if (!options.project) {

Check warning on line 141 in src/emulator/commandUtils.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .project on an `any` value
throw new FirebaseError(
"Project is not defined. Either use `--project` or use `firebase use` to set your active project.",
);
Expand All @@ -149,12 +149,12 @@
* Utility method to be inserted in the "before" function for a command that
* uses the emulator suite.
*/
export async function beforeEmulatorCommand(options: any): Promise<any> {

Check warning on line 152 in src/emulator/commandUtils.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type

Check warning on line 152 in src/emulator/commandUtils.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
const optionsWithDefaultConfig = {

Check warning on line 153 in src/emulator/commandUtils.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
...options,
config: DEFAULT_CONFIG,
};
const optionsWithConfig = options.config ? options : optionsWithDefaultConfig;

Check warning on line 157 in src/emulator/commandUtils.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .config on an `any` value

Check warning on line 157 in src/emulator/commandUtils.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value

// We want to be able to run most emulators even in the absence of
// firebase.json. For Functions and Hosting we require the JSON file since the
Expand Down Expand Up @@ -587,7 +587,7 @@
});
}

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.";

5 changes: 3 additions & 2 deletions 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 Expand Up @@ -1039,7 +1040,7 @@ export async function startAll(
is_demo_project: String(isDemoProject),
});

return { deprecationNotices: [] };
return { deprecationNotices };
}

function getListenConfig(
Expand Down
Loading