WordPress.org

Make WordPress Core

Opened 7 months ago

Last modified 3 months ago

#42308 assigned enhancement

Update Grunt to version 1.0.1

Reported by: iandunn Owned by: netweb
Milestone: 5.0 Priority: normal
Severity: normal Version: 4.9
Component: Build/Test Tools Keywords: has-patch commit
Focuses: Cc:

Description

We're currently on Grunt 0.4.5, which is 1 major version behind the latest, 1.0.1.

Upgrading to the latest would benefit #42282, because it adds support for multiple values for command line parameters, e.g.,

grunt watch:phpunit --files=wp-includes/http.php --files=wp-includes/Requests --group=http

Changes since 0.4.5.

Attachments (2)

42308.diff (794 bytes) - added by iandunn 7 months ago.
42308.2.diff (812 bytes) - added by netweb 4 months ago.

Download all attachments as: .zip

Change History (6)

@iandunn
7 months ago

#1 @iandunn
7 months ago

I did some basic smoke testing with our existing tasks and the new version, but many of them fail with errors like, Warning: grunt.util._.flattenDeep is not a function Use --force to continue. It seems like that's caused by dependencies that aren't compatible with Grunt 1.0.0.

I tried upgrading some of them, but it didn't seem to work in all cases. I don't have time to dig any deeper right now, though.

#2 @netweb
7 months ago

  • Keywords good-first-bug removed
  • Milestone changed from Awaiting Review to 5.0
  • Owner set to netweb
  • Status changed from new to assigned

Thanks @iandunn, agreed, a great enhancement for what's going on in #42282

That said, let's do this in 5.0, I don't want to update any of these npm dependencies for 4.9 as we're now in beta.

And now with that said, I also hit upon the same issues you've had here previously in #38199#comment:15

Once /trunk becomes 5.0 I'll refresh up the patch here and any update any other dependencies that require or have issues with Grunt 1.x (I'll also update any other dependencies in a separate ticket)

As an aside and related further are the handful of tasks in #35105 which relate to updates we need to perform on our "build server" to update NodeJS and npm versions and to ensure that our build tools updates don't break the build process for build.svn.w.org

@netweb
4 months ago

#3 @netweb
4 months ago

  • Keywords has-patch commit added; needs-patch removed

Patch 42308.2.diff contains updates to grunt, grunt-legacy-util, and grunt-includes npm modules


How has this been tested?

Each of the following Grunt tasks has been run and confirmed that no errors or other code changes have occured:

  • grunt, grunt build
  • grunt _watch (Tested watching PHP, CSS, SCSS, JS files)
  • grunt travis:js, grunt travis:phpunit,
  • grunt qunit, grunt qunit:compiled
  • grunt precommit, grunt prerelease
  • grunt includes,grunt includes:emoji, grunt includes:embed

Travis CI job via my fork: https://travis-ci.org/ntwb/wordpress/jobs/329374246

Note: The changes not contained in 42308.2.diff will be added to a new ticket or tickets shortly

#4 @iandunn
3 months ago

Upgrading to the latest would benefit #42282, because it adds support for multiple values for command line parameters

That's no longer needed, since it's performant and better UX to just watch the whole repo instead.

Note: See TracTickets for help on using tickets.