Skip to content

Allow Raphael to be loaded as an AMD module #407

Closed
@pmcelhaney

Description

@pmcelhaney

The Asynchronous Module Definition API allows front-end JavaScript developers to write modular code, automatically load dependencies, and keep the global scope clean. Please consider making Raphael available as an AMD module. It's just a couple lines of code at the bottom of the file.

if ( typeof define === "function" && define.amd ) {
    define( function () { return window.Raphael; } );
}

Update: I've created a branch that turns the individual files (raphael.core.js, raphael.svg.js, and raphael.vml.js) into AMD modules. There's a new module at raphael.amd.js that combines all three and can be used with an AMD loader. Note that in order to use it with AMD, you'll need to get Dmitry's eve script separately. (Eve is already set up to use AMD).

If you want to load Raphael the old fashioned way, raphael.js should still work just fine (but you'll need to build it again by running the make script).

Thanks to everyone who +1d this issue. Please give this a try and send me your feedback:

#540

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions