Skip to content

feat(core)!: remove legacy cache flag from nx.json #30787

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

Merged
merged 5 commits into from
Apr 29, 2025

Conversation

AgentEnder
Copy link
Member

Current Behavior

useLegacyCache is there for opting out of db cache impl

Expected Behavior

db cache is only cache when at all possible, unfortunately on wasm builds it is still unsupported.

Related Issue(s)

Fixes #

@AgentEnder AgentEnder requested review from FrozenPandaz, jaysoo and a team as code owners April 17, 2025 20:09
Copy link

vercel bot commented Apr 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Apr 28, 2025 7:59pm

Copy link

nx-cloud bot commented Apr 17, 2025

View your CI Pipeline Execution ↗ for commit 902b817.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-ci ✅ Succeeded 3m 42s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 22s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 4s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 1s View ↗
nx documentation ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-29 14:10:43 UTC

@@ -0,0 +1,27 @@
#### Use Legacy Cache

Removes `useLegacyCache` as it is no longer functional in Nx 21
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Removes `useLegacyCache` as it is no longer functional in Nx 21
Removes `useLegacyCache` from `nx.json` as it is no longer functional in Nx 21

return;
}

// If workspaces had `enableDbCache` we can just delete the property as the db cache is enabled by default in nx v20
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment doesn't make sense


// If workspaces had `enableDbCache` we can just delete the property as the db cache is enabled by default in nx v20
if ((nxJson as any).useLegacyCache) {
delete (nxJson as any).enableDbCache;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
delete (nxJson as any).enableDbCache;
delete (nxJson as any).useLegacyCache;

@@ -1682,6 +1684,12 @@ async function runMigrations(
title: `No changes were made from running '${opts.runMigrations}'. This workspace is up to date!`,
});
}
if (nextSteps.length > 0) {
output.log({
title: `Some migrations require additional steps to be completed, please check the following:`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
title: `Some migrations require additional steps to be completed, please check the following:`,
title: `Some migrations have additional information. See below:`,

if (!Array.isArray(value)) {
return false;
}
return value.reduce((acc, v) => acc && typeof v === 'string', true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return value.reduce((acc, v) => acc && typeof v === 'string', true);
return value.every((v) => typeof v === 'string');

@@ -43,5 +43,11 @@ export async function repair(
title: `No changes were necessary. This workspace is up to date!`,
});
}
if (nextSteps.length) {
output.log({
title: 'Some next steps may be necessary to complete the repair:',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
title: 'Some next steps may be necessary to complete the repair:',
title: 'Some repairs have additional information. See below:',

@@ -8,6 +8,7 @@ import {

import type { NxJsonConfiguration } from './nx-json';
import { Schema } from '../utils/params';
import { Tree } from '../generators/tree';
Copy link
Collaborator

Choose a reason for hiding this comment

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

import type

@@ -8,6 +8,7 @@ import {

import type { NxJsonConfiguration } from './nx-json';
import { Schema } from '../utils/params';
Copy link
Collaborator

Choose a reason for hiding this comment

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

import type


#### Sample Code Changes

Removes `tasksRunnerOptions` from `nx.json` if it would be empty after removing custom tasks runners.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Removes `tasksRunnerOptions` from `nx.json` if it would be empty after removing custom tasks runners.
Removes custom task runner configuration from `nx.json`

@AgentEnder AgentEnder force-pushed the feat/remove-legacy-cache branch from aac22fc to 902b817 Compare April 28, 2025 19:46
@AgentEnder AgentEnder merged commit c8d89e2 into master Apr 29, 2025
6 checks passed
@AgentEnder AgentEnder deleted the feat/remove-legacy-cache branch April 29, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants