ronantakizawa/codereview-bench huggingface dataset:
Repository: tauri-apps/tauri
File: core/tauri-build/src/lib.rs (Rust)

Code before:
      return Err(anyhow::anyhow!(
        "Framework path should have .framework extension: {}",
        framework
      ));
    }
    if let Some(home_dir) = dirs_next::home_dir() {
      if copy_framework_from(&home_dir.join("Library/Frameworks/"), framework, dest_dir)? {
        continue;
      }
    }
    if copy_framework_from(&PathBuf::from("/Library/Frameworks/"), framework, dest_dir)?
      || copy_framework_from(
        &PathBuf::from("/Network/Library/Frameworks/"),
        framework,
        dest_dir,
      )?
    {
      continue;
    }
  }
  Ok(())
}

// creates a cfg alias if `has_feature` is true.
// `alias` must be a snake case string.
fn cfg_alias(alias: &str, has_feature: bool) {
  println!("cargo::rustc-check-cfg=cfg({alias})");
  if has_feature {
    println!("cargo::rustc-cfg={alias}");
    println!("cargo:rustc-cfg={alias}");
  }
}

/// Attributes used on Windows.
#[allow(dead_code)]
#[derive(Debug, Default)]
pub struct WindowsAttributes {
  window_icon_path: Option<PathBuf>,
  /// A string containing an [application manifest] to be included with the application on Windows.
  ///
  /// Defaults to:
  /// ```text
  #[doc = include_str!("window-app-manifest.xml")]
  /// ```
  ///
  /// ## Warning
  ///
  /// if you are using tauri's dialog APIs, you need to specify a dependency on Common Control v6 by adding the following to your custom manifest:
  /// ```text
  ///  <dependency>
  ///    <dependentAssembly>

Review comment (suggestion):
we pretty much have this function on all crates, can you also update those? just search for `cargo:rustc-cfg`

Code after:
      return Err(anyhow::anyhow!(
        "Framework path should have .framework extension: {}",
        framework
      ));
    }
    if let Some(home_dir) = dirs_next::home_dir() {
      if copy_framework_from(&home_dir.join("Library/Frameworks/"), framework, dest_dir)? {
        continue;
      }
    }
    if copy_framework_from(&PathBuf::from("/Library/Frameworks/"), framework, dest_dir)?
      || copy_framework_from(
        &PathBuf::from("/Network/Library/Frameworks/"),
        framework,
        dest_dir,
      )?
    {
      continue;
    }
  }
  Ok(())
}

// creates a cfg alias if `has_feature` is true.
// `alias` must be a snake case string.
fn cfg_alias(alias: &str, has_feature: bool) {
  println!("cargo:rustc-check-cfg=cfg({alias})");
  if has_feature {
    println!("cargo:rustc-cfg={alias}");
  }
}

/// Attributes used on Windows.
#[allow(dead_code)]
#[derive(Debug, Default)]
pub struct WindowsAttributes {
  window_icon_path: Option<PathBuf>,
  /// A string containing an [application manifest] to be included with the application on Windows.
  ///
  /// Defaults to:
  /// ```text
  #[doc = include_str!("window-app-manifest.xml")]
  /// ```
  ///
  /// ## Warning
  ///
  /// if you are using tauri's dialog APIs, you need to specify a dependency on Common Control v6 by adding the following to your custom manifest:
  /// ```text
  ///  <dependency>
  ///    <dependentAssembly>
  ///      <assemblyIdentity
Repository: tauri-apps/tauri
File: core/tauri-build/src/mobile.rs (Rust)

Code before:
      gradle_settings.push('\n');

      app_build_gradle.push('\n');
      app_build_gradle.push_str(&format!(r#"  implementation(project(":{plugin_name}"))"#));
    }
  }

  app_build_gradle.push_str("\n}");

  if let Some(version) = config.version.as_ref() {
    app_gradle_properties.push_str(&format!("tauri.android.versionName={}\n", version));
    if let Some(version_code) = config.bundle.android.version_code.as_ref() {
      app_gradle_properties.push_str(&format!("tauri.android.versionCode={}\n", version_code));
    } else if let Ok(version) = Version::parse(version) {
      let version_code = version.major * 1000000 + version.minor * 1000 + version.patch;
      app_gradle_properties.push_str(&format!("tauri.android.versionCode={}\n", version_code));
    }
  }

  write(&gradle_settings_path, gradle_settings).context("failed to write tauri.settings.gradle")?;

  write(&app_build_gradle_path, app_build_gradle)
    .context("failed to write tauri.build.gradle.kts")?;

  write(&app_gradle_properties_path, app_gradle_properties)
    .context("failed to write gradle.properties")?;

  println!("cargo:rerun-if-changed={}", gradle_settings_path.display());
  println!("cargo:rerun-if-changed={}", app_build_gradle_path.display());
  println!("cargo:rerun-if-changed={}", app_gradle_properties_path.display());

  Ok(())
}


Review comment (bug):
```suggestion
    .context("failed to write tauri.properties")?;
```

Code after:

      app_build_gradle.push('\n');
      app_build_gradle.push_str(&format!(r#"  implementation(project(":{plugin_name}"))"#));
    }
  }

  app_build_gradle.push_str("\n}");

  if let Some(version) = config.version.as_ref() {
    app_tauri_properties.push(format!("tauri.android.versionName={}", version));
    if let Some(version_code) = config.bundle.android.version_code.as_ref() {
      app_tauri_properties.push(format!("tauri.android.versionCode={}", version_code));
    } else if let Ok(version) = Version::parse(version) {
      let version_code = version.major * 1000000 + version.minor * 1000 + version.patch;
      app_tauri_properties.push(format!("tauri.android.versionCode={}", version_code));
    }
  }

  write(&gradle_settings_path, gradle_settings).context("failed to write tauri.settings.gradle")?;

  write(&app_build_gradle_path, app_build_gradle)
    .context("failed to write tauri.build.gradle.kts")?;

  if !app_tauri_properties.is_empty() {
    write(
      &app_tauri_properties_path,
      format!(
        "// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n{}",
        app_tauri_properties.join("\n")
      ),
    )
    .context("failed to write tauri.properties")?;
  }

  println!("cargo:rerun-if-changed={}", gradle_settings_path.display());
  println!("cargo:rerun-if-changed={}", app_build_gradle_path.display());
  if !app_tauri_properties.is_empty() {
    println!(
      "cargo:rerun-if-changed={}",
      app_tauri_properties_path.display()
    );
  }

  Ok(())
}
Repository: tauri-apps/tauri
File: core/tauri-macros/src/lib.rs (Rust)

Code before:
///    i.set_text(text)
///  }
///  _ => unreachable!(),
///  }
/// ```
#[proc_macro]
pub fn do_menu_item(input: TokenStream) -> TokenStream {
  let tokens = parse_macro_input!(input as menu::DoMenuItemInput);
  menu::do_menu_item(tokens).into()
}

/// Convert a .png or .ico icon to an Image
/// for things like `tauri::tray::TrayIconBuilder` to consume,
/// relative paths are resolved from `CARGO_MANIFEST_DIR`, not current file
///
/// ### Examples
///
/// ```ignore
/// TrayIconBuilder::new().icon(icon_image!("./icons/32x32.png")).build().unwrap();
/// ```
///
/// Note: this stores the image in raw pixels to the final binary,
/// so keep the icon size (width and height) small
/// or else it's going to bloat your final executable
#[proc_macro]
pub fn icon_image(tokens: TokenStream) -> TokenStream {
  let path = PathBuf::from(parse2::<LitStr>(tokens.into()).unwrap().value());
  let resolved_path = if path.is_relative() {
    if let Ok(base_dir) = std::env::var("CARGO_MANIFEST_DIR").map(PathBuf::from) {
      base_dir.as_path().join(path)
    } else {
      return quote!(compile_error!("Can't resolve relative path")).into();
    }
  } else {
    path
  };
  match tauri_codegen::icon_image_codegen(&resolved_path).map_err(|error| error.to_string()) {
    Ok(output) => output,
    Err(error) => quote!(compile_error!(#error)),
  }
  .into()
}


Review comment (suggestion):
this should just be called `image` since it will create an `Image` struct or maybe call it `include_image` or `static_image`

Code after:
///    i.set_text(text)
///  }
///  _ => unreachable!(),
///  }
/// ```
#[proc_macro]
pub fn do_menu_item(input: TokenStream) -> TokenStream {
  let tokens = parse_macro_input!(input as menu::DoMenuItemInput);
  menu::do_menu_item(tokens).into()
}

/// Convert a .png or .ico icon to an Image
/// for things like `tauri::tray::TrayIconBuilder` to consume,
/// relative paths are resolved from `CARGO_MANIFEST_DIR`, not current file
///
/// ### Examples
///
/// ```ignore
/// const APP_ICON: Image<'_> = include_image!("./icons/32x32.png");
///
/// // then use it with tray
/// TrayIconBuilder::new().icon(APP_ICON).build().unwrap();
///
/// // or with window
/// WebviewWindowBuilder::new(app, "main", WebviewUrl::default())
///     .icon(APP_ICON)
///     .unwrap()
///     .build()
///     .unwrap();
///
/// // or with any other functions that takes `Image` struct
/// ```
///
/// Note: this stores the image in raw pixels to the final binary,
/// so keep the icon size (width and height) small
/// or else it's going to bloat your final executable
#[proc_macro]
pub fn include_image(tokens: TokenStream) -> TokenStream {
  let path = match parse2::<LitStr>(tokens.into()) {
    Ok(path) => path,
    Err(err) => return err.into_compile_error().into(),
  };
  let path = PathBuf::from(path.value());
  let resolved_path = if path.is_relative() {
    if let Ok(base_dir) = std::env::var("CARGO_MANIFEST_DIR").map(PathBuf::from) {
      base_dir.join(path)
    } else {
      return quote!(compile_error!("$CARGO_MANIFEST_DIR is not defined")).into();
    }
  } else {
    path
Repository: tauri-apps/tauri
File: core/tauri-macros/src/lib.rs (Rust)

Code before:
/// ```
#[proc_macro]
pub fn do_menu_item(input: TokenStream) -> TokenStream {
  let tokens = parse_macro_input!(input as menu::DoMenuItemInput);
  menu::do_menu_item(tokens).into()
}

/// Convert a .png or .ico icon to an Image
/// for things like `tauri::tray::TrayIconBuilder` to consume,
/// relative paths are resolved from `CARGO_MANIFEST_DIR`, not current file
///
/// ### Examples
///
/// ```ignore
/// TrayIconBuilder::new().icon(icon_image!("./icons/32x32.png")).build().unwrap();
/// ```
///
/// Note: this stores the image in raw pixels to the final binary,
/// so keep the icon size (width and height) small
/// or else it's going to bloat your final executable
#[proc_macro]
pub fn icon_image(tokens: TokenStream) -> TokenStream {
  let path = PathBuf::from(parse2::<LitStr>(tokens.into()).unwrap().value());
  let resolved_path = if path.is_relative() {
    if let Ok(base_dir) = std::env::var("CARGO_MANIFEST_DIR").map(PathBuf::from) {
      base_dir.as_path().join(path)
    } else {
      return quote!(compile_error!("Can't resolve relative path")).into();
    }
  } else {
    path
  };
  match tauri_codegen::icon_image_codegen(&resolved_path).map_err(|error| error.to_string()) {
    Ok(output) => output,
    Err(error) => quote!(compile_error!(#error)),
  }
  .into()
}


Review comment (suggestion):
You shouldn't need to call `.as_path()`
```suggestion
      base_dir.join(path)
```

Code after:
/// ```
#[proc_macro]
pub fn do_menu_item(input: TokenStream) -> TokenStream {
  let tokens = parse_macro_input!(input as menu::DoMenuItemInput);
  menu::do_menu_item(tokens).into()
}

/// Convert a .png or .ico icon to an Image
/// for things like `tauri::tray::TrayIconBuilder` to consume,
/// relative paths are resolved from `CARGO_MANIFEST_DIR`, not current file
///
/// ### Examples
///
/// ```ignore
/// const APP_ICON: Image<'_> = include_image!("./icons/32x32.png");
///
/// // then use it with tray
/// TrayIconBuilder::new().icon(APP_ICON).build().unwrap();
///
/// // or with window
/// WebviewWindowBuilder::new(app, "main", WebviewUrl::default())
///     .icon(APP_ICON)
///     .unwrap()
///     .build()
///     .unwrap();
///
/// // or with any other functions that takes `Image` struct
/// ```
///
/// Note: this stores the image in raw pixels to the final binary,
/// so keep the icon size (width and height) small
/// or else it's going to bloat your final executable
#[proc_macro]
pub fn include_image(tokens: TokenStream) -> TokenStream {
  let path = match parse2::<LitStr>(tokens.into()) {
    Ok(path) => path,
    Err(err) => return err.into_compile_error().into(),
  };
  let path = PathBuf::from(path.value());
  let resolved_path = if path.is_relative() {
    if let Ok(base_dir) = std::env::var("CARGO_MANIFEST_DIR").map(PathBuf::from) {
      base_dir.join(path)
    } else {
      return quote!(compile_error!("$CARGO_MANIFEST_DIR is not defined")).into();
    }
  } else {
    path
  };
  if !resolved_path.exists() {
    let error_string = format!(
      "Provided Image path \"{}\" doesn't exists",
Repository: tauri-apps/tauri
File: core/tauri-macros/src/lib.rs (Rust)

Code before:
}

/// Convert a .png or .ico icon to an Image
/// for things like `tauri::tray::TrayIconBuilder` to consume,
/// relative paths are resolved from `CARGO_MANIFEST_DIR`, not current file
///
/// ### Examples
///
/// ```ignore
/// TrayIconBuilder::new().icon(include_image!("./icons/32x32.png")).build().unwrap();
/// ```
///
/// Note: this stores the image in raw pixels to the final binary,
/// so keep the icon size (width and height) small
/// or else it's going to bloat your final executable
#[proc_macro]
pub fn include_image(tokens: TokenStream) -> TokenStream {
  let Ok(path) = parse2::<LitStr>(tokens.into()) else {
    return quote!(compile_error!("Macro body is not a string")).into();
  };
  let path = PathBuf::from(path.value());
  let resolved_path = if path.is_relative() {
    if let Ok(base_dir) = std::env::var("CARGO_MANIFEST_DIR").map(PathBuf::from) {
      base_dir.join(path)
    } else {
      return quote!(compile_error!("Can't resolve relative path")).into();
    }
  } else {
    path
  };
  match tauri_codegen::icon_image_codegen(&resolved_path).map_err(|error| error.to_string()) {
    Ok(output) => output,
    Err(error) => quote!(compile_error!(#error)),
  }
  .into()
}


Review comment (suggestion):
```suggestion
      return quote!(compile_error!("$CARGO_MANIFEST_DIR is not defined")).into();
```

Code after:
}

/// Convert a .png or .ico icon to an Image
/// for things like `tauri::tray::TrayIconBuilder` to consume,
/// relative paths are resolved from `CARGO_MANIFEST_DIR`, not current file
///
/// ### Examples
///
/// ```ignore
/// const APP_ICON: Image<'_> = include_image!("./icons/32x32.png");
///
/// // then use it with tray
/// TrayIconBuilder::new().icon(APP_ICON).build().unwrap();
///
/// // or with window
/// WebviewWindowBuilder::new(app, "main", WebviewUrl::default())
///     .icon(APP_ICON)
///     .unwrap()
///     .build()
///     .unwrap();
///
/// // or with any other functions that takes `Image` struct
/// ```
///
/// Note: this stores the image in raw pixels to the final binary,
/// so keep the icon size (width and height) small
/// or else it's going to bloat your final executable
#[proc_macro]
pub fn include_image(tokens: TokenStream) -> TokenStream {
  let path = match parse2::<LitStr>(tokens.into()) {
    Ok(path) => path,
    Err(err) => return err.into_compile_error().into(),
  };
  let path = PathBuf::from(path.value());
  let resolved_path = if path.is_relative() {
    if let Ok(base_dir) = std::env::var("CARGO_MANIFEST_DIR").map(PathBuf::from) {
      base_dir.join(path)
    } else {
      return quote!(compile_error!("$CARGO_MANIFEST_DIR is not defined")).into();
    }
  } else {
    path
  };
  if !resolved_path.exists() {
    let error_string = format!(
      "Provided Image path \"{}\" doesn't exists",
      resolved_path.display()
    );
    return quote!(compile_error!(#error_string)).into();
  }
  match tauri_codegen::include_image_codegen(&resolved_path).map_err(|error| error.to_string()) {
Repository: tauri-apps/tauri
File: core/tauri-macros/src/lib.rs (Rust)

Code before:
///
/// Note: this stores the image in raw pixels to the final binary,
/// so keep the icon size (width and height) small
/// or else it's going to bloat your final executable
#[proc_macro]
pub fn include_image(tokens: TokenStream) -> TokenStream {
  let Ok(path) = parse2::<LitStr>(tokens.into()) else {
    return quote!(compile_error!("Macro body is not a string")).into();
  };
  let path = PathBuf::from(path.value());
  let resolved_path = if path.is_relative() {
    if let Ok(base_dir) = std::env::var("CARGO_MANIFEST_DIR").map(PathBuf::from) {
      base_dir.join(path)
    } else {
      return quote!(compile_error!("Can't resolve relative path")).into();
    }
  } else {
    path
  };
  match tauri_codegen::icon_image_codegen(&resolved_path).map_err(|error| error.to_string()) {
    Ok(output) => output,
    Err(error) => quote!(compile_error!(#error)),
  }
  .into()
}


Review comment (bug):
we should check if this path exists and provide a compile error if not, probably including the path that failed to resolve

Code after:
/// // then use it with tray
/// TrayIconBuilder::new().icon(APP_ICON).build().unwrap();
///
/// // or with window
/// WebviewWindowBuilder::new(app, "main", WebviewUrl::default())
///     .icon(APP_ICON)
///     .unwrap()
///     .build()
///     .unwrap();
///
/// // or with any other functions that takes `Image` struct
/// ```
///
/// Note: this stores the image in raw pixels to the final binary,
/// so keep the icon size (width and height) small
/// or else it's going to bloat your final executable
#[proc_macro]
pub fn include_image(tokens: TokenStream) -> TokenStream {
  let path = match parse2::<LitStr>(tokens.into()) {
    Ok(path) => path,
    Err(err) => return err.into_compile_error().into(),
  };
  let path = PathBuf::from(path.value());
  let resolved_path = if path.is_relative() {
    if let Ok(base_dir) = std::env::var("CARGO_MANIFEST_DIR").map(PathBuf::from) {
      base_dir.join(path)
    } else {
      return quote!(compile_error!("$CARGO_MANIFEST_DIR is not defined")).into();
    }
  } else {
    path
  };
  if !resolved_path.exists() {
    let error_string = format!(
      "Provided Image path \"{}\" doesn't exists",
      resolved_path.display()
    );
    return quote!(compile_error!(#error_string)).into();
  }
  match tauri_codegen::include_image_codegen(&resolved_path).map_err(|error| error.to_string()) {
    Ok(output) => output,
    Err(error) => quote!(compile_error!(#error)),
  }
  .into()
}
Repository: tauri-apps/tauri
File: core/tauri-codegen/src/image.rs (Rust)

Code before:
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

use crate::embedded_assets::{ensure_out_dir, EmbeddedAssetsError, EmbeddedAssetsResult};
use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use std::path::Path;
use syn::{punctuated::Punctuated, Ident, PathArguments, PathSegment, Token};

pub fn icon_image_codegen(path: &Path) -> EmbeddedAssetsResult<TokenStream> {
  let out_dir = ensure_out_dir()?;
  let mut segments = Punctuated::new();
  segments.push(PathSegment {
    ident: Ident::new("tauri", Span::call_site()),
    arguments: PathArguments::None,
  });
  let root = syn::Path {
    leading_colon: Some(Token![::](Span::call_site())),
    segments,
  };
  image_icon(&root.to_token_stream(), &out_dir, path)
}

pub(crate) fn image_icon(
  root: &TokenStream,
  out_dir: &Path,
  path: &Path,
) -> EmbeddedAssetsResult<TokenStream> {
  let extension = path.extension().unwrap_or_default();
  if extension == "ico" {
    ico_icon(root, out_dir, path)
  } else if extension == "png" {
    png_icon(root, out_dir, path)
  } else {
    Err(EmbeddedAssetsError::InvalidImageExtension {

Review comment (suggestion):
```suggestion
pub fn include_image_codegen(path: &Path) -> EmbeddedAssetsResult<TokenStream> {
```

Code after:
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

use crate::embedded_assets::{ensure_out_dir, EmbeddedAssetsError, EmbeddedAssetsResult};
use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use std::path::Path;
use syn::{punctuated::Punctuated, Ident, PathArguments, PathSegment, Token};

pub fn include_image_codegen(path: &Path) -> EmbeddedAssetsResult<TokenStream> {
  let out_dir = ensure_out_dir()?;

  let mut segments = Punctuated::new();
  segments.push(PathSegment {
    ident: Ident::new("tauri", Span::call_site()),
    arguments: PathArguments::None,
  });
  let root = syn::Path {
    leading_colon: Some(Token![::](Span::call_site())),
    segments,
  };

  image_icon(&root.to_token_stream(), &out_dir, path)
}

pub(crate) fn image_icon(
  root: &TokenStream,
  out_dir: &Path,
  path: &Path,
) -> EmbeddedAssetsResult<TokenStream> {
  let extension = path.extension().unwrap_or_default();
  if extension == "ico" {
    ico_icon(root, out_dir, path)
  } else if extension == "png" {
    png_icon(root, out_dir, path)
Repository: tauri-apps/tauri
File: packages/api/src/window.ts (TypeScript)

Code before:
   *
   * - **Windows / iOS / Android:** Unsupported.
   *
   * @since 2.0.0
   */
  async setVisibleOnAllWorkspaces(visible: boolean): Promise<void> {
    return invoke('plugin:window|set_visible_on_all_workspaces', {
      label: this.label,
      value: visible
    })
  }

  /**
   * Sets the title bar style. **macOS only**.
   *
   * @since 2.0.0
   */
  async setTitleBarStyle(style: TitleBarStyle): Promise<void> {
    return invoke('plugin:window|set_title_bar_style', {
      label: this.label,
      value: style
    })
  }

  /**
   * Set window theme, pass in undefined or no parameters to follow system theme
   */
  async setTheme(theme?: Theme): Promise<void> {
    return invoke('plugin:window|set_theme', {
      label: this.label,
      value: theme
    })
  }

  // Listeners

  /**
   * Listen to window resize.
   *
   * @example
   * ```typescript
   * import { getCurrentWindow } from "@tauri-apps/api/window";
   * const unlisten = await getCurrentWindow().onResized(({ payload: size }) => {
   *  console.log('Window resized', size);
   * });
   *
   * // you need to call unlisten if your handler goes out of scope e.g. the component is unmounted
   * unlisten();
   * ```
   *
   * @returns A promise resolving to a function to unlisten to the event.

Review comment (suggestion):
```suggestion
   * Set window theme, pass null to follow system theme
   *
   * @since 2.0.0
```

Code after:
   *
   * - **Windows / iOS / Android:** Unsupported.
   *
   * @since 2.0.0
   */
  async setVisibleOnAllWorkspaces(visible: boolean): Promise<void> {
    return invoke('plugin:window|set_visible_on_all_workspaces', {
      label: this.label,
      value: visible
    })
  }

  /**
   * Sets the title bar style. **macOS only**.
   *
   * @since 2.0.0
   */
  async setTitleBarStyle(style: TitleBarStyle): Promise<void> {
    return invoke('plugin:window|set_title_bar_style', {
      label: this.label,
      value: style
    })
  }

  /**
   * Set window theme, pass in `null` or `undefined` to follow system theme
   *
   * #### Platform-specific
   *
   * - **Linux / macOS**: Theme is app-wide and not specific to this window.
   * - **iOS / Android:** Unsupported.
   *
   * @since 2.0.0
   */
  async setTheme(theme?: Theme | null): Promise<void> {
    return invoke('plugin:window|set_theme', {
      label: this.label,
      value: theme
    })
  }

  // Listeners

  /**
   * Listen to window resize.
   *
   * @example
   * ```typescript
   * import { getCurrentWindow } from "@tauri-apps/api/window";
   * const unlisten = await getCurrentWindow().onResized(({ payload: size }) => {
   *  console.log('Window resized', size);