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
From the looks of it, CC's side-effect detection doesn't correctly understand the IIFE and CC decides the enclosing scope is impure. This in turn means that CC won't remove the unused code paths.
We ran into this because this is the code that swc generates for static class members. I'm trying to migrate our codebase from tsc to swc for transpilation and we noticed a bundle size increase. A lot of investigation later we eventually narrowed it down to this problem.
Input
Expected output
Actual output
closure compiler playground
From the looks of it, CC's side-effect detection doesn't correctly understand the IIFE and CC decides the enclosing scope is impure. This in turn means that CC won't remove the unused code paths.
We ran into this because this is the code that swc generates for static class members. I'm trying to migrate our codebase from
tsc
toswc
for transpilation and we noticed a bundle size increase. A lot of investigation later we eventually narrowed it down to this problem.cc @WearyMonkey
The text was updated successfully, but these errors were encountered: