Skip to main content

Search and Top Navigation

#10674 closed bug (fixed)

Opened October 26, 2014 04:02PM UTC

Closed March 05, 2015 02:12PM UTC

Last modified March 05, 2015 02:12PM UTC

AMD loading broken on minified scripts

Reported by: sephii Owned by: scottgonzalez
Priority: minor Milestone: 1.12.0
Component: [meta] ui.build Version: 1.11.2
Keywords: Cc:
Blocked by: Blocking:
Description

Using requirejs and trying to use jquery ui plugins from the minified/ directory raises a "Error: Script error for: jquery-ui/core". This is because minified scripts depend on "./core" instead of "./core.min".

This occurs in version 1.11.2, installed with Bower.

Attachments (0)
Change History (13)

Changed October 26, 2014 06:50PM UTC by scottgonzalez comment:1

resolution: → notabug
status: newclosed

You're probably looking for https://github.com/components/jqueryui/issues/new since we don't host minified files.

Changed October 29, 2014 08:45AM UTC by sephii comment:2

After reporting it to the maintainers of the components organization, it looks like this is indeed a bug on the jQuery UI side. It's apparently caused by the minify task from the Gruntfile that doesn't rewrite the dependencies after renaming the files. See https://github.com/components/jqueryui/issues/42 for more info.

Could you please reopen this issue?

Changed October 29, 2014 12:16PM UTC by scottgonzalez comment:3

Before reopening this, I'd like to confirm that we want to keep this task. If we do keep it, we should probably just stop renaming the files. There definitely shouldn't be a "core.min" dependency, it should just be "core".

Changed October 29, 2014 12:37PM UTC by jzaefferer comment:4

_comment0: sephii, what's the motivation for loading minified files using AMD? Seems like you should be loading non-minified files, then use the optimizer to create one or more optimized, minified files for production.1414599810239221

sephii, what's the motivation for loading minified files using AMD? Seems like you should be loading non-minified files, then use the optimizer to create one or more optimized, minified files for production.

Changed October 29, 2014 04:34PM UTC by scottgonzalez comment:5

We're going to remove the wrappers in the minified files. As Jörn has said, you should be doing the minification yourself using the optimizer.

Changed October 29, 2014 04:52PM UTC by tj.vantoll comment:6

resolution: notabug
status: closedreopened

Changed October 29, 2014 04:57PM UTC by tj.vantoll comment:7

owner: → tj.vantoll
status: reopenedassigned

Changed November 19, 2014 05:19PM UTC by arschmitz comment:8

The way we handle this in jQuery mobile is by parsing them out using comments read by the build script https://github.com/jquery/jquery-mobile/blob/master/js/core.js#L1-L2 https://github.com/jquery/jquery-mobile/blob/master/Gruntfile.js#L380

Changed December 03, 2014 11:11AM UTC by rxaviers comment:9

_comment0: sephii thanks for reporting this bug and sorry for the delay. But, first of all, this issue should be reported in https://github.com/components/jqueryui (the bower module), not in jQuery UI. We don't distribute minified components anymore since 1.11. \ \ arschmitz correct me if I'm wrong. But, jQuery mobile doesn't handle this at all. Its final bundles (both the normal and the minified) include the generated-on-build-time UMD wrapper. It happens that, similarly to jQuery UI, the only bundle's dependency is `jquery`. \ \ Anyway, the `jquery` dependency is safe from this minified problem. Because, jQuery is one of the few exceptions on AMD that defines itself as a named module. So, if one loads jquery.min.js, this code will be defined as a `jquery` AMD module.1417605551927372

arschmitz correct me if I'm wrong. But, jQuery mobile doesn't handle this at all. Its final bundles (both the normal and the minified) include the generated-on-build-time UMD wrapper. It happens that, similarly to jQuery UI, the only bundle's dependency is jquery.

Anyway, the jquery dependency is safe from this minified problem. Because, jQuery is one of the few exceptions on AMD that defines itself as a named module. So, if one loads jquery.min.js, this code will be defined as a jquery AMD module.

Changed December 03, 2014 11:44AM UTC by rxaviers comment:10

_comment0: On jQuery UI, we are distributing two different things depending of the "channel": \ - via download builder, we're distributing the bundles (JS and CSS) as defined by https://github.com/jquery/download.jqueryui.com/pull/214 and https://github.com/jquery/download.jqueryui.com/issues/207. \ - via grunt task (via dist/), we're distributing the JS bundles only (no CSS) plus the minified JS components, but no images. \ - via tagged versions (e.g., git checkout 1.11.2) (via dist/), we have bundles (JS and CSS), but no images. \ \ Questions to ourselves: \ \ 1. Should the `dist/` folder of our repo be considered, as it sounds like, a distribution "channel"? \ 1. Which files should it include? The same ones of our download package? \ 1417607141606995
_comment1: On jQuery UI, we are distributing different things depending of the "channel": \ - via download builder, we're distributing the bundles (JS and CSS) as defined by https://github.com/jquery/download.jqueryui.com/pull/214 and https://github.com/jquery/download.jqueryui.com/issues/207. \ - via grunt task (via dist/), we're distributing the JS bundles only (no CSS) plus the minified JS components, but no images. \ - via tagged versions (e.g., git checkout 1.11.2) (via dist/), we have bundles (JS and CSS), but no images. \ \ Questions to ourselves: \ \ 1. Should the `dist/` folder of our repo be considered, as it sounds like, a distribution "channel"? \ 1. Which files should it include? The same ones of our download package? \ 1417628322707939

On jQuery UI, we are distributing different things depending of the "channel":

Questions to ourselves:

1. Should the dist/ folder of our repo be considered, as it sounds like, a distribution "channel"?

1. Which files should it include? The same ones of our download package?

Changed March 04, 2015 05:49PM UTC by scottgonzalez comment:11

component: ui.core[meta] ui.build
owner: tj.vantollscott.gonzalez

Changed March 05, 2015 02:12PM UTC by Scott González comment:12

resolution: → fixed
status: assignedclosed

Build: Don't use .min.js extension for individual source files

We don't actually use these files for anything other than size comparisons,

but having the .min.js extension means that AMD is broken.

Note: If you're using AMD with the minified files, just run a build instead.

Fixes #10674

Closes gh-1466

Changeset: 47a32fb5b3c190123937e0178900ef754c3e220d

Changed March 05, 2015 02:12PM UTC by scottgonzalez comment:13

milestone: none1.12.0