Skip to content

React cannot be compiled with latest Google Closure Compiler #7551

@jochenberger

Description

@jochenberger

When trying to compile React 15.3.1 with the latest Closure Compiler, the following output is produced:

react.js:13694: WARNING - Misplaced @abstract annotation. only functions or non-static methods can be abstract
  getTransactionWrappers: function () {
  ^

react.js:14161: WARNING - Misplaced @abstract annotation. only functions or non-static methods can be abstract
  getTransactionWrappers: function () {
  ^

react.js:16952: WARNING - Misplaced @abstract annotation. only functions or non-static methods can be abstract
  getTransactionWrappers: null,
  ^

react.js:4782: ERROR - @nosideeffects may only appear in externs files.
  render: SpecPolicy.DEFINE_ONCE,
  ^

1 error(s), 3 warning(s)

The last one is an errors, the others are warnings.
To reproduce:

$> wget https://dl.google.com/closure-compiler/compiler-latest.zip
$> unzip compiler-latest.zip
$> wget https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react.js
$> java -jar closure-compiler-*.jar --js react.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions