Skip to content

Added error callBack to jsLoader call#268

Closed
vytautas-pranskunas- wants to merge 1 commit intoocombe:masterfrom
vytautas-pranskunas-:master
Closed

Added error callBack to jsLoader call#268
vytautas-pranskunas- wants to merge 1 commit intoocombe:masterfrom
vytautas-pranskunas-:master

Conversation

@vytautas-pranskunas-
Copy link

I fixed a bug related to requirejs loading (line: 1025 and 1196):
Since most of the time (especially if using TypeScript with AMD) define should return something e.g. 'export class Test' turns to define(...function(){ return Test;}) the promise was always rejected. The promise should resolve or be rejected according to child result (requirejs).

Is there any reason to have single call back function rather than function for each case? It also mixes responsibilities, which is anti-pattern.

@ocombe
Copy link
Owner

ocombe commented Nov 18, 2015

Hmm not sure if there's a reason, I don't use requirejs, this was changed in a PR, @tony-vu what's your opinion on this?

@tokafew420
Copy link
Contributor

Please close this PR.

  1. Note that the change was made to the dist file instead of the actual source.
  2. As for the single callback, that is to keep the signature of jsLoader consistent. Else the loader core would have to know if you were using requirejs or not and call jsLoader accordingly.
  3. The bug you have is likely due to my PR Wrapper for using requireJS as JSLoader #260 which is fixed in PR Fix success callback for requirejs wrapper Fixes #260 #264

For future PR please ensure changes are made to the source and also don't commit formatting changes as they make the actual changes harder to track.

@vytautas-pranskunas-
Copy link
Author

I am not sure if it is fixed because i was fixing it on the latest file version

@tokafew420
Copy link
Contributor

This is because PR #264 has not been merged

@vytautas-pranskunas-
Copy link
Author

Ok, so i will close it after making sure issue is fixed. When do you plan to merge your fix?

@vytautas-pranskunas-
Copy link
Author

When are you going to merge #264? because i need minified version of that since i have troubles when minifieing with uglify.js. For some reason ocLazyLoad.requirejs.js code starts to act like normal ocLazyLoad and fails to use requirejs paths when bundled and minified. If i copy normal version on top everything becomes ok.

@ocombe
Copy link
Owner

ocombe commented Nov 23, 2015

I'll try to check it tonight or tomorrow night

@ocombe ocombe closed this Nov 24, 2015
@ocombe
Copy link
Owner

ocombe commented Nov 24, 2015

I merged #264

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.

3 participants