next.js
296e9eb0 - Add boundary_info() to Module trait for type-independent boundary detection

Commit
60 days ago
Add boundary_info() to Module trait for type-independent boundary detection Replace `try_downcast_type` calls for NextServerComponentModule, NextServerUtilityModule, and NextDynamicEntryModule with a new `boundary_info()` method on the Module trait. This decouples boundary detection from concrete wrapper module types, preparing for their eventual removal. Changes: - Add `BoundaryInfo` struct and `OptionBoundaryInfo` to turbopack-core - Add `boundary_info()` default method to `Module` trait (returns None) - Add boundary type constants in next-core (server-component, server-utility, dynamic-entry) - Override `boundary_info()` on the three wrapper modules - Switch detection in client_references.rs, visit_client_reference.rs, dynamic_imports.rs, and module_graph.rs to use boundary_info() with validation downcasts - Add ServerUtility variant to ClientManifestEntryType for sync callback detection in module_graph.rs
Author
Committer
Parents
Loading