emberjs / emberjs/ember-cli-babel

jQuery being transpiled to Ember.$

Open
#327 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
152
Forks
115
Avg merge
23h 22m
Merged PRs (30d)
4

Description

I recently upgraded a bunch of things (including ember) in one of my apps. Now I've fixed most of the issues I'm left with one which I can't seem to track down.

In my code I have sections like

```javascript
import jQuery from 'jquery';

jQuery.ajax({
url: url,
method: 'HEAD'
}).then(function(data,textStatus,response) {
let details = {
name: file,
url: url,
size: response.getResponseHeader('Content-Length'),
modified: moment.utc(response.getResponseHeader('Last-Modified'))
};
let fileDetails = route.fileDetails;
fileDetails[file] = details;
route.set("fileDetails",fileDetails);
controller.set("files",Object.keys(fileDetails).map( key => fileDetails[key] ));
});

```

Which when I run it under ember serve is getting transpiled to:

```javascript
Ember.$.ajax({
url: url,
method: 'HEAD'
}).then(function (data, textStatus, response) {
var details = {
name: file,
url: url,
size: response.getResponseHeader('Content-Length'),
modified: _moment.default.utc(response.getResponseHeader('Last-Modified'))
};
var fileDetails = route.fileDetails;
fileDetails[file] = details;
route.set("fileDetails", fileDetails);
controller.set("files", Object.keys(fileDetails).map(function (key) {
return fileDetails[key];
}));
});
```

I've tried looking for addons or plugins which could be causing this and I've tried rebuilding node_modules and each time the deprecation warning remains. I asked around on the ember discord and noone seemed to have any ideas. I spent several hours grepping through my node_modules directory hoping to find something that referenced jQuery and set it up to be transpiled but at the moment I'm basically looking for a needle in a haystack. Is there any way I can find out exactly where/why this is being transpiled?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.