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

Aliasing not working if you require a class that refers to the interface #1268

Closed
thanhc opened this issue Mar 6, 2015 · 4 comments
Closed
Assignees
Labels
Milestone

Comments

@thanhc
Copy link
Contributor

thanhc commented Mar 6, 2015

A good example of this is if you create the following alias:
<alias name="br.locale-switcher" class="br.services.locale.BRLocaleLoadingSwitcher"/>

And if you try and use this alias then it will continue to use the original class BRLocaleForwardingSwitcher.
In the BRLocaleLoadingSwitcher we require the following:
var LocaleSwitcher = require('br/services/LocaleSwitcher');
if you remove this line then the alias will work, otherwise it will use the old one.

@thanhc thanhc added the bug label Mar 6, 2015
@thanhc thanhc added this to the 1.0 RC1 milestone Mar 6, 2015
@andy-berry-dev
Copy link
Member

@thanhc Is this specific to that Alias? The locale switching page code in the model doesn't get the model to handle the request but instead uses the bundleset itself which could cause a slightly different behaviour. This may be fixed in the review-plugin-apis-1085 branch since I've refactored that part of the code.

@dchambers
Copy link
Contributor

I'm not sure if the changes you are working on will help fix this @andyberry88, but maybe. The problem seems to be that if the chosen concrete class refers to the alias interface, then it can't be used. Since most classes will do this, I can only assume this only happens for CommonJs classes, so we haven't started seeing it yet.

I'll assign to myself, but not start looking at until you've merged your changes.

@dchambers dchambers self-assigned this Mar 9, 2015
andy-berry-dev pushed a commit that referenced this issue Mar 17, 2015
… wrapper so extend Aspect to fix the test
@andy-berry-dev
Copy link
Member

This is fixed in ed07d29 which will be merged as part of #1277

@ccpetercc
Copy link
Contributor

Tested, works fine on #1277

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

No branches or pull requests

4 participants