Skip to content
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

feat!: bump engines requirement to Node 22 #222

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

feat!: bump engines requirement to Node 22 #222

wants to merge 11 commits into from

Conversation

erickzhao
Copy link
Member

@erickzhao erickzhao commented Jan 10, 2025

BREAKING CHANGE: ESM-only. Bumps required Node.js version to >=22.12.0

Require Test (20.9) to be removed as a required CI check.

@electron electron deleted a comment from notion-workspace bot Jan 10, 2025
Copy link
Member

@MarshallOfSound MarshallOfSound left a comment

Choose a reason for hiding this comment

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

Not a chore, please mark as feat to ensure semantic release works

@erickzhao erickzhao changed the title chore!: bump engines requirement to Node 22 feat!: bump engines requirement to Node 22 Jan 10, 2025
@erickzhao erickzhao marked this pull request as ready for review January 10, 2025 21:14
@erickzhao erickzhao requested a review from a team as a code owner January 10, 2025 21:14
Copy link
Member

@VerteDinde VerteDinde left a comment

Choose a reason for hiding this comment

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

One other question, but this looks good 👍 If we're ready to merge, I can remove the Node 20 CI required check 😄

src/helpers.ts Outdated
throw err;
}
d('work succeeded');
await fs.remove(dir);
await fs.rm(dir, { recursive: true });
Copy link
Member

Choose a reason for hiding this comment

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

Just checking my assumptions here, but we had to add the recursive option here due to a behavior change when we moved from fs-extra to Node's fs?

Copy link
Member

Choose a reason for hiding this comment

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

Yup. It's not very explicitly documented but fs-extra's remove is recursive while Node's fs is not by default.

If we look at the latest fs-extra code for remove we can see it's just calling through to fs.rm(path, { recursive: true, force: true }) (it's technically using graceful-fs, but looks like that library just passes through fs.rm as-is - yay layers of abstraction).

But this is a good callout, because I think to ensure there's no regression in behavior here we need to add the force: true option. Adding suggestions to do so.

Copy link
Member Author

Choose a reason for hiding this comment

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

Keeping force: true makes things easier for migration purposes, but might just be masking an erroneous call if some folder never exists?

For example, I was running into a case in @electron/get where we were always attempting to delete a folder path that didn't exist.

Copy link
Member

Choose a reason for hiding this comment

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

Fair point. I think for migration purposes we should strive for no intentional behavior change, and then we can follow-up with that change after?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, I think removing force calls after the fact could be a good-first-issue since the acceptance criteria is pretty clear!

src/helpers.ts Outdated
throw err;
}
d('work succeeded');
await fs.remove(dir);
await fs.rm(dir, { recursive: true });
Copy link
Member

Choose a reason for hiding this comment

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

Yup. It's not very explicitly documented but fs-extra's remove is recursive while Node's fs is not by default.

If we look at the latest fs-extra code for remove we can see it's just calling through to fs.rm(path, { recursive: true, force: true }) (it's technically using graceful-fs, but looks like that library just passes through fs.rm as-is - yay layers of abstraction).

But this is a good callout, because I think to ensure there's no regression in behavior here we need to add the force: true option. Adding suggestions to do so.

@dsanders11
Copy link
Member

Not a chore, please mark as feat to ensure semantic release works

@erickzhao, could you also change the commit message just to be sure? Some of these repos aren't configured to default to the PR title and we've accidentally merged in the past where it grabs the first commit message instead of the title.

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.

5 participants