[buddypress-trac] [BuddyPress Trac] #5160: Use gruntjs to generate minified versions of the js and css files everywhere.

buddypress-trac noreply at wordpress.org
Fri Jan 31 19:58:37 UTC 2014


#5160: Use gruntjs to generate minified versions of the js and css files
everywhere.
-------------------------+------------------
 Reporter:  enej         |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  2.0
Component:  Core         |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |
-------------------------+------------------
Changes (by DJPaul):

 * milestone:  Future Release => 2.0


Comment:

 Let's use this ticket to talk about adding Grunt to BuddyPress. In
 addition to just minifying CSS and JS, Grunt would let us have a better
 development workflow by better organising plugin code vs. any other bits
 of code that we currently have in trunk (e.g. the travis file), as well as
 opening the door to things in future like using a CSS pre-compiler. Having
 a convenient script to build a release package would also help the core
 team out when we do releases, and gives a couple of interesting
 possibilities for managing the deprecation of BP-Default and old bbPress.

 If we did decide to utilise Grunt, the next issue is creating the Grunt
 file and deciding how we want the project organised. For example,
 WordPress core https://core.trac.wordpress.org/browser/trunk lives inside
 a `/src/` subfolder, and the unit tests folder, some i18n tools, and a
 bunch of non-plugin config files live at the top level. I see this as a
 fairly neat way of organising the project's files, and I suspect we'd do
 something similar if we ever worked on a new plugin.

 If we used a similar arrangement, we'd break any sites that do a SVN
 checkout of BuddyPress trunk; how many sites might be affected is unknown.
 We could assume that if you're running a SVN checkout of trunk, that
 you're keeping an eye on core development and would know how to fix the
 problems.

 Another approach is not re-organising trunk, and just adding the Grunt
 file into the root `/trunk/` folder. Biggest downside is that we mix
 build/test scripts with the actual code, and everything continues to get a
 bit messier.

 I have put together proof-of-concepts for each idea:

 * https://github.com/paulgibbs/bp-grunt (move trunk)
 * https://github.com/paulgibbs/bp-grunt-lite (don't move trunk)

 `bp-grunt-lite`'s Grunt build file is a little bit more fleshed out and
 tested than `bp-grunt` is, but both should at least demonstrate the basic
 idea and generate a release build.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5160#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list