Hey!
I'm getting the error "Error: Unexpected token" with this code:
class Base {}
export default () => {
return class extends Base {};
};
If I change it to:
class Base {}
export default () => {
class R extends Base {}
return R;
};
...it then works. It seems the class extends run together is what's causing the problem. My intuition tells me that maybe this issue is down the tooling stack in Bubl茅 or Nodent, possibly, but I didn't find any errors when running through them separately. I didn't have time to check Rollup or the Uglify plugin for it yet due to time constraints.
I could have missed something somewhere, though. Any help or guidance on this would be appreciated.
Yup, this is a Buble bug. I think we are going to have to switch to babel.
Yup. One more thing for switching to Babel is that i has better support through "babel-preset-env" than the Buble's targets.
How hard would this be? It seems like it can be non-breaking if you take what Bubl茅 supports and compile that to the default config. Something very appealing to me here, is the ability to specify my own .baberc.
I don't believe it would be hard. Just replace it and use babel-preset-env, as about the async/await - use rollup-plugin-async which uses async-to-gen which seems to gives a lot smaller output.
Buble is awesome, because does not touch the input pretty much and saves it as much as it was. Aways love that about it, but the "targets" there are pretty outdated - latest possible versions of browsers to define are pretty old versions.
I wouldn't ship async-to-gen by default. We could do nodent or fast-async though.
Can i ask why? When i compared the two, it seemed that it gives best output and still uses raw promises. Probably performance or what? Hm.
async-to-gen produces generator functions, which only have ~85% browser support
Oh yea.. :laughing: Why i forgot that it produces promises :D
Also getting this with:
const classes = cc([
'c-header',
{
[`c-header--theme-${theme}`]: theme
}
])
On the array as key here.
Would this be the same Buble bug?
Certainly not the very same, but might be something similar.
Should be fixed now with microbundle@next