-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
WIP - Update glob to v10 #388
Conversation
@kiskoza can you solve the JS test failures? |
9d88f45
to
28dace0
Compare
The issue with the CI was that I removed nodejs v14 from the supported engine versions, but the CI was configured to use that in the matrix. I removed v14 from the CI matrix. |
28dace0
to
9f12326
Compare
This sounds good, but do we need to update the major version of shakapacker to require node 16+? CC: @G-Rath |
It looks like this is the only use of shakapacker/package/environments/base.js Lines 16 to 25 in 0f89275
Technically this includes user input via As such, I think we could just remove const getSourceFiles = (rootPath, includeNested) => {
if(!includeNested) {
return fs.readdirSync(rootPath);
}
return fs.readdirSync(rootPath, { withFileTypes: true }).flatMap(dirent => {
if (dirent.isDirectory()) {
return getSourceFiles(join(rootPath, dirnet.name), true);
}
return dirnet.name;
})
} (that's very rough since I didn't want to steal @kiskoza's thunder, though I am happy to pick this up if folks want 🙂) That would probably be a bit slower than That should result in addressing #384 without requiring dropping any node versions or a new major version (though @justin808 since we're expecting to do a new major sometime in next few months, I plan to talk about dropping support for Ruby 2.x and so it still might be worth dropping support for older versions of Node too, but we can talk about that separately) |
The Node code is used only at build time, so I doubt a memory leak would affect much. I'd say we defer until v8 and drop support for older Node. |
I think that's fine on the short-term but long-term it still seems like a win to drop a dependency entirely so if anyone wants to pick that up I'm happy to review it - otherwise I'll pick it up sometime either after v8 or if it starts getting flagged by |
Bundler has dropped support for Ruby 2.6 and 2.7 in their recent But also I think replacing |
I can't find anything about their versioning that indicates why they didn't consider dropping the Ruby versions a breaking change but under traditional semver (which they might not be following) it is a breaking change, but I can say in the Node community at least dropping support for a version of Node is considered a breaking change - there can be some wiggle room such as if the versions are super old and a package doesn't have an explicit "engines" field, but overall I don't think this change is critical enough to be worth dropping that support especially when we're planning to do a new major soon anyway and we agree that the |
Thanks for all your input on the topic. It feels like we shouldn't make this change yet as dropping support for older nodejs versions require a major version bump in the npm package, but this dependency is hardly used and the change is not big enough to be the reason to drop older nodejs, the original issue could be solved in other ways as well. I'm happy to either leave it open or just close it as it's already referenced from the issue and could be reopened later when we need it |
Is there any argument against switching to |
Been no movement on this one so opened my own stab for this at #435 |
Summary
I've spotted #384 and I thought I give it a try. Shakapacker currently depends on an older version of
glob
which has a dependency with known memory leak. The author ofglob
ditched that dependency aleady and made "Massive performance improvements." in v9. In v10 the only breaking change is that there are no default exports, but Shakapacker is not using that anyways, so I thought it's better to use the latest, maintained version of the package instead of pinning it to v9.Though it seems to be an easy upgrade, it has some possible drawbacks: the new
glob
versions requires at least nodejs v16. Shakapacker currently supports^12.13.0 || ^14 || >=16
. The official support for v12 ended more than a year ago, for v14 it ended 7 months ago (reference), so I don't think it should cause a problem.Pull Request checklist
Add/update test to cover these changesUpdate documentationOther Information
Glob in dev dependencies
There are some dev dependencies that still require glob v7, but those shouldn't affect shakapacker users. As far as I read about these packages, they are going to upgrade glob as soon as they can drop nodejs 14, for example jestjs/jest#14509