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

underscore shim not working on dev branch #56

Closed
trodrigues opened this issue Feb 2, 2012 · 5 comments
Closed

underscore shim not working on dev branch #56

trodrigues opened this issue Feb 2, 2012 · 5 comments
Assignees
Milestone

Comments

@trodrigues
Copy link
Contributor

I am running the following test to check if the underscore shim solves the problems it should be solving:

  require(['curl/shim/underscore'], function() {
      console.log('loaded!');
      require(['underscore'], function(_) {
        console.log(_.template);
      });
    });

The reason why I'm checking for template is because it's the last thing to be defined on underscore (this is 1.2.2 btw).

After taking a look at the shim code and poking it for a while, it looks like when it tries to get core['_define'], it's still not defined, so it might get overwritten later. I've tried a few setTimeouts but nothing seemed to solve the issue.

@ghost ghost assigned unscriptable Feb 2, 2012
@unscriptable
Copy link
Member

Thanks Tiago! I'll set up a test case and try it out with the amdjs fork.

@unscriptable
Copy link
Member

(and then I'll make a pull request to the amdjs fork to fix it) :)

@unscriptable
Copy link
Member

I forked underscore here: https://github.com/unscriptable/underscore

This fork fixes the "early export" problem in underscore. I also submitted a pull request to the amdjs team to see what they think of it. If all goes well, I'll remove the shim altogether. :)

-- John

@trodrigues
Copy link
Contributor Author

Well yes, it sort of makes sense. If we already have an AMD enabled fork of underscore, why not make it right instead of shimming odd behaviours? I'll give it a try when I can.

@unscriptable
Copy link
Member

Looks like the amdjs fork is going to take my pull request: amdjs/underscore#1. Closing this unless it doesn't get pulled for some reason. :)

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

2 participants