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
Rollup 0.59.x removes important code from ReactDOM bundle #2199
Comments
Didn't think about downgrading rollup since it was my first time trying out React 16.3... 😅 Seems it has something to do with treeshaking since you didn't change the version of Thank you @gaearon ! |
Thanks a lot for posting this issue + the repro. It took me a while to figure out but it seems this is actually a rather old issue that has come to the surface with the enhanced conditional tracking. Basically it appears that This is a minimal repro which is completely removed: let x = false;
for (x in {key: true}) {
if (x) console.log('removed');
} I think it should not be too difficult to fix, will take a look soon. |
Fixed in Rollup v0.59.2, please check it out! |
Hi, the reproduction demo works fine with last rollup version, thanks! |
Reproducing case:
npm install
npm start
build.dev.js
and scroll todiffProperties$1
function definitionnode_modules/react-dom/cjs/react-dom.development.js
for comparison and scroll todiffProperties$1
function definitionYou’ll see that the original function definition contains a
for
loop likeHowever the
diffProperties$1
definition in the Rollup’dbundle.dev.js
is completely missing the (essential) logic under those conditions as well as conditions themselves, except for the last one. This produces code that behaves differently. Itsfor
loop only contains theregistrationNameModules.hasOwnProperty(propKey)
check and not the preceding ones.I verified that downgrading to 0.58.x fixes it.
The text was updated successfully, but these errors were encountered: