-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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
Migrate most grunt tasks off of grunt #5318
Conversation
92eb540
to
a85a6aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Publishing what I have so far. Tomorrow, I'll resume with commit 386acf4
(#5318)
802b344
to
11863e0
Compare
8ffaa85
to
6d0e2f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the whole thing now. Nice work! I like a lot of the simplifications.
I haven't had a chance to test it locally, I'll do that next.
6d0e2f2
to
a3b2403
Compare
I think I've covered all the remaining feedback. However, how would you feel about changing the name of |
9576492
to
8c8e14f
Compare
I noticed an inconsistency between multiple compare_size runs and realized it's probably the version string varying by SHA. To fix it, compare_size now removes the banner for comparisons. |
Naming is hard. 🙂 I like |
|
||
let contents = await fs.promises.readFile( filename, "utf8" ); | ||
|
||
// Remove the banner for size comparisons. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s not just the banner, the jquery
property varies as well.
However, I don’t think we should remove it. It’s what’s in the file and that’s what is getting served to the users; we should take that into account.
- confirmed they do not throw errors on Node 10 (still skipped)
- Output is a little wonky, but the tests are run in parallet to save time.
- this task was really a combination of two tasks, 1. process the files for distribution (ensure ascii and unix endings) 2. copy dist files somewhere else on the file system - should not be needed anymore, especially now with slim and module files, which it never supported.
- uses chalk, which requires esm modules
- move all the combinations to the JS file
8c8e14f
to
76c85ac
Compare
Remaining feedback addressed. As soon as we merge this, I'll start preparing the 3.x PR. I had already made a 3.x branch, but I need to copy the changes made from PR feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to test this locally but let's merge, any feedback for how things work we can address separately.
Summary
Migrates most grunt tasks to npm scripts.
While there are a lot of changes, the only change to the built jQuery file is the version string. See below for full details.
I've tried to mostly keep the commits to one per task, but there are some early commits migrating the lint task in steps and some later commits to combine certain tasks (i.e. build, minify, dist, and compare_size) and simplify them. Here are some important things to notes:
grunt npmcopy
removed, I committed the package-lock.json. We could actually commit a yarn.lock as well if we want. npm now updates both.chalk
for pretty terminal colors. It uses Node's zlib directly instead of gzip-js or another npm package. gzip-js hasn't been touched in years. Fortunately, zlib is easy-to-use. Sizes are a bit larger than before using the default options, but that should be okay as we're looking for comparisons, not completely accurate size predictions.Version string
The version string now includes a short SHA when the build is not a release build (e.g.
4.0.0-pre+SHA
). Also, I made the version follow semver syntax. So, the slim version would now be4.0.0+slim
. In a non-release build, that would look like4.0.0-pre+slim.SHA
. Custom builds still add excluded/included modules to the version string (when not the slim build), but I didn't bother adding those in a way that follows semver syntax (e.g.4.0.0-pre+a85a6aa2 -ajax,-ajax/binary,etc
). I'd like to remove-pre
as well, but that change has already been made in my release PR (#5306).Checklist
TODO
I see that yargs throws an error on load in Node 10.x. I'll need to think on the best way to fix this.Should be good now. Turns outconcurrently
hasyargs
as a dependency. yargs requires Node >=12, so it can't be used in the pretest script on Node 10.