Closed Rycochet closed 7 years ago
Thanks for bringing this up. We'll add it to our todos
A colleague just brought this ticket to my attention.
I recently forked your code and created an "AMD" branch and refactored the whole code into requirejs modules to use it in the future in our code.
It also unveiled some design issues and globally leaking variables which I largely fixed. This could certainly also be made compatible with non-requirejs environtments, since the modules can (and are) compiled into a single minified file: https://github.com/srad/xAPIWrapper/tree/amd
@srad Brilliant timing lol - can't be a straight merge though since you've taken out various required bit of the Gruntfile/package.json (even though the doxstrap usage is broken on Windows) - hopefully most can be incorporated :-)
I've converted it over to a Node module, I still need to develop so comprehensive tests before merging it back into this repo.
You can install it using npm install https://github.com/zapur1/xAPIWrapper.git
It will also attach to the window if not imported using Node JS, instead including as <script>
directly from source
@zapur1 : Have there been any updates to a completed node module with tests?
Kind of... I ended up having to rewrite most of the structure to mean it can work in both a browser and Node JS environment alike. In the end I just used https://github.com/RusticiSoftware/TinCanJS as it works right out of the box
On Thu, 9 Mar 2017, 5:57 AM Lou Wolford notifications@github.com wrote:
@zapur1 https://github.com/zapur1 : Have there been any updates to a completed node module with tests?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/adlnet/xAPIWrapper/issues/60#issuecomment-285133634, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzk9qrrn0JyLuXXhA71W0usfnS1HxqSks5rjvoXgaJpZM4HD6lO .
Rather than forcing the namespace this would let it work properly with modern good practices - there's various patterns, but basically if there's no
define
function defined then nothing changes, otherwise it should effectively havedefine(function(){return ADL;})
- but possibly without using the global namespace at all.