Skip to content

Core: Always show a startup log message, even for minified builds #151

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 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ jQuery.migrateWarnings = [];
// jQuery.migrateMute = false;

// Show a message on the console so devs know we're active
if ( !jQuery.migrateMute && window.console && window.console.log ) {
window.console.log( "JQMIGRATE: Logging is active" );
if ( window.console && window.console.log ) {
window.console.log( "JQMIGRATE: Migrate is installed" +
( jQuery.migrateMute ? "" : " with logging active" ) +
", version " + jQuery.migrateVersion );
}

// Set to false to disable traces that appear with warnings
Expand Down
5 changes: 3 additions & 2 deletions warnings.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ The production (compressed) version of the plugin does not generate these warnin

All warnings generated by this plugin start with the text "JQMIGRATE" for easy identification. The warning messages, causes, and remediation instructions are listed below.

### JQMIGRATE: Logging is active
### JQMIGRATE: Migrate is installed, version X
### JQMIGRATE: Migrate is installed with logging active, version X

This is _not_ a warning, but a console log message the plugin shows when it first loads to indicate that warnings will be shown when appropriate. If the minified version of the plugin is being used or `jQuery.migrateMute` was set to `true` before the plugin was loaded, the plugin will not show this message or any warnings.
This is _not_ a warning, but a console log message the plugin shows when it first loads to indicate whether warnings will be shown on the console when appropriate. As of version 1.4.0 this message is also shown with production builds. The use jQuery Migrate in production has performance impacts and can complicate debugging as it modifies the normal behavior of the version of jQuery being used.

### JQMIGRATE: jQuery.attrFn is deprecated

Expand Down