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

Imports conflict with local variables #14

Closed
rlivsey opened this issue Mar 3, 2015 · 4 comments
Closed

Imports conflict with local variables #14

rlivsey opened this issue Mar 3, 2015 · 4 comments

Comments

@rlivsey
Copy link

rlivsey commented Mar 3, 2015

I'm using Ember CLI, with ember-cli-babel which in turn uses this addon. This may want to be opened as an issue in babel itself?

I have the following in my app:

import {
  updateMeeting
} from 'minutebase/use-cases/meeting';

export function setupAgenda(meeting) {
  return updateMeeting(meeting);
};

Which appears to be being transpiled to:

define('minutebase/use-cases/agenda', ['exports', 'ember', 'minutebase/use-cases/meeting'], function (exports, Ember, meeting) {
  'use strict';

  exports.setupAgenda = setupAgenda;

  function setupAgenda(meeting) {
    return meeting.updateMeeting(meeting);
  }
});

Notice that there's an imported meeting and a local meeting which tramples on it so meeting.updateMeeting is undefined.

@nightire
Copy link
Member

nightire commented Mar 4, 2015

Interesting edge case, I believe this should be solved (hopefully) by Babel itself, as a plugin, broccoli-babel-tanspiler doesn't handle name mapping, it just follow the way Babel does.

@sebmck what's your opinion on this one?

@sebmck
Copy link

sebmck commented Mar 4, 2015

ember-cli doesn't use Babel for modules. Babel modules are blacklisted and
esperanto is used.

On Wednesday, 4 March 2015, Albert Yu notifications@github.com wrote:

Interesting edge case, I believe this should be solved (hopefully) by
Babel itself, as a plugin, broccoli-babel-tanspiler doesn't handle naming
mapping, it just follow the way Babel does.

@sebmck https://github.com/sebmck what's your opinion on this one?

Reply to this email directly or view it on GitHub
#14 (comment)
.

Sebastian McKenzie

@rlivsey
Copy link
Author

rlivsey commented Mar 4, 2015

@sebmck that makes sense, I was wondering why the output was different to what I saw on the babel repl.

Probably worth closing this and I'll re-open on ember-cli.

@rlivsey
Copy link
Author

rlivsey commented Mar 4, 2015

For anyone following, I think this is due to esperantojs/esperanto#116

@rlivsey rlivsey closed this as completed Mar 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants