-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Labels
Description
Supporting tree-shaking of:
var p = {
a: 'a',
b: 'b'
};
externalFn(p.a);
into:;
var p = {
a: 'a'
};
externalFn(p.a);
So basically, knowing that the object itself is not exposed and then being able to remove properties known not to be used at all.
Ideally to extend this into cases like:
var p = {};
p.a = 'a';
p.b = 'b';
externalFn(p.a);
as well, also supporting the same sort of thing.
The same principles can likely apply to class shape too, although there's much more exposure for classes potentially to track, likely with a more costly analysis and higher opt-out rate so worth weighing that up separately perhaps.
sidoruk-sv, thisismydesign, SalvatorePreviti, jake-knerr, StarpTech and 29 more