Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#14999 closed bug (wontfix)

Can *.min.* have fewer comments

Reported by: Josh Goldberg Owned by:
Priority: minor Milestone: none
Component: [meta] Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:


Right now, downloading 1.12.0-rc2, we get the following copyright notice in both jquery-ui.js and jquery-ui.min.js:

/*! jQuery UI - v1.12.0-rc.2 - 2016-07-06


* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/selectmenu.js, widgets/slider.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js

* Copyright jQuery Foundation and other contributors; Licensed MIT */

Seems very wasteful. Should minified files really have so much commenting? Ideally, it would be nice to see something like the jQuery licence:

/*! jQuery vX.Y.Z | (c) 20XY jQuery Foundation, Inc. | */

Stripping out comments is both impractical and frequently not allowed by group/company OSS policies.

Change History (9)

comment:1 Changed 7 years ago by Josh Goldberg

Ah, missed the "version" dropdown. This applies to both 1.11.X and 1.12.X.

comment:2 Changed 7 years ago by Scott González

Resolution: wontfix
Status: newclosed

Basically, no. I would recommend against using the full file anyway.

comment:3 Changed 7 years ago by Josh Goldberg

@scottgonzalez the issue is that a large amount of comments are being added to the .min.js and .min.css files, not the full files. Could you please re-open the issue?

comment:4 Changed 7 years ago by Scott González

That header comment is clearly from the full file as it has a list of source files that were included in it. I'm not talking about source vs. minified files. I'm talking about the single built file which likely contains much more code than you're using. If you're concerned about file size, the place to gain bytes is by removing plugins that you're not using, not by removing the header comment.

comment:5 Changed 7 years ago by Josh Goldberg

The header comment is not from the full file; it is from the minified file. I obtained it by downloading a .zip from Is there a different preferred way to get jquery-ui drops?

comment:6 Changed 7 years ago by Scott González

That is the full file. Minification has nothing to do with whether you're talking about individual files or concatenated files. The preferred way is to go to as you've said, but then only select the plugins you actually use.

comment:7 Changed 7 years ago by Josh Goldberg

I was thinking of full as jquery-ui-1.11.4.js, and minified as jquery-ui-1.14.1.min.js. That clears that up, thanks.

At work, we directly use jquery-ui-1-11.4.min.js from (with only the plugins we need). For the sake of bandwidth I'd like to not have the extra content of * Includes: core.js, ... in the file; however, per company legal policy we're not able to change licensing headers.

The resolution I'm proposing is to not include that line of comments in the header for .min files. Does that sound reasonable?

comment:8 Changed 7 years ago by Josh Goldberg

If you're ok with including the change, and it isn't somehow very difficult in your build system, I'm willing to make a fork + PR to add it in.

comment:9 Changed 7 years ago by Alexander Schmitz

The problem with this change is that this header is included for a very good reason. We include this in the head of custom builds as a way of knowing what you included so that if you need to download it again in the future you know what components you included last time or if some one else did it and your coming in blind to the situation its also helpful. While you can always remove this portion of the header comment if its that big a deal for you, ( its not part of the license ), there is no reasonable way to add it in for people that did want it if we removed it.

To put this in perspective removing the component list from the download will save you 124bytes gzipped which on a 5mbps connection will take 2/10,000 ( .0002 ) of a second to download there are many many optimizations you could make that would make a bigger difference then this.

Last edited 7 years ago by Alexander Schmitz (previous) (diff)
Note: See TracTickets for help on using tickets.