Skip to content

Inject configured dependencies into legacy factory function #270

Description

@unscriptable

At the moment, the factory function only receives the module/script name. If we inject the dependencies, as well, devs can solve more compatibility problems. For instance, some libraries don't export a global var when they detect and AMD define(). This prevents a legacy script from importing the library. Case in point: jquery.flot.time.js uses timezoneJS.

If flot.js's legacy config looked like the following, we could make this work:

"flot": {
    "requires": [ "timezoneJS" ],
    "factory": function factory (id, deps) {
        window.timezoneJS = deps[0];
        return window.$.plot;
    } 
}

Feels kinda hackish. :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions