Commit ae2c4ba6 authored by Michael Underwood's avatar Michael Underwood
Browse files

Complete switch to using `markRaw` on Leaflet components

parent 96fda254
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -15,6 +15,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
  other than a tooltip, resolving
  [#269 Marker with tooltip no longer visible with v0.8.2](https://github.com/vue-leaflet/vue-leaflet/issues/269).

### Changed

- Leaflet objects accessed via the `leafletObject` property of a `ref` are now all marked as raw, so they
  no longer return `Proxy` instances.


## [0.8.2] - 2023-02-05

+2 −2
Original line number Diff line number Diff line
<script>
import { onMounted, ref, inject, nextTick } from "vue";
import { onMounted, ref, inject, nextTick, markRaw } from "vue";
import {
  remapEvents,
  propsBinder,
@@ -29,7 +29,7 @@ export default {
        ? WINDOW_OR_GLOBAL.L
        : await import("leaflet/dist/leaflet-src.esm");

      leafletRef.value = circle(props.latLng, options);
      leafletRef.value = markRaw(circle(props.latLng, options));

      const listeners = remapEvents(context.attrs);
      DomEvent.on(leafletRef.value, listeners);
+2 −2
Original line number Diff line number Diff line
<script>
import { onMounted, ref, inject, nextTick } from "vue";
import { onMounted, ref, inject, nextTick, markRaw } from "vue";
import {
  remapEvents,
  propsBinder,
@@ -32,7 +32,7 @@ export default {
        ? WINDOW_OR_GLOBAL.L
        : await import("leaflet/dist/leaflet-src.esm");

      leafletRef.value = circleMarker(props.latLng, options);
      leafletRef.value = markRaw(circleMarker(props.latLng, options));

      const listeners = remapEvents(context.attrs);
      DomEvent.on(leafletRef.value, listeners);
+2 −2
Original line number Diff line number Diff line
<script>
import { onMounted, ref, inject, nextTick } from "vue";
import { onMounted, ref, inject, markRaw, nextTick } from "vue";
import { controlProps, setupControl, render } from "../functions/control";
import { propsBinder, WINDOW_OR_GLOBAL, GLOBAL_LEAFLET_OPT } from "../utils.js";

@@ -38,7 +38,7 @@ export default {
        },
      });

      leafletRef.value = new LControl(options);
      leafletRef.value = markRaw(new LControl(options));
      propsBinder(methods, leafletRef.value, props);
      registerControl({ leafletObject: leafletRef.value });

+2 −2
Original line number Diff line number Diff line
<script>
import { onMounted, ref, inject, nextTick } from "vue";
import { onMounted, ref, inject, nextTick, markRaw } from "vue";
import {
  controlAttributionProps,
  setupControlAttribution,
@@ -22,7 +22,7 @@ export default {
        ? WINDOW_OR_GLOBAL.L
        : await import("leaflet/dist/leaflet-src.esm");

      leafletRef.value = control.attribution(options);
      leafletRef.value = markRaw(control.attribution(options));
      propsBinder(methods, leafletRef.value, props);
      registerControl({ leafletObject: leafletRef.value });
      nextTick(() => context.emit("ready", leafletRef.value));
Loading