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

Fix AMD loading issues for Vendor and Helper Scripts #65

Merged
merged 1 commit into from
Mar 9, 2015
Merged

Fix AMD loading issues for Vendor and Helper Scripts #65

merged 1 commit into from
Mar 9, 2015

Conversation

larsonjj
Copy link
Contributor

Moved vendor and helper scripts above require.js script.

This helps alleviate issues where loading libraries like Backbone.js causes Mismatched anonymous define() module errors.

Moved vendor and helper scripts above require.js script
@moustachedelait
Copy link

I'd like this too

@its-danny
Copy link

Since this is fairly old and hasn't happened yet, I went ahead and made a fork.

https://github.com/dannytatom/grunt-template-jasmine-requirejs

@lukeapage
Copy link
Contributor

@cloudchen Please could you merge or give rights to someone else (@dannytatom) to take over this on npm?

cloudchen added a commit that referenced this pull request Mar 9, 2015
Fix AMD loading issues for Vendor and Helper Scripts
@cloudchen cloudchen merged commit 2cb667d into cloudchen:master Mar 9, 2015
@cloudchen
Copy link
Owner

Sorry for the late responding. v0.2.1 is just released. Have a try and let me know if it not goes well.

@lostthetrail
Copy link

@cloudchen I am not sure if you are trying to adhere to semvar, but if so, this is a major release change. It is definitely not backwards compatible.

EDIT: Ah, you are on 0 major version. Scrap the above.

We are using the pre-PR functionality to declare mock modules (amd).

Likely this change should have created a new functionality, which would be above the require and have left the current functionality alone.

Can we get a revert?

@cloudchen
Copy link
Owner

It was my mistake. This PR shouldn't be merged and released.
I figured out compromise to this issue that load vendor before require.js itself and then jasmine/boot and helpers after require.js file.
Why do I think it's compromise? Becuase script contains anonymous define() shouldn't be loaded in page with require.js enabled, no matter it's loaded before or after require.js.
As long as you get started to use require.js, everything should be conveyed by require as AMD module or shim.
This is the rule that we have to follow in AMD world, simply loading script with anonymous define() before require.js isn't good practice. Everytime you meet this kind of issue, try to figure out in just mentioned method rather than loading it before require.js

cloudchen added a commit that referenced this pull request Mar 11, 2015
@cloudchen
Copy link
Owner

Released v0.2.2 to address it.

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

Successfully merging this pull request may close these issues.

6 participants