Make WordPress Core

Opened 12 years ago

Closed 9 years ago

#17340 closed enhancement (wontfix)

Mark up script-loader.php versions for programmatic updating

Reported by: markjaquith's profile markjaquith Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:


Whenever we update one of our dev CSS or JS files, we have to use YUI to re-minify them, and bump their version number in script-loader.php. The YUI part can be done programmatically, but it's not quite possible to bump the script-loader.php version numbers without manual intervention. If the number strings (yyyymmdd{optional-abcd suffix}) were marked up with PHP comments in a standardized way, we could automate that step as well.

Since any script would have the file name in hand, I propose the following:


That is, a PHP comment block that immediately starts with a hash (#) and is followed by one or more dev URLs that the version number applies to (multiple ones separated by another hash), and immediately followed by a version string enclosed in single quotes, in the format:


Change History (6)

#1 @scribu
12 years ago

I don't get it. :|

#2 @dd32
12 years ago

I don't get it.

It's a syntax to allow programmatic updating of the date strings, Ie. A script can update a CSS/JS resorce file, minify it, and update any version strings which the modified files apply to.

#3 @scribu
12 years ago

Thanks, I guess I don't get the "version strings which the modified files apply to" bit.

#4 @dd32
12 years ago

I guess I don't get the "version strings which the modified files apply to" bit.

Ah, Rather than processing the entire line to work out what file(s) it is, by relying upon the comment we gain a simpler processing script.. not only that, but I believe a few tinyMCE files rely on a few files to be built together to form the finalised package, so one change can affect a different "file"..

Ultimately, this will all depend on the scripts that utilise it, and given I don't know of any "in the wild", I know a few commitors do have similar scripts (And I'd say Mark has a SuperScript :))

#5 @azaozz
12 years ago

Frankly I like seeing the output from the YUI compressor and fixing the JS based on it. It doesn't just put the JS through a set of regexp, it actually runs it using Rhino and outputs some warnings or alerts if it's broken.

Last edited 12 years ago by azaozz (previous) (diff)

#6 @nacin
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

We have fixed this three times over since this ticket was open. Ohh yeahh. *dons shades*

Note: See TracTickets for help on using tickets.