Skip to content
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

Allow out of order defines in a built file #1389

Closed
jrburke opened this issue Jul 17, 2015 · 0 comments
Closed

Allow out of order defines in a built file #1389

jrburke opened this issue Jul 17, 2015 · 0 comments
Milestone

Comments

@jrburke
Copy link
Member

@jrburke jrburke commented Jul 17, 2015

A secondary issue found with requirejs/r.js#833: when the loader processes define() calls, it enables them and its dependencies. This triggers check() which can then lead to a fetch of the dependencies. However, in a built file, if the dependency is defined, but below the current define()'d module being processed, it can lead to an incorrect fetch instead of just waiting for the deifne() calls to be fully processed.

Example:

// bar.js
define('bar', function(require) {
    var foo = require("./foo");
});
define('foo', function () {});

// app.js
define(['bar'], function () {});

Requiring 'app', which will then load 'bar', will lead to fetch for 'foo', when the define()'d 'foo' later in the bar.js file should be used.

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

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.