web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
8.15k stars 484 forks source link

Refactor: use JsUnknown and downcast instead of specific type payload #4544

Closed ahabhgk closed 6 months ago

ahabhgk commented 8 months ago

JsUnknown and downcast_into:

Screenshot 2023-11-06 at 17 53 30

v.s.

specific type payload:

Screenshot 2023-11-06 at 17 56 21

Currently we are blocked by Debug derive and Deserialize derive, since JsUnknown didn't implement these trait, if we can remove rspack_testing (rust side test) in the future, we might not need to implement these trait on RawOptions

h-a-n-a commented 8 months ago

Nice idea :--)

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

ahabhgk commented 6 months ago

Implemented