mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:55:00 +08:00
4d83150855
It turns out that the assertion made in https://github.com/matrix-org/matrix-react-sdk/pull/1213 about `async` functions returning bluebird promises was only correct when babel used an inline version of the `asyncToGenerator` helper; in react-sdk we are using `babel-transform-runtime` which means that we use a separate `babel-runtime/helpers/asyncToGenerator`, which returns a native (or core-js) Promise. This meant that we were still in the situation where some methods returned native Promises, and some bluebird ones, which is exactly the situation I wanted to resolve by switching to bluebird in the first place: in short, unless/until we get rid of all code which assumes Promises have a `done` method etc, we need to make sure that everything returns a bluebird promise. (Aside: there was debate over whether in the long term we should be trying to wean ourselves off bluebird promises by assuming all promises are native. The conclusion was that the complexity hit involved in doing so outweighed any benefit of a potential future migration away from bluebird).
5 lines
198 B
Plaintext
5 lines
198 B
Plaintext
{
|
|
"presets": ["react", "es2015", "es2016"],
|
|
"plugins": ["transform-class-properties", "transform-object-rest-spread", "transform-async-to-bluebird", "transform-runtime", "add-module-exports"]
|
|
}
|