Skip to content

๐Ÿงช Experimental Features โ€‹

This library provides a set of experimental flags to enable or disable certain features that are still under development. These flags are optional and grouped under the experimental namespace in the configuration.

โš™๏ธ Default Configuration โ€‹

ts
import { vueLeafletConfig } from '@maxel01/vue-leaflet'

console.log(vueLeafletConfig.experimental)
// {
//   useResetWebpackIcon: true,
//   skipUndefinedProps: false
// }

๐Ÿ› ๏ธ Overriding Flags โ€‹

You can override the default values by calling setVueLeafletConfig:

ts
import { setVueLeafletConfig, vueLeafletConfig } from '@maxel01/vue-leaflet'

setVueLeafletConfig({
  experimental: {
    skipUndefinedProps: false
  }
})

console.log(vueLeafletConfig.experimental.skipUndefinedProps) // false

This allows you to safely enable or disable experimental behaviors without affecting top-level configuration options.

๐Ÿงพ Example Usage โ€‹

ts
import { setVueLeafletConfig } from '@maxel01/vue-leaflet'

// Enable one experimental feature
setVueLeafletConfig({
  experimental: {
    useResetWebpackIcon: false
  }
})

// Override both experimental flags at once
setVueLeafletConfig({
  experimental: {
    useResetWebpackIcon: false,
    skipUndefinedProps: false
  }
})

๐Ÿ“ Notes โ€‹

  • These flags are experimental: their behavior may change in future versions.
  • Top-level configuration options remain separate and are not affected by experimental flags.

๐Ÿšฉ Experimental Flags โ€‹

โšก skipUndefinedProps โ€‹

The propsBinder utility binds every reactive property to a watcher (see reactivity in vue-leaflet). When enabled, any props that are undefined will be skipped and will no longer be reactive. This reduces the number of watchers and improves performance.

Example โ€‹

The DemoHome component has 14 watchers by default:

vue
<!--@include: ../../src/playground/views/DemoHome.vue -->

Enabling this feature reduces the number of watchers to 6.

When using multiple components, the effect is even more significant: TooltipDemo uses 22 components, which normally leads to 176 watchers, but only 37 when this flag is enabled.

๐Ÿงฑ useResetWebpackIcon โ€‹

Automatically resets Webpack icons (used for Leaflet's default markers). This was required in Leaflet v1, but it may no longer be necessary in v2. If you use it, please create an issue or discussion to report whether it still works.