matrix-js-sdk
0fb0c1b7 - Use babel transform-runtime instead of regenerator-runtime (#505)

Commit
7 years ago
Use babel transform-runtime instead of regenerator-runtime (#505) Attempting to use the regnerator-runtime ourselves led to a fight with riot-web about whether `global.regeneratorRuntime` could be defined. By using the transform-runtime plugin, references to `global.regeneratorRuntime` which are created by the transform-regenerator plugin are turned into references to an imported module, which works much better. (The full tragic tale went as follows: - riot-web uses transform-runtime, which adds an import of `regenerator-runtime` to index.js - `regenerator-runtime`: - loads `regenerator-runtime/runtime`, which defines `global.regeneratorRuntime` - then clears the global property and returns the regeneratorRuntime object as the exported value from the module - later, the js-sdk tried to import `regenerator-runtime/runtime`, which then did nothing because the module had already been loaded once. For added fun, this only manifested itself when riot-web and js-sdk shared an instance of the `regenerator-runtime` package, which happens on proper builds, but not a normal development setup.)
Author
Parents
  • File
    .babelrc
  • File
    package.json
  • src
    • File
      matrix.js