Skip to content

Commit c1e640c

Browse files
committed
Transpile vendor tree, fix Ember version detection
1 parent 2f5bb77 commit c1e640c

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const EMBER_VERSION_WITH_JQUERY_DEPRECATION = '3.9.0-canary';
3+
const EMBER_VERSION_WITH_JQUERY_DEPRECATION = '3.9.0-alpha.1';
44

55
module.exports = {
66
name: require('./package').name,
@@ -50,6 +50,13 @@ module.exports = {
5050
files: ['jquery.js'],
5151
});
5252

53-
return new BroccoliMergeTrees([jquery, tree]);
53+
let babelAddon = this.project.findAddonByName('ember-cli-babel');
54+
let transpiledTree = babelAddon.transpileTree(tree, {
55+
'ember-cli-babel': {
56+
compileModules: false
57+
}
58+
});
59+
60+
return new BroccoliMergeTrees([jquery, transpiledTree]);
5461
},
5562
};

vendor/jquery/component.dollar.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
Ember.Component.reopen({
2-
$(sel) {
3-
Ember.assert(
4-
"You cannot access this.$() on a component with `tagName: ''` specified.",
5-
this.tagName !== ''
6-
);
1+
import { assert } from '@ember/debug';
72

8-
if (this.element) {
9-
return sel ? jQuery(sel, this.element) : jQuery(this.element);
3+
(function() {
4+
Ember.Component.reopen({
5+
$(sel) {
6+
assert(
7+
"You cannot access this.$() on a component with `tagName: ''` specified.",
8+
this.tagName !== ''
9+
);
10+
11+
if (this.element) {
12+
return sel ? jQuery(sel, this.element) : jQuery(this.element);
13+
}
1014
}
11-
}
12-
});
15+
});
16+
})();

0 commit comments

Comments
 (0)