From 8cf993c378983be23c62be19880e4962d12f1aca Mon Sep 17 00:00:00 2001 From: Maximilian Ammann Date: Wed, 29 Dec 2021 12:41:26 +0100 Subject: [PATCH] Production mode by default for web --- src/platform/web/mod.rs | 2 +- web/static/index.html | 1 + web/webpack.config.js | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/platform/web/mod.rs b/src/platform/web/mod.rs index bf481392..cf02348f 100644 --- a/src/platform/web/mod.rs +++ b/src/platform/web/mod.rs @@ -28,7 +28,7 @@ pub const COLOR_TEXTURE_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba8 #[wasm_bindgen(start)] pub fn start() { - if let Err(_) = console_log::init_with_level(Level::Info) { + if let Err(_) = console_log::init_with_level(Level::Trace) { // Failed to initialize logging. No need to log a message. } panic::set_hook(Box::new(console_error_panic_hook::hook)); diff --git a/web/static/index.html b/web/static/index.html index ad05b1ea..255ee5d4 100644 --- a/web/static/index.html +++ b/web/static/index.html @@ -1,3 +1,4 @@ + mapr Demo diff --git a/web/webpack.config.js b/web/webpack.config.js index 995c1df3..7eaa2d0f 100644 --- a/web/webpack.config.js +++ b/web/webpack.config.js @@ -74,7 +74,10 @@ module.exports = (env) => ({ // // the mode `development` makes `wasm-pack` build in `debug` mode. // the mode `production` makes `wasm-pack` build in `release` mode. - // forceMode: "production", + // TODO: We always build a production build because a development build runs slow + // TODO: The function which is slowing it down is TileProto::decode() which maps the tile proto struct + // TODO: into our data structure. (Development: 15s, Production: 60ms) + forceMode: "production", // Controls plugin output verbosity, either 'info' or 'error'. // Defaults to 'info'.