๐งช 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 โ
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
:
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 โ
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:
<!--@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.