jmmk / javascript-externs-generator

Generate externs for use with Google Closure Compiler
https://jmmk.github.io/javascript-externs-generator/
ISC License
135 stars 9 forks source link

React used by app conflicts with library #3

Closed domkm closed 8 years ago

domkm commented 8 years ago

Attempting to create externs for react-relay due to two reasons:

  1. Relay expects ReactDOM to be defined, not React.DOM. As a user, this is easy to fix. Just open console and type ReactDOM = React.DOM.
  2. Relay fails with Super expression must either be null or a function, not undefined. From researching this, it appears to be due to this app's old version of React (0.12.2) being incompatible with this version of Relay.

As a short-term solution, I'd suggest that React be upgraded to the most recent version to fix this conflict and likely many others, since so many libraries rely on React. As a long-term solution, I'd consider if the UI could be rewritten using just the Google Closure Library without any external dependencies.

jmmk commented 8 years ago

@DomKM I added an iframe to contain the loaded scripts so that they won't interact with libraries used in the app.

To generate an extern for react-relay, I took the following steps:

jmmk commented 8 years ago

Just realized I forgot to deploy earlier, but the new changes are now up at http://jmmk.github.io/javascript-externs-generator/