Coding style for AMD modules

Stef Walter stefw at redhat.com
Wed May 20 19:56:32 UTC 2015


I've added a bit to the Cockpit Coding Guidelines about AMD modules:

https://github.com/cockpit-project/cockpit/wiki/Cockpit-Coding-Guidelines

Some of us were discussing AMD modules [1] with global side-effects.
Normally this would be frowned on, but in real life this comes up all
the time.

We decided that because of our component system, we would allow
side-effects, with the caveat:

"Modules that return API (as above) should avoid global side-effects.
And modules that have global side-effects should not return or define API."

Hope that makes sense,

Stef

[1] https://github.com/amdjs/amdjs-api/wiki/AMD
http://dojotoolkit.org/documentation/tutorials/1.10/modules/index.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <https://lists.fedorahosted.org/pipermail/cockpit-devel/attachments/20150520/750a5720/attachment.sig>


More information about the cockpit-devel mailing list