Skip to content

Issue #432: Grunt JS Implementation #437

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

Closed
wants to merge 6 commits into from
Closed

Issue #432: Grunt JS Implementation #437

wants to merge 6 commits into from

Conversation

cfoellmann
Copy link
Contributor

Implements #432

I suggest adding node_modules to .gitignore (and maybe a few more things) to prevent node files from being committed

@lukecarbis lukecarbis changed the title Issue 432 Issue #432: Grunt JS Implementation Apr 23, 2014
@@ -158,6 +158,7 @@ public static function admin_enqueue_scripts( $hook ) {

$locale = substr( get_locale(), 0, 2 );
$file_tmpl = 'ui/timeago/locale/jquery.timeago.%s.js';
$debug = apply_filters( 'wp_stream_debug', SCRIPT_DEBUG ) ? '' : '.min';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a good idea to use the SCRIPT_DEBUG constant if it's defined in wp-config instead of using a filter. See https://codex.wordpress.org/Debugging_in_WordPress#SCRIPT_DEBUG

What do you think @fjarrett ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathanbardo Yeah, that makes sense to me. Something like this?

$debug = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';

@cfoellmann Any particular reason why overriding the wp-config.php constant with a filter would be desired?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be used to deviate from the current debug state. Not really a necessity.
See change below.

@jonathanbardo
Copy link
Contributor

There is a lot of jshint error on travis ci. Maybe we can tell jshint not to link at minified files?

@frankiejarrett
Copy link
Contributor

@jonathanbardo Yes, that's right. We'll need to do just that.

@jonathanbardo
Copy link
Contributor

@cfoellmann Can you add this line to .jshintignore :
ui/*.min.js

This should do the trick 😉

@jonathanbardo
Copy link
Contributor

Have we come up on a decision on this @lukecarbis and @fjarrett ?

@lukecarbis
Copy link
Contributor

👍 From me. Question though: Is it possible to run grunt with a commit hook, instead of having to remember to grunt watch?

@westonruter
Copy link
Contributor

Add it to the bin/pre-commit hook.

@westonruter
Copy link
Contributor

But maybe it would be better to wait until a release to run grunt.
Minifying the JS for every commit would be noisy.

@jonathanbardo
Copy link
Contributor

I am with weston on that one. We should only run it on a release. Now we should have a script that automates the creation of a release (connects to the vagrant machine, run grunt, commit everything...)

@westonruter
Copy link
Contributor

This script should also then part of, or at least invoked by, svn-push

@frankiejarrett
Copy link
Contributor

I'm closing this PR as it's been stale for a while.

We can reopen once it's modified to run on svn-push.

https://github.com/x-team/wp-stream/blob/2.0.0/bin/svn-push

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants