Merge branch 'master' into pr/Andrew15-5/1903
This commit is contained in:
commit
1909b05412
517 files changed
+17143
-20683
No files matched your search
@@ -22,7 +22,7 @@ use std::{
|
||||
use tokio::sync::broadcast::{self};
|
||||
|
||||
#[cfg(feature = "plugin")]
|
||||
use plugin::PluginManager;
|
||||
use crate::plugin::PluginManager;
|
||||
|
||||
use super::HotReloadState;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ async fn setup_file_watcher<F: Fn() -> Result<BuildResult> + Send + 'static>(
|
||||
if let Some(hot_reload) = &hot_reload {
|
||||
// find changes to the rsx in the file
|
||||
let mut rsx_file_map = hot_reload.file_map.lock().unwrap();
|
||||
let mut messages: Vec<Template<'static>> = Vec::new();
|
||||
let mut messages: Vec<Template> = Vec::new();
|
||||
|
||||
// In hot reload mode, we only need to rebuild if non-rsx code is changed
|
||||
needs_full_rebuild = false;
|
||||
@@ -153,6 +153,6 @@ pub(crate) trait Platform {
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct HotReloadState {
|
||||
pub messages: broadcast::Sender<Template<'static>>,
|
||||
pub messages: broadcast::Sender<Template>,
|
||||
pub file_map: Arc<Mutex<FileMap<HtmlCtx>>>,
|
||||
}
|
||||
@@ -39,7 +39,7 @@ use tower_http::{
|
||||
};
|
||||
|
||||
#[cfg(feature = "plugin")]
|
||||
use plugin::PluginManager;
|
||||
use crate::plugin::PluginManager;
|
||||
|
||||
mod proxy;
|
||||
|
||||
@@ -161,10 +161,10 @@ pub async fn serve(
|
||||
);
|
||||
|
||||
// Router
|
||||
let router = setup_router(config, ws_reload_state, hot_reload_state).await?;
|
||||
let router = setup_router(config.clone(), ws_reload_state, hot_reload_state).await?;
|
||||
|
||||
// Start server
|
||||
start_server(port, router, start_browser, rustls_config).await?;
|
||||
start_server(port, router, start_browser, rustls_config, &config).await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -363,10 +363,11 @@ async fn start_server(
|
||||
router: Router,
|
||||
start_browser: bool,
|
||||
rustls: Option<RustlsConfig>,
|
||||
_config: &CrateConfig,
|
||||
) -> Result<()> {
|
||||
// If plugins, call on_serve_start event
|
||||
#[cfg(feature = "plugin")]
|
||||
PluginManager::on_serve_start(&config)?;
|
||||
PluginManager::on_serve_start(_config)?;
|
||||
|
||||
// Parse address
|
||||
let addr = format!("0.0.0.0:{}", port).parse().unwrap();
|
||||
|
||||
Reference in new issue
Block a user