Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will async functions with await statements be supported? #82

Closed
trufa opened this issue May 27, 2017 · 5 comments
Closed

Will async functions with await statements be supported? #82

trufa opened this issue May 27, 2017 · 5 comments
Assignees
Milestone

Comments

@trufa
Copy link

trufa commented May 27, 2017

I am interested in using async/await.

Currently it's not supported, how do you feel about adding certain babel plugins like this one?

Would this be a problem of where to draw the line of what plugins should be included?

I forked the repo and started to attempt to add the plugin but had a couple of issues, if there's interest I'll look further into it since I should be pretty close.

Thanks in advance!

@danielcherubini
Copy link
Collaborator

I have no configuration for babel. Right now it just transforms from 2015 to vanilla.

I use babel in the project to transform any code. Since async await

But what I'm going to do is change it to use babel preset env. I'll add details on this later.

@trufa
Copy link
Author

trufa commented May 28, 2017

@danmademe Can't wait! :)

Let me know if I can help, It'd be really useful for my current project so I'd be more than happy to collaborate!

Thanks!!

@danielcherubini
Copy link
Collaborator

well it isn't that hard actually and yes you're free to open a pull request.. i'll point you in the right direction..

https://github.com/express-vue/express-vue/blob/master/lib/parser/index.js#L52

That's where the babel setup is..

https://github.com/babel/babel-preset-env#usage

Change to using this.. and if you can find a way to pass in config from express-vue setup that would be amazing.

app.set('vue', {
    componentsDir: __dirname + '/components',
    defaultLayout: 'layout',
    babel: {
        "presets": ["env"]
    }
});

see how i added babel section there... try passing that through, you can add it into the defaults model, and add a fallback..

https://github.com/express-vue/express-vue/blob/master/lib/models/defaults.js

Thanks

@danielcherubini
Copy link
Collaborator

if you can get it into the app.set, then it gives tremendous boost to flexibility..

@danielcherubini
Copy link
Collaborator

This has changed since v4 .. but will add it into v4.1

@danielcherubini danielcherubini self-assigned this Sep 4, 2017
@danielcherubini danielcherubini added this to the v4.1 milestone Sep 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants