You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Link to reproduction (IMPORTANT, read below): repl
I've started seeing non-tree-shakeable object literals appearing in my output as of 2.36.0 when the thing to which they were assigned is shaken away. But without the assignment, they're not interpreted as object literals and throw syntax errors.
Spotted this with .propTypes being applied to a React component as a default export which was being removed, but the prop types defintion was left in the output.
Seems to work fine with 2.35.1 so I guess it's related to #3919
Thanks for spotting! This was definitely an oversight on my part as this is a variation of an issue we already solved for other similar optimizations. Fix at #3921, will release once CI is clear.
I've started seeing non-tree-shakeable object literals appearing in my output as of 2.36.0 when the thing to which they were assigned is shaken away. But without the assignment, they're not interpreted as object literals and throw syntax errors.
Spotted this with
.propTypes
being applied to a React component as a default export which was being removed, but the prop types defintion was left in the output.Seems to work fine with 2.35.1 so I guess it's related to #3919
repl link
Input:
Expected Behavior
If
foo
gets tree-shaken then the non-tree-shakeable definition ofpropTypes
shouldn't produce invalid output.Actual Behavior
Output is just
{ foo: something() };
which on its own is invalid js because without the assignment it's not interpreted as an object literalThe text was updated successfully, but these errors were encountered: