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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable buble transpilation #252

Closed
maksnester opened this issue May 20, 2021 · 2 comments 路 Fixed by #260
Closed

Option to disable buble transpilation #252

maksnester opened this issue May 20, 2021 · 2 comments 路 Fixed by #260

Comments

@maksnester
Copy link
Contributor

Hi and thanks for this library it's great 馃憢

I have a library that built with es2019 target and has some es6 classes exported. When I add those classes to custom scope and then write anything in LiveEditor that extends those es6 classes, I see an error, because the code written by a user is transpiled to es5 and the code from my library isn't.

// library export that added to the editor scope
export class Foo {}
// then a user writes this in the LiveEditor
class Bar extends Foo {
  constructor(args) {
    super(args);
  }
}

And that fails with this error

Uncaught TypeError: Class constructor Foo cannot be invoked without 'new'

Because under the hood after transpilation by buble it looks like this:

function Bar(args) {
  Foo.call(this, args)

So my question is whether it's possible to disable transpilation completely or set target: es6 for it?

@maksnester
Copy link
Contributor Author

@jpdriver hi, is this repo dead? I think I could create a PR for this issue but I see 27 other active PRs and no activity in the issues, so... just not sure whether it's better to do a fork right away 馃檭

@jpdriver
Copy link
Contributor

hey @maksnester -- this repo isn't dead, but just we haven't had a ton of time leftover to look at it recently..

i don't believe it's currently possible to disable transpilation, but if this is something you'd like to add please feel free to open a PR for it!

maksnester added a commit to maksnester/react-live that referenced this issue Jun 22, 2021
maksnester added a commit to maksnester/react-live that referenced this issue Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants