Skip to main content

Search and Top Navigation

#14999 closed bug (wontfix)

Opened July 06, 2016 08:25PM UTC

Closed July 06, 2016 08:42PM UTC

Last modified July 07, 2016 03:54AM UTC

Can *.min.* have fewer comments

Reported by: JoshuaKGoldberg Owned by:
Priority: minor Milestone: none
Component: [meta] ui.build Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:
Description

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

* http://jqueryui.com

* 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. | jquery.org/license */

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

Attachments (0)
Change History (9)

Changed July 06, 2016 08:28PM UTC by JoshuaKGoldberg comment:1

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

Changed July 06, 2016 08:42PM UTC by scottgonzalez comment:2

resolution: → wontfix
status: newclosed

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

Changed July 06, 2016 09:11PM UTC by JoshuaKGoldberg comment:3

@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?

Changed July 06, 2016 10:20PM UTC by scottgonzalez comment:4

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.

Changed July 06, 2016 10:28PM UTC by JoshuaKGoldberg comment:5

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

Changed July 07, 2016 01:22AM UTC by scottgonzalez comment:6

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 http://jqueryui.com/download/ as you've said, but then only select the plugins you actually use.

Changed July 07, 2016 01:32AM UTC by JoshuaKGoldberg comment:7

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 jqueryui.com/download (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?

Changed July 07, 2016 01:33AM UTC by JoshuaKGoldberg comment:8

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.

Changed July 07, 2016 03:53AM UTC by arschmitz comment:9

_comment0: 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 of a second to download there are many many optimizations you could make that would make a bigger difference then this.1467863696792361

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.