Commit graph

18 commits

Author SHA1 Message Date
Travis Ralston
1cd9c4ff11 Move babel config out to its own file
For reasons described within this diff.
2020-01-08 16:01:28 -07:00
Travis Ralston
1b41dc3291 Make the webpack config work for us
This moves the babel and postcss configs into the webpack config for ease of maintenance (and because we need variations of them). The typescript config is left outside the webpack config for IDEs to pick it up.
2019-12-23 19:51:01 -07:00
Michael Telatynski
385ad5f9ce Don't transform async at all, all browsers we care about support it 2019-11-05 10:43:05 +00:00
Michael Telatynski
10e1d9093e transform-async-to-promises: get rid of bluebird 2019-11-04 12:46:28 +00:00
Travis Ralston
feb62793d2 Revert "Upgrade to babel@7 and support TypeScript"
This reverts commit 7b89893645.
2019-08-08 13:30:33 -06:00
Travis Ralston
7b89893645 Upgrade to babel@7 and support TypeScript
See https://github.com/matrix-org/matrix-react-sdk/pull/3292

Like react-sdk#3292, this fixes the couple source files which mix imports and module exports (they can't be mixed anymore).
2019-08-08 13:30:11 -06:00
David Baker
d6d4d95b20 Fix .babelrc to be the same as react-sdk
it was missing some plugins which firstly means we're using inconsistent
js between projects, but also causes builds to fail due to our unique
build system.
2019-04-30 12:42:04 +01:00
Richard van der Hoff
3ec4b25793 Transform async functions to bluebird promises
It turns out that the assertion made in
https://github.com/vector-im/riot-web/pull/4565 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).
2017-07-13 17:34:47 +01:00
David Baker
e02e0219a7 Add plugin that makes babel 6 not break everything 2016-10-17 16:28:14 +01:00
David Baker
d04201d069 Replace stage & es2017 with specific plugins
Also sort out regenerator runtime as it turns out importing
babel-polyfill in your code is insufficient if using webpack
because it's imported too late, so use both that and
regenerator-runtime. Sigh.
2016-10-17 16:28:14 +01:00
David Baker
82de2ca4ec Remove transform-runtime
We use instance methods (or at least, draft.js does) so we need
babel-polyfill instead.
2016-10-17 16:28:14 +01:00
David Baker
8e0b61ca35 Reminder to restore links + stage2, not stage 0 2016-10-17 16:28:13 +01:00
Aviral Dasgupta
d6f27add66 Upgrade to babel6 and enable some presets. 2016-10-17 16:28:13 +01:00
David Baker
ea09a25563 Revert "Switch to babel 6" 2016-10-14 18:50:22 +01:00
David Baker
40ac80a3e9 Replace stage & es2017 with specific plugins
Also sort out regenerator runtime as it turns out importing
babel-polyfill in your code is insufficient if using webpack
because it's imported too late, so use both that and
regenerator-runtime. Sigh.
2016-10-14 18:03:22 +01:00
David Baker
5f747e1a90 Remove transform-runtime
We use instance methods (or at least, draft.js does) so we need
babel-polyfill instead.
2016-10-13 10:57:10 +01:00
David Baker
5ff915476a Reminder to restore links + stage2, not stage 0 2016-10-12 18:08:52 +01:00
Aviral Dasgupta
9174b32ef1 Upgrade to babel6 and enable some presets. 2016-10-02 17:28:24 +05:30