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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESERVED_PROPS is optimized away by Google Closure Compiler #12368

Closed
Deraen opened this issue Mar 13, 2018 · 1 comment
Closed

RESERVED_PROPS is optimized away by Google Closure Compiler #12368

Deraen opened this issue Mar 13, 2018 · 1 comment

Comments

@Deraen
Copy link

Deraen commented Mar 13, 2018

I'm testing running React through Closure optimizations (with ClojureScript), and I've hit problem where e.g. children property gets included in output when using renderToString/staticMarkup:

<p children="foo, ,bar,,1">foo bar1</p>

(the way children value is converted to string could be due to Cljs).

This is due to Google Closure removes all the properties from the RESERVED_PROPS objects, as they aren't statically accessed.

@banga already has fix for ReactElement in #11967 / #11995:

7d50185

But React-dom server has another place with the same problem:

const RESERVED_PROPS = {
children: null,
dangerouslySetInnerHTML: null,
suppressContentEditableWarning: null,
suppressHydrationWarning: null,
};

Unfortunately looks like this isn't fixable by externs or other means by user, so it would be nice to have this fixed here.

(Mostly React already works with Closure optimizations in Cljs, but my test-suite uses renderToStaticMarkup.)

@Deraen
Copy link
Author

Deraen commented Apr 4, 2018

This was fixed by Closure-compiler release v20180319: google/closure-compiler@c13cf48

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.

1 participant