You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-11Lines changed: 22 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,10 @@
1
1
##UMD (Universal Module Definition)
2
2
3
-
The purpose of this repository is to formalize the work on UMDs - universal modules which can work anywhere,
4
-
be it in the client, on the server or anywhere else. This pattern typically attempts to offer compatibility with the most popular script loaders of the day (e.g RequireJS
5
-
amongst others), and in many cases uses AMD as a base, with special-casing added to handle
6
-
CommonJS compatibility.
3
+
This repository formalizes the design and implementation of the Universal Module Definition (UMD) API for JavaScript modules. These are modules which are capable of working everywhere, be it in the client, on the server or elsewhere.
7
4
8
-
To date, a number of UMD variations have been proposed, ranging from Kit-Cambridge's
9
-
[UMD](https://gist.github.com/1251221), through to [patterns](https://github.com/addyosmani/jquery-plugin-patterns/issues/1) discussed by Addy Osmani, Thomas Davis and Ryan Florence and most recently
10
-
the UMD patterns proposed by [James Burke](https://gist.github.com/1262861).
5
+
The UMD pattern typically attempts to offer compatibility with the most popular script loaders of the day (e.g RequireJS amongst others). In many cases it uses [AMD](https://github.com/amdjs/amdjs-api/wiki/AMD) as a base, with special-casing added to handle [CommonJS](http://wiki.commonjs.org/wiki/CommonJS) compatibility.
11
6
12
-
13
-
###Variations
7
+
### Variations
14
8
15
9
####Regular Module
16
10
@@ -59,6 +53,20 @@ is usable in AMD.
59
53
Similar to nodeAdapter.js, but compatible with more CommonJS runtimes, and if
60
54
you want to define a circular dependency.
61
55
56
+
### Tooling
57
+
58
+
#### Build tools
59
+
60
+
*[grunt-umd](https://github.com/alexlawrence/grunt-umd) is a [Grunt](http://gruntjs.com) task for surrounding JavaScript code with UMD boilerplate
61
+
*[grunt-urequire](https://github.com/aearly/grunt-urequire) is a Grunt wrapper for [uRequire](https://github.com/anodynos/uRequire) a conversion tool for universal JavaScript modules.
62
+
63
+
#### Testing
64
+
65
+
*[Unit testing UMD with grunt-contrib-jasmine](http://stackoverflow.com/questions/16940548/grunt-test-for-umd)
66
+
67
+
###Resources
68
+
69
+
*[Browserify and the Universal Module Definition](http://dontkry.com/posts/code/browserify-and-the-universal-module-definition.html)
62
70
63
71
###Todos
64
72
@@ -72,6 +80,9 @@ That is one of the strengths of module names, they can be mapped to different im
72
80
* Further justifications for usage
73
81
* Gotchas/custom-tweaks we're aware of, but would rather not apply to the default UMD boilerplate
74
82
75
-
###Influences
83
+
### Influences
84
+
85
+
The basic pattern for the UMD variations in this repository was derived from the approach [@kriskowal](https://github.com/kriskowal) used for the [Q promise library](https://github.com/kriskowal/q).
76
86
77
-
The basic pattern for these UMD variations was derived from the approach [@kriskowal](https://github.com/kriskowal) used for the [Q promise library](https://github.com/kriskowal/q).
87
+
Earlier UMD variations were also of influence, ranging from Kit-Cambridge's
88
+
[UMD](https://gist.github.com/1251221), through to [patterns](https://github.com/addyosmani/jquery-plugin-patterns/issues/1) discussed by Addy Osmani, Thomas Davis and Ryan Florence and most recently the UMD patterns proposed by [James Burke](https://gist.github.com/1262861).
0 commit comments