FormidableLabs / react-live

A flexible playground for live editing React components
https://commerce.nearform.com/open-source/react-live/
MIT License
4.31k stars 241 forks source link

react-live 1.12.0 breaks my app #102

Closed alansouzati closed 5 years ago

alansouzati commented 6 years ago

By following the semantic versioning, I was under the expectation that updating from 1.11.0 would not break my app, but it did.

I was using the context to access the error inside live and this has been removed. The built in LiveError does not work for me since I want to control how to render it.

Now you are using the new react context API, which is great but you are not exposing this context for the outside world, making it impossible to access the error and customize it.

I would like to propose that you at least export LiveContext in your index.js. I'm going to send a PR for that just in case.

In the meantime, I will downgrade to 1.11.0 and pin to it.

On a related note, I'm facing problems with buble and acorn. They are configuring acorn as an external, and this is also breaking my react-live integration. Buble seems to be relying on acorn version 6, but webpack and other libraries are still using version 5. Since it is being configured as an external, it will not use the built in one. I sent a PR for them too:

https://github.com/Rich-Harris/buble/pull/160

lwxyfer commented 6 years ago

The same question, hoping a quick fix.

onigoetz commented 6 years ago

I have the same issue with acorn getting updated to version 6

kitten commented 6 years ago

This was not a public API and won't be fixed; The context was using React's old context API and has been switched over to the new one.

Arguably this is not a breaking change as the context was meant to be accessed via the withLive hoc: https://github.com/FormidableLabs/react-live/blob/master/src/hoc/withLive.js

I would like to propose that you at least export LiveContext in your index.js. I'm going to send a PR for that just in case.

That'd make sense :+1: Cheers!

alansouzati commented 6 years ago

I understand the rationale behind the release now. Sorry, I did not realize that your context was not a public API.

Let me work on the PR for the LiveContext