Make WordPress Core

Changeset 56247


Ignore:
Timestamp:
07/17/2023 02:05:51 PM (8 months ago)
Author:
kadamwhite
Message:

Build Tools: Remove outmoded jsvalidate task from Gruntfile.

grunt-jsvalidate was added to catch situations where minification introduced parsing errors in Internet Explorer.
IE is no longer supported by WordPress, and the grunt task itself has not been maintained for a decade.
Removing this task simplifies the build and avoids false-positive warnings where the outdated tool flags modern JS syntax incorrectly.

Props westonruter, joemcgill, jorbin, youknowriad, desrosj, swissspidy.
Fixes #58645. See #26615.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r56065 r56247  
    10371037            }
    10381038        },
    1039         jsvalidate:{
    1040             options: {
    1041                 globals: {},
    1042                 esprimaOptions:{},
    1043                 verbose: false
    1044             },
    1045             build: {
    1046                 files: {
    1047                     src: [
    1048                         WORKING_DIR + 'wp-{admin,includes}/**/*.js',
    1049                         WORKING_DIR + 'wp-content/themes/twenty*/**/*.js',
    1050                         '!' + WORKING_DIR + 'wp-content/themes/twenty*/node_modules/**/*.js',
    1051                         '!' + WORKING_DIR + 'wp-includes/blocks/**/*.js',
    1052                         '!' + WORKING_DIR + 'wp-includes/js/dist/**/*.js',
    1053                     ]
    1054                 }
    1055             },
    1056             dynamic: {
    1057                 files: {
    1058                     src: []
    1059                 }
    1060             }
    1061         },
    10621039        imagemin: {
    10631040            core: {
     
    11921169            'js-enqueues': {
    11931170                files: [SOURCE_DIR + 'js/_enqueues/**/*.js'],
    1194                 tasks: ['clean:dynamic', 'copy:dynamic-js', 'uglify:dynamic', 'jsvalidate:dynamic'],
     1171                tasks: ['clean:dynamic', 'copy:dynamic-js', 'uglify:dynamic'],
    11951172                options: {
    11961173                    dot: true,
     
    12041181                    'webpack-dev.config.js'
    12051182                ],
    1206                 tasks: ['clean:dynamic', 'webpack:dev', 'uglify:dynamic', 'jsvalidate:dynamic'],
     1183                tasks: ['clean:dynamic', 'webpack:dev', 'uglify:dynamic'],
    12071184                options: {
    12081185                    dot: true,
     
    15051482        'uglify:all',
    15061483        'concat:tinymce',
    1507         'concat:emoji',
    1508         'jsvalidate:build'
     1484        'concat:emoji'
    15091485    ] );
    15101486
     
    18431819                grunt.config( [ 'copy', 'dynamic-js', 'files' ], files );
    18441820            }
    1845         // For the webpack builds configure the jsvalidate task to only check those files build by webpack.
     1821        // For the webpack builds configure the task to only check those files built by webpack.
    18461822        } else if ( target === 'js-webpack' ) {
    18471823            src = [
     
    18711847            if ( target === 'js-enqueues' ) {
    18721848                grunt.config( [ 'uglify', 'dynamic', 'src' ], src );
    1873                 grunt.config( [ 'jsvalidate', 'dynamic', 'files', 'src' ], src.map( function( dir ) { return  WORKING_DIR + dir; } ) );
     1849                grunt.config( [ 'dynamic', 'files', 'src' ], src.map( function( dir ) { return  WORKING_DIR + dir; } ) );
    18741850            }
    18751851            // For webpack only validate the file, minification is handled by webpack itself.
    18761852            if ( target === 'js-webpack' ) {
    1877                 grunt.config( [ 'jsvalidate', 'dynamic', 'files', 'src' ], src.map( function( dir ) { return  WORKING_DIR + dir; } ) );
     1853                grunt.config( [ 'dynamic', 'files', 'src' ], src.map( function( dir ) { return  WORKING_DIR + dir; } ) );
    18781854            }
    18791855            // For css run the rtl task on just the changed file.
  • trunk/package-lock.json

    r56240 r56247  
    1390413904            }
    1390513905        },
    13906         "grunt-jsvalidate": {
    13907             "version": "0.2.2",
    13908             "resolved": "https://registry.npmjs.org/grunt-jsvalidate/-/grunt-jsvalidate-0.2.2.tgz",
    13909             "integrity": "sha512-FWpPrwspDVc0oZmnraBrLm5yx81gXroTLO4sYZd0iCMXxki/9TzKKhx30iOzTpAUGtUM7Q4rym+Y00MMmijBYQ==",
    13910             "dev": true,
    13911             "requires": {
    13912                 "esprima": "~1.0.0"
    13913             },
    13914             "dependencies": {
    13915                 "esprima": {
    13916                     "version": "1.0.4",
    13917                     "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz",
    13918                     "integrity": "sha512-rp5dMKN8zEs9dfi9g0X1ClLmV//WRyk/R15mppFNICIFRG5P92VP7Z04p8pk++gABo9W2tY+kHyu6P1mEHgmTA==",
    13919                     "dev": true
    13920                 }
    13921             }
    13922         },
    1392313906        "grunt-known-options": {
    1392413907            "version": "2.0.0",
  • trunk/package.json

    r56229 r56247  
    5151        "grunt-file-append": "0.0.7",
    5252        "grunt-jsdoc": "2.4.1",
    53         "grunt-jsvalidate": "~0.2.2",
    5453        "grunt-legacy-util": "^2.0.1",
    5554        "grunt-patch-wordpress": "~3.0.0",
Note: See TracChangeset for help on using the changeset viewer.