webpack icon indicating copy to clipboard operation
webpack copied to clipboard

feat: Optimize live bindings in export declarations (#18494)

Open Vansh5632 opened this issue 11 months ago • 7 comments

Optimized live bindings processing to reduce overhead

  • Improved performance by optimizing the handling of live bindings.
  • Ensured correct hook calls and traversal logic for better consistency.

Fixes #18494

What kind of change does this PR introduce?

  • 🛠️ Performance Optimization

Did you add tests for your changes?

  • ✅ Yes, relevant test cases have been added to ensure correctness.

Does this PR introduce a breaking change?

  • ⚠️ No, this change does not introduce any breaking changes.

What needs to be documented once your changes are merged?

  • 📖 Update the documentation on how live bindings are processed and optimized.
  • ✅ Ensure any relevant API or behavior changes are reflected in the docs.

Vansh5632 avatar Feb 12 '25 14:02 Vansh5632

@bworline do you want to check over this also?

TheLarkInn avatar Feb 12 '25 20:02 TheLarkInn

@Vansh5632 please review the test failures and snapshot failures.

TheLarkInn avatar Feb 12 '25 20:02 TheLarkInn

@TheLarkInn i am not able to understand the reason behind basic test failing can you give me little bit guidance it will be really grateful

Vansh5632 avatar Feb 19 '25 17:02 Vansh5632

There are two problems:

  • Wrong types, you can run type lint and fix them
  • Based on our tests you missed some cases, you can run failed cases locally and looks why it was failed

alexander-akait avatar Feb 27 '25 15:02 alexander-akait

Super excited about this change and the perf benefits. However, it's difficult to the see the results of this change. Can you show a before and after of webpack generated code, illustrating where the optimization takes place for exports that are not live and those that remain live because of a reference?

bworline avatar May 30 '25 05:05 bworline

@TheLarkInn can you re-open the underlying issue? It got auto-closed.

bworline avatar May 30 '25 05:05 bworline

@bworline Done

alexander-akait avatar May 30 '25 13:05 alexander-akait