Skip to content

Option to have shorter variable names #6

@jakub-g

Description

@jakub-g

Right now exported variables have pretty long names, like this:

 var modulesCoreUtilsDataManager = require("modules/core/utils/DataManager");

This was a good design decision to minimize the risk of variable names clashes.

It would be interesting though to have an option to support shorter variable names, like this:

var DataManager = require("modules/core/utils/DataManager");

though this would require quite a bit of work to minimize the risk of collisions, in cases like this:

var modulesUtilsFooBar = require("modules/utils/foo/Bar");
var modulesSthelseBar = require("modules/sthelse/Bar");

This is unlikely but may happen and with a naive approach both requires would have been saved into the same variable.

Also, the variable created by require could perhaps be redeclared later in the code as a local variable in the methods of a tplscript/controller and this could also break things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions