Trait Bundler

Source
pub trait Bundler {
    // Required methods
    fn get_name(&self) -> &str;
    fn start_server(&self, test_dir: &Path) -> Result<(Child, String)>;

    // Provided methods
    fn get_path(&self) -> &str { ... }
    fn react_version(&self) -> &str { ... }
    fn render_type(&self) -> RenderType { ... }
    fn has_hydration_event(&self) -> bool { ... }
    fn prepare(&self, _template_dir: &Path) -> Result<()> { ... }
    fn prepare_each(&self, _template_dir: &Path) -> Result<()> { ... }
    fn max_init_update_timeout(&self, _module_count: usize) -> Duration { ... }
    fn max_update_timeout(&self, _module_count: usize) -> Duration { ... }
}

Required Methods§

Source

fn get_name(&self) -> &str

Source

fn start_server(&self, test_dir: &Path) -> Result<(Child, String)>

Provided Methods§

Source

fn get_path(&self) -> &str

Source

fn react_version(&self) -> &str

Source

fn render_type(&self) -> RenderType

Source

fn has_hydration_event(&self) -> bool

There is a hydration done event emitted by client side JavaScript

Source

fn prepare(&self, _template_dir: &Path) -> Result<()>

Source

fn prepare_each(&self, _template_dir: &Path) -> Result<()>

Source

fn max_init_update_timeout(&self, _module_count: usize) -> Duration

The maximum amount of time to wait for HMR during the setup and warmup phase.

Source

fn max_update_timeout(&self, _module_count: usize) -> Duration

The maximum amount of time to wait for HMR during the actual benchmark. This is a lot shorter than the init timeout because we expect updates to generally happen quickly, and we don’t want to wait for a long time when an update is dropped.

Implementors§