facebook / prop-types

Runtime type checking for React props and similar objects
MIT License
4.48k stars 356 forks source link

template literal in factoryWithTypeCheckers breaks es5 compatibility #255

Closed pfrend closed 5 years ago

pfrend commented 5 years ago

Problem: Build issues with webpack when using older uglify-js that can't read es6 input

Version: 15.7

Code: https://github.com/facebook/prop-types/blob/master/factoryWithTypeCheckers.js#L310

Expected: Only es5 code exported

Example output of error:

ERROR in common.js from UglifyJs
SyntaxError: Unexpected character '`' [./~/prop-types/factoryWithTypeCheckers.js:310,0]

Note: First issue in here - sorry if I'm missing some issue filing rules. Let me know if you need more info. Thanks!

ljharb commented 5 years ago

Thanks, I’ll have a fix for this published shortly.

ljharb commented 5 years ago

v15.7.1 published. Sorry for the inconvenience!

pfrend commented 5 years ago

awesome, thanks for the quick response time, much appreciated!