Skip to content

Commit 6bf4d4d

Browse files
committed
Revert commit converting promise to lie.js. Will make a PR with it.
This reverts commit ddc707c.
1 parent 1c5a737 commit 6bf4d4d

File tree

13 files changed

+80
-80
lines changed

13 files changed

+80
-80
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ before_script:
55
- npm install -g bower
66
- npm install
77
- bower install
8-
- bower install jquery
98
script:
109
- grunt travis
1110
env:

Gruntfile.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = function (grunt) {
6262
// Delete files created by the "testBuild" target.
6363
testBuild: [
6464
"tests/functional/jqueryApp/{bower_components,node_modules,build,tmp}",
65-
"tests/jquery.js" // work around grunt-amd-build bug where it puts files outside of tmp/ dir
65+
"tests/jquery.js" // work around grunt-amd-build bug where it puts files outside of tmp/ dir
6666
]
6767
}
6868
});
@@ -76,7 +76,7 @@ module.exports = function (grunt) {
7676

7777

7878
// By default, lint and run all tests.
79-
grunt.registerTask("default", ["jsbeautifier", "lineending", "jshint", "test:remote"]);
79+
grunt.registerTask("default", ["jsbeautifier", "lineending", "jshint", "intern:remote"]);
8080

8181
// Just lint
8282
grunt.registerTask("lint", ["jsbeautifier", "lineending", "jshint"]);
@@ -116,16 +116,7 @@ module.exports = function (grunt) {
116116
opts: {
117117
cwd: appRootDir
118118
}
119-
}, finish);
120-
}
121-
122-
function finish(error, buildResults) {
123-
if (error !== null) {
124-
grunt.log.writeln(buildResults.stdout);
125-
done(error);
126-
return;
127-
}
128-
done(true);
119+
}, done.bind(null, true));
129120
}
130121

131122
grunt.util.spawn({
@@ -167,7 +158,7 @@ module.exports = function (grunt) {
167158
addReporter("console");
168159
}
169160

170-
// First create the test builds. These are referenced from the intern tests.
161+
// First create the test builds. These are referenced from the intern tests.
171162
grunt.task.run("testBuild");
172163

173164
// Then run the intern tests.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ All contributions require a [Dojo Foundation CLA](http://dojofoundation.org/abou
2424
_Bower_ release installation:
2525

2626
$ bower install requirejs-dplugins
27-
$ bower install jquery (if you are using the jquery plugin)
2827

2928
_Manual_ master installation:
3029

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.4.1",
44
"description": "AMD plugins for RequireJS",
55
"dependencies": {
6-
"lie": ">=2.8",
6+
"jquery": ">=2.1",
77
"requirejs": "2.1.x"
88
},
99
"devDependencies": {},

css.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030

3131
define([
3232
"./has",
33-
"lie/dist/lie",
33+
"./jquery!deferred",
3434
"module"
35-
], function (has, Promise, module) {
35+
], function (has, $, module) {
3636
"use strict";
3737

3838
has.add("event-link-onload-api", function (global) {
@@ -49,30 +49,30 @@ define([
4949
* @private
5050
*/
5151
var listenOnLoad = function (link) {
52-
var loadHandler = has("event-link-onload-api") ?
53-
function (resolve) {
54-
// We're using "readystatechange" because IE happily support both
55-
link.onreadystatechange = link.onload = function () {
56-
if (!link.readyState || link.readyState === "complete") {
57-
link.onreadystatechange = link.onload = null;
58-
resolve();
52+
var def = new $.Deferred(),
53+
loadHandler = has("event-link-onload-api") ?
54+
function () {
55+
// We're using "readystatechange" because IE happily support both
56+
link.onreadystatechange = link.onload = function () {
57+
if (!link.readyState || link.readyState === "complete") {
58+
link.onreadystatechange = link.onload = null;
59+
def.resolve();
60+
}
61+
};
62+
} :
63+
function () {
64+
// watches a stylesheet for loading signs.
65+
var sheet = link.sheet || link.styleSheet,
66+
styleSheets = document.styleSheets;
67+
if (sheet && Array.prototype.lastIndexOf.call(styleSheets, sheet) !== -1) {
68+
def.resolve();
69+
} else {
70+
setTimeout(loadHandler, 25);
5971
}
6072
};
61-
} :
62-
function (resolve) {
63-
// watches a stylesheet for loading signs.
64-
var sheet = link.sheet || link.styleSheet,
65-
styleSheets = document.styleSheets;
66-
if (sheet && Array.prototype.lastIndexOf.call(styleSheets, sheet) !== -1) {
67-
resolve();
68-
} else {
69-
setTimeout(loadHandler, 25, resolve);
70-
}
71-
};
7273

73-
return new Promise(function (resolve) {
74-
loadHandler(resolve);
75-
});
74+
loadHandler();
75+
return def.promise();
7676
};
7777

7878
var loadCss = {

docs/jquery.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ library via a `<script>` tag, in which case it just returns a pointer to the alr
1111

1212
It's useful to avoid loading jQuery twice.
1313

14-
When using this plugin, you must manually include jquery into your app via `bower install jquery` or via
14+
When using this plugin, you can use the provided jquery (installed as a `requirejs-dplugins` bower dependency)
15+
or use your own version, either via `bower install jquery` or via
1516
a script tag (ex: `<script src="https://code.jquery.com/jquery-2.1.1.min.js">`).
1617

1718
## Example

jquery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ define([], function () {
2323
require.config({
2424
map: {
2525
jquery: {
26-
"jquery/src/selector": "jquery/src/selector-native" // don't pull in sizzle
26+
"jquery/src/selector": "jquery/src/selector-native" // don't pull in sizzle
2727
}
2828
}
2929
});

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
"intern": "2.1.x",
1212
"grunt-lineending": "^0.2.2"
1313
},
14-
"licenses": [{
15-
"type": "BSD",
16-
"url": "https://github.com/ibm-js/requirejs-dplugins/blob/master/LICENSE"
17-
}],
14+
"licenses": [
15+
{
16+
"type": "BSD",
17+
"url": "https://github.com/ibm-js/requirejs-dplugins/blob/master/LICENSE"
18+
}
19+
],
1820
"private": true
1921
}

tests/functional/jqueryApp/Gruntfile.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@ module.exports = function (grunt) {
1111
var outdir = "./build/";
1212
var tmpdir = "./tmp/";
1313

14+
var common = {
15+
options: { banner: "<%= " + outprop + ".header%>" },
16+
src: "<%= " + outprop + ".modules.abs %>",
17+
dest: outdir + "<%= " + outprop + ".layerPath %>"
18+
};
19+
1420
grunt.initConfig({
1521
amdloader: {
1622
baseUrl: ".",
1723

1824
paths: {
1925
jquery: "bower_components/jquery",
20-
lie: "bower_components/lie",
2126
"requirejs-dplugins": "../../.."
2227
},
2328

tests/functional/jqueryApp/bower.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "0.1.0",
44
"description": "Test application using jquery! plugin",
55
"dependencies": {
6-
"lie": ">=2.8",
76
"jquery": ">=2.1",
87
"requirejs": "2.1.x"
98
}

0 commit comments

Comments
 (0)