Feature Request: Ability to opt out of liveBinding with exports of const values #50214
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Suggestion
π Search Terms
liveBinding Object defineProperty allocation export live view
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
opt out of liveBinding added in #35967 for const values
π Motivating Example
Doing some profiling of an app I'm creating and seeing a lot of calls to the get function of Object defineProperty that was added as part of #35967. These might be optimized away when not using
--trace-allocation-stack-interval
but it would be great to not have to rely on the optimizer to do the right thing here.I originally wanted to add a flag that would make sure that
TypeScript/src/compiler/transformers/module/module.ts
Line 1147 in 1e65b33
If the exported value is const then you don't need a "live view" of it. But it's not clear if there is a good way to communicate const-ness at the time the export expression is created.
π» Use Cases
I think I can work around this by saving the value of the re-export to a variable local to the the current script/module and using that. But that seems cumbersome.
The text was updated successfully, but these errors were encountered: