This is a pretty large changeset, so I'll annotate here at the top after an explanation. During some integration testing at LinkedIn, we discovered that trying to "shim" a global variable using an AMD wrapper would be a clean way to support script tags (mixed environment) while beginning to roll out larger AMD support in the site. We discovered that when shimmed, globals were coming back as the empty object {} and debugging led to severe problems in TreeDownloader.
This refactor
Replaces TreeDownloader with TreeRunner (a new file to signal the internal API has changed)
Operates on the module object by reference whenever possible
Removes unused library code and dead code paths from these refactors
And here's the file by file details (significant changes):
LICENSE Removed no longer used library references, added new references
examples/ A new example that shows how to shim global variables AMD style
gruntfile.js Removed no longer used library & file references, added new files & references
src/analyzer.js No longer checks for empty files
src/communicator.js Sets the contents to a new Error object on 404 errors (instead of flagging)
src/executor.js Operates on references to the module instead of setting/unsetting properties all the time. New stack trace analysis powered by stacktrace.js (more performant for what we wanted)
src/treedownloader.js Removed, replaced with treerunner.js
src/treerunner.js Refactor of treedownloader.js designed to operate directly on the tree and manage the dependency execution and resolution process (formerly was in RequireContext
includes/common.js Reduced lines of code by using references created by Executor
This is a pretty large changeset, so I'll annotate here at the top after an explanation. During some integration testing at LinkedIn, we discovered that trying to "shim" a global variable using an AMD wrapper would be a clean way to support script tags (mixed environment) while beginning to roll out larger AMD support in the site. We discovered that when shimmed, globals were coming back as the empty object
{}
and debugging led to severe problems inTreeDownloader
.This refactor
TreeDownloader
withTreeRunner
(a new file to signal the internal API has changed)module
object by reference whenever possibleAnd here's the file by file details (significant changes):
treerunner.js
treedownloader.js
designed to operate directly on the tree and manage the dependency execution and resolution process (formerly was inRequireContext