Split static and dynamic www feature flags #11471
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes it so that www feature flags only include things that are actually behind a GK.
In theory this would reduce the bundle size of FB bundles. In practice, it currently doesn't because even though we know more of them statically, we still end up with code like
in production bundles. This is because we use Uglify for FB builds which is not as smart as GCC.
I have, however, verified that if we were to use GCC, it would strip them out (whereas it can’t possibly strip them out in the current version). So this seems incrementally better.
It might also be the case that the www minifer already handles conditions like this. In that case, even though it doesn’t show up as a win here, it might actually be in www after compilation.