Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JS: enable circular imports by exporting object (not function)
Resolves kaitai-io/kaitai_struct#1074 This change breaks backward compatibility with 0.10 and older, but allows for circular imports and out-of-order module loading in a "browser globals" context (the latter is relevant in the Web IDE, as explained at kaitai-io/kaitai_struct#1074). In short, it does this by switching from the UMD envelope [returnExports.js](https://github.com/umdjs/umd/blob/36fd113/templates/returnExports.js#L17-L37) to modified [commonjsStrict.js](https://github.com/umdjs/umd/blob/36fd113/templates/commonjsStrict.js#L19-L36). The BC break is that until now the generated modules exported the constructor function directly, whereas now they export the object containing the constructor function under the only object key that matches the format module name. The same behavior is expected from imported opaque types and custom processors as well.
- Loading branch information