Closed kinow closed 4 years ago
For the codebase:
For the distribution:
I think currently babel is downgrading our code to some ancient standard, I think we can safely up the output to ES6.
So long as babel can handle it we can do whatever.
+1 after using the duo webpack+babel for a while, it looks pretty stable, and had so far no issues producing ES6 compatible output code.
Closing :tada:
Hi,
We are using ES2015 (I think, though I may have slipped a
Promise.finally
somewhere, which is ES2018 I guess?) in the project.With ES2015, we have
Promise
s, and our code should look something like:Every time we have an asynchronous
Promise
, we can call it and use.then()
to resolve the code once the promise has been fulfilled.ES2017 added
async
andawait
for syntactical sugar in the language. The same code would then look like:I am asking because @MartinRyan used this new syntax in the
Graph.vue
component, and I had added a post-it to check whether we should usePromise
s there, or if others would prefer to up the version we are supporting in Cylc UI.Here's the browser compatibility for async functions:
Though Babel is able to transpile it to ES5/6/etc. But if we decide that
async
/await
is the way to go, we can slowly start to update the code base... I'm a bit slow to pick up features... wrote Java5 code for a long time, and now I am still writing Java 8 code, even though 9/10/11 have new features :grimacing:Thoughts?