Re:Converting an existing Backbone.js project to Require.js
by graue on Sunday August 25, 2013 @03:37PM
(#6273361)
Offtopic: your employer MyEdu constantly spammed me throughout college with emails pretending to be from a university affiliate, when you had just slurped everyone's email from the public contact database. The intent was clearly to deceive and misrepresent the nature of the email. Shame on you for working for a spammy and exploitative business.
Re:Converting an existing Backbone.js project to Require.js
by hippich on Sunday August 25, 2013 @06:02PM
(#6273910)
I am sorry to hear that. Could you please email details to [email protected] so we could figure out what was going on and possible make it right?
Also as a bonus, when you use r.js optimizer, which will concatenate your .js file into one giant file, it automatically resolve dependencies and rewrite header for you.
Also minor gotcha I had to deal with - since requirejs literally parse JS code for any require("..") calls, you can not put module name into variable and do require(variable_name) unless this code already loaded in the current context. So try always put actual name into require("...") call.
disclaimer: working on quite large require.js powered app - https://www.myedu.com/ - not entire app is converted into require.js, but you can already checkout My Jobs page to get an idea of what is possible - e.g. async loading of various submodules when needed depending on current route.