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

Strange return value for "layer" module #24

Open
mmaxwell opened this issue Apr 1, 2013 · 0 comments
Open

Strange return value for "layer" module #24

mmaxwell opened this issue Apr 1, 2013 · 0 comments
Labels

Comments

@mmaxwell
Copy link
Contributor

mmaxwell commented Apr 1, 2013

A reasonably common pattern that's been used is a layer module that just requires in other modules but doesn't actually return anything - everything happens as a side effect of requiring in the other modules. The conversion for one of these is returning a value that is the global representing the namespace of this module but that global shouldn't exist when completely converted to AMD.

dojo.provide("stx.stxonlineLoginLayerModule");

dojo.require("stx.gui.Widget");

dojo.require("dijit.form.Button");
dojo.require("dojox.form.BusyButton");
dojo.require("dijit.form.Form");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dojo.gears");
dojo.require("dojo.cookie");
dojo.require("dojox.sql");
dojo.require("stx.gui.Login");
dojo.require("stx.gui.ExtensionPrompt");
//more requires, add here

//IMPORTANT:This should be the last require 
//dojo.require("stx.app.module");

/*** end of lib.js requires **/

was converted to:

define(["stx/gui/Widget", "dijit/form/Button", "dojox/form/BusyButton", "dijit/form/Form", "dijit/form/TextBox", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/gears", "dojo/cookie", "dojox/sql", "stx/gui/Login", "stx/gui/ExtensionPrompt"], function (guiWidget, formButton, formBusyButton, formForm, formTextBox, layoutBorderContainer, layoutContentPane, gears, cookie, sql, guiLogin, guiExtensionPrompt) {
    //more requires, add here

    //IMPORTANT:This should be the last require 
    //dojo.require("stx.app.module");

    /*** end of lib.js requires **/
    return stx.stxonlineLoginLayerModule;
});

the strange part is what gets returned

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

1 participant