Skip to content

Commit 7e13440

Browse files
committed
perf: prevent watching reactive props continously
BREAKING CHANGE: the composable `usePropsAsObjectProperties` which is used as foundation in all components has been refactored. Props were watched always deeply and for lot's of components this was done multiple times since the components implement watchers by themselves. However, even if not expected, this may cause some side effects with reactive changes which must be applied for individual components when not implemented and therefore considered as a breaking change. Please check your app carefully when updating to the new major version.
1 parent 4646392 commit 7e13440

File tree

71 files changed

+90
-103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+90
-103
lines changed

src/components/animations/OlAnimationFeature.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const props = withDefaults(
2121
const map = inject("map");
2222
const vectorLayer = inject<Ref<VectorSource<Geometry>> | null>("vectorLayer");
2323
24-
const { properties } = usePropsAsObjectProperties(props);
24+
const properties = usePropsAsObjectProperties(props);
2525
2626
defineExpose({
2727
map,

src/components/interaction/OlClusterSelectInteraction.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const props = withDefaults(defineProps<Options>(), {
2727
2828
const map = inject<Map>("map");
2929
30-
const { properties } = usePropsAsObjectProperties(props);
30+
const properties = usePropsAsObjectProperties(props);
3131
3232
const select = computed(() => {
3333
return new SelectCluster({

src/components/interaction/OlDragBoxInteraction.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const props = withDefaults(defineProps<Options>(), {});
2020
2121
const map = inject<Map>("map");
2222
23-
const { properties } = usePropsAsObjectProperties(props);
23+
const properties = usePropsAsObjectProperties(props);
2424
2525
const dragbox = computed(() => {
2626
const s = new DragBox({

src/components/interaction/OlDragRotateInteraction.vue

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ const props = withDefaults(
2222
2323
const map = inject<Map>("map");
2424
25-
const { properties } = usePropsAsObjectProperties(props);
25+
const properties = usePropsAsObjectProperties(props);
2626
2727
const dragrotate = computed(() => {
28-
const s = new DragRotate({
29-
...properties,
30-
});
28+
const s = new DragRotate(properties);
3129
3230
return s;
3331
});

src/components/interaction/OlDragRotateZoomInteraction.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const props = withDefaults(
1919
);
2020
2121
const map = inject<Map>("map");
22-
const { properties } = usePropsAsObjectProperties(props);
22+
const properties = usePropsAsObjectProperties(props);
2323
const dragRotateZoom = computed(() => {
2424
const OlDragRotateAndZoom = new DragRotateAndZoom({
2525
...properties,

src/components/interaction/OlLinktInteraction.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const props = withDefaults(defineProps<Options>(), {
2929
});
3030
3131
const map = inject<Map>("map");
32-
const { properties } = usePropsAsObjectProperties(props);
32+
const properties = usePropsAsObjectProperties(props);
3333
3434
const link = shallowRef(new Link(properties));
3535

src/components/interaction/OlSelectInteraction.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const props = withDefaults(
3535
);
3636
3737
const map = inject<Map>("map");
38-
const { properties } = usePropsAsObjectProperties(props);
38+
const properties = usePropsAsObjectProperties(props);
3939
4040
const select = computed(() => {
4141
return new Select({

src/components/interaction/OlSnapInteraction.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const props = withDefaults(
2626
const map = inject<Map>("map");
2727
const source = inject<Ref<VectorSource> | null>("vectorSource");
2828
29-
const { properties } = usePropsAsObjectProperties(props);
29+
const properties = usePropsAsObjectProperties(props);
3030
3131
const createSnap = () => {
3232
const olSnap = new Snap({

src/components/interaction/OlTransformInteraction.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ defineOptions({
4343
4444
const map = inject<Map>("map");
4545
46-
const { properties } = usePropsAsObjectProperties(props);
46+
const properties = usePropsAsObjectProperties(props);
4747
4848
const transform = computed(() => {
4949
const olTransform = new Transform({

src/components/layers/OlAnimatedClusterLayer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const props = withDefaults(
5959
const map = inject<Map>("map");
6060
const layerGroup = inject<LayerGroup | null>("layerGroup", null);
6161
62-
const { properties } = usePropsAsObjectProperties(props);
62+
const properties = usePropsAsObjectProperties(props);
6363
6464
const clusterSource = shallowRef(
6565
new Cluster({

src/components/layers/OlHeatmapLayer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const props = withDefaults(
4747
const map = inject<Map>("map");
4848
const layerGroup = inject<LayerGroup | null>("layerGroup", null);
4949
50-
const { properties } = usePropsAsObjectProperties(props);
50+
const properties = usePropsAsObjectProperties(props);
5151
const heatmapLayer = shallowRef(new HeatmapLayer(properties));
5252
5353
watch(

src/components/layers/OlImageLayer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const props = withDefaults(
2323
const map = inject<Map>("map");
2424
const layerGroup = inject<LayerGroup | null>("layerGroup", null);
2525
26-
const { properties } = usePropsAsObjectProperties(props);
26+
const properties = usePropsAsObjectProperties(props);
2727
2828
const imageLayer = ref(new ImageLayer(properties));
2929

src/components/layers/OlLayerGroup.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const props = withDefaults(
3030
);
3131
3232
const map = inject<Map>("map");
33-
const { properties } = usePropsAsObjectProperties(props);
33+
const properties = usePropsAsObjectProperties(props);
3434
3535
const layerGroup = shallowRef(new LayerGroup(properties));
3636
useOpenLayersEvents(layerGroup, [

src/components/layers/OlTileLayer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const map = inject<Map>("map");
4040
const layerGroup = inject<LayerGroup | null>("layerGroup", null);
4141
const overViewMap = inject<Ref<OverviewMap | null> | null>("overviewMap", null);
4242
43-
const { properties } = usePropsAsObjectProperties(props);
43+
const properties = usePropsAsObjectProperties(props);
4444
4545
const tileLayer = ref(new TileLayer(properties));
4646

src/components/layers/OlVectorImageLayer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const props = withDefaults(
3636
const map = inject<Map>("map");
3737
const layerGroup = inject<LayerGroup | null>("layerGroup", null);
3838
39-
const { properties } = usePropsAsObjectProperties(props);
39+
const properties = usePropsAsObjectProperties(props);
4040
4141
const vectorImageLayer = computed(() => new VectorImageLayer(properties));
4242

src/components/layers/OlVectorLayer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const props = withDefaults(
3939
const map = inject<Map>("map");
4040
const layerGroup = inject<LayerGroup | null>("layerGroup", null);
4141
42-
const { properties } = usePropsAsObjectProperties(props);
42+
const properties = usePropsAsObjectProperties(props);
4343
4444
const vectorLayer = computed(() => new VectorLayer(properties));
4545

src/components/layers/OlVectorTileLayer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const props = withDefaults(
4141
const map = inject<Map>("map");
4242
const layerGroup = inject<LayerGroup | null>("layerGroup", null);
4343
44-
const { properties } = usePropsAsObjectProperties(props);
44+
const properties = usePropsAsObjectProperties(props);
4545
4646
const vectorTileLayer = computed(() => new VectorTileLayer(properties));
4747

src/components/layers/OlWebglTileLayer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const layerGroup = inject<LayerGroup | null>("layerGroup", null);
2828
2929
const overViewMap = inject<Ref<OverviewMap | null> | null>("overviewMap", null);
3030
31-
const { properties } = usePropsAsObjectProperties(props);
31+
const properties = usePropsAsObjectProperties(props);
3232
3333
const tileLayer = shallowRef(new TileLayer(properties));
3434

src/components/layers/OlWebglVectorLayer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const props = withDefaults(
3939
const map = inject<Map>("map");
4040
const layerGroup = inject<LayerGroup | null>("layerGroup", null);
4141
42-
const { properties } = usePropsAsObjectProperties(props);
42+
const properties = usePropsAsObjectProperties(props);
4343
4444
const webglVectorLayer = computed(() => {
4545
return new WebGLVectorLayer({

src/components/map/OlGeoLocation.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const props = withDefaults(defineProps<Options>(), {
3131
}),
3232
});
3333
34-
const { properties } = usePropsAsObjectProperties(props);
34+
const properties = usePropsAsObjectProperties(props);
3535
3636
const geoLoc = computed(() => new Geolocation(properties));
3737

src/components/map/OlMap.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const emit = defineEmits([
3737
"rendercomplete",
3838
]);
3939
40-
const { properties } = usePropsAsObjectProperties(props);
40+
const properties = usePropsAsObjectProperties(props);
4141
4242
const mapRef = ref<string | HTMLElement | undefined>(undefined);
4343
let map: Map | undefined = new Map(properties);

src/components/map/OlOverlay.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const map = inject<Map>("map");
3333
3434
const htmlContent = ref<HTMLElement>();
3535
36-
const { properties } = usePropsAsObjectProperties(props);
36+
const properties = usePropsAsObjectProperties(props);
3737
3838
const overlay = shallowRef(new Overlay(properties));
3939

src/components/map/OlView.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const props = withDefaults(defineProps<ViewOptions>(), {
2727
});
2828
2929
const map = inject<Map>("map");
30-
const { properties } = usePropsAsObjectProperties(props);
30+
const properties = usePropsAsObjectProperties(props);
3131
3232
const createProp = () => {
3333
return {

src/components/mapControls/OlAttributionControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const props = withDefaults(
3232
);
3333
3434
const attrs = useAttrs();
35-
const { properties } = usePropsAsObjectProperties(props);
35+
const properties = usePropsAsObjectProperties(props);
3636
const { control } = useControl(Attribution, properties, attrs);
3737
3838
defineExpose({

src/components/mapControls/OlButtonControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const props = withDefaults(
2020
);
2121
2222
const attrs = useAttrs();
23-
const { properties } = usePropsAsObjectProperties(props);
23+
const properties = usePropsAsObjectProperties(props);
2424
2525
const { control } = useControl(Button, properties, attrs);
2626

src/components/mapControls/OlContextMenuControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ defineOptions({
2121
});
2222
2323
const attrs = useAttrs();
24-
const { properties } = usePropsAsObjectProperties(props);
24+
const properties = usePropsAsObjectProperties(props);
2525
2626
const { control } = useControl(ContextMenu, properties, attrs);
2727
useOpenLayersEvents(control, ["beforeopen", "open", "close", "add-menu-entry"]);

src/components/mapControls/OlControlBar.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const props = withDefaults(
2020
);
2121
2222
const attrs = useAttrs();
23-
const { properties } = usePropsAsObjectProperties(props);
23+
const properties = usePropsAsObjectProperties(props);
2424
2525
const { control } = useControl(Bar, properties, attrs);
2626

src/components/mapControls/OlFullScreenControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const props = withDefaults(
3333
);
3434
3535
const attrs = useAttrs();
36-
const { properties } = usePropsAsObjectProperties(props);
36+
const properties = usePropsAsObjectProperties(props);
3737
const { control } = useControl(FullScreen, properties, attrs);
3838
3939
defineExpose({

src/components/mapControls/OlLayerSwitcherControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const props = withDefaults(defineProps<Options>(), {
1717
});
1818
1919
const attrs = useAttrs();
20-
const { properties } = usePropsAsObjectProperties(props);
20+
const properties = usePropsAsObjectProperties(props);
2121
2222
const { control } = useControl(LayerSwitcher, properties, attrs);
2323

src/components/mapControls/OlLayerSwitcherImageControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const props = withDefaults(defineProps<Options>(), {
1818
});
1919
2020
const attrs = useAttrs();
21-
const { properties } = usePropsAsObjectProperties(props);
21+
const properties = usePropsAsObjectProperties(props);
2222
2323
const { control } = useControl(LayerSwitcherImage, properties, attrs);
2424

src/components/mapControls/OlMousePositionControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const props = withDefaults(
2121
);
2222
2323
const attrs = useAttrs();
24-
const { properties } = usePropsAsObjectProperties(props);
24+
const properties = usePropsAsObjectProperties(props);
2525
2626
const { control } = useControl(MousePosition, properties, attrs);
2727
defineExpose({

src/components/mapControls/OlOverviewMapControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import usePropsAsObjectProperties from "@/composables/usePropsAsObjectProperties
1313
const props = defineProps<Options>();
1414
1515
const attrs = useAttrs();
16-
const { properties } = usePropsAsObjectProperties(props);
16+
const properties = usePropsAsObjectProperties(props);
1717
const { control } = useControl(OverviewMap, properties, attrs);
1818
1919
provide("overviewMap", control);

src/components/mapControls/OlPrintDialogControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import usePropsAsObjectProperties from "@/composables/usePropsAsObjectProperties
1313
const props = withDefaults(defineProps<Options>(), {});
1414
1515
const attrs = useAttrs();
16-
const { properties } = usePropsAsObjectProperties(props);
16+
const properties = usePropsAsObjectProperties(props);
1717
1818
const { control } = useControl(PrintDialog, properties, attrs);
1919

src/components/mapControls/OlProfileControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defineOptions({
1616
const props = withDefaults(defineProps<Options>(), {});
1717
1818
const attrs = useAttrs();
19-
const { properties } = usePropsAsObjectProperties(props);
19+
const properties = usePropsAsObjectProperties(props);
2020
const { control } = useControl(Profile, properties, attrs);
2121
2222
useOpenLayersEvents(control, [

src/components/mapControls/OlRotateControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const props = withDefaults(
3030
);
3131
3232
const attrs = useAttrs();
33-
const { properties } = usePropsAsObjectProperties(props);
33+
const properties = usePropsAsObjectProperties(props);
3434
3535
const { control } = useControl(Rotate, properties, attrs);
3636

src/components/mapControls/OlScaleLineControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const props = withDefaults(
3131
);
3232
3333
const attrs = useAttrs();
34-
const { properties } = usePropsAsObjectProperties(props);
34+
const properties = usePropsAsObjectProperties(props);
3535
3636
const { control } = useControl(ScaleLine, properties, attrs);
3737

src/components/mapControls/OlSearchControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const props = withDefaults(defineProps<Options>(), {
1414
});
1515
1616
const attrs = useAttrs();
17-
const { properties } = usePropsAsObjectProperties(props);
17+
const properties = usePropsAsObjectProperties(props);
1818
1919
const { control } = useControl(Search, properties, attrs);
2020

src/components/mapControls/OlSwipeControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const props = withDefaults(
2323
);
2424
2525
const attrs = useAttrs();
26-
const { properties } = usePropsAsObjectProperties(props);
26+
const properties = usePropsAsObjectProperties(props);
2727
2828
const { control } = useControl(Swipe, properties, attrs);
2929

src/components/mapControls/OlToggleControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import usePropsAsObjectProperties from "@/composables/usePropsAsObjectProperties
1111
const props = withDefaults(defineProps<Options>(), {});
1212
1313
const attrs = useAttrs();
14-
const { properties } = usePropsAsObjectProperties(props);
14+
const properties = usePropsAsObjectProperties(props);
1515
1616
const { control } = useControl(Toggle, properties, attrs);
1717

src/components/mapControls/OlVideoRecorderControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const props = withDefaults(defineProps<Options & { downloadName?: string }>(), {
2020
});
2121
2222
const attrs = useAttrs();
23-
const { properties } = usePropsAsObjectProperties(props);
23+
const properties = usePropsAsObjectProperties(props);
2424
const { control } = useControl(VideoRecorder, properties, attrs);
2525
2626
useOpenLayersEvents(control, ["start", "stop", "pause", "resume"]);

src/components/mapControls/OlZoneControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const props = withDefaults(
2323
);
2424
2525
const attrs = useAttrs();
26-
const { properties } = usePropsAsObjectProperties(props);
26+
const properties = usePropsAsObjectProperties(props);
2727
2828
const { control } = useControl(MapZone, properties, attrs);
2929

src/components/mapControls/OlZoomControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const props = withDefaults(defineProps<Options>(), {
2020
});
2121
2222
const attrs = useAttrs();
23-
const { properties } = usePropsAsObjectProperties(props);
23+
const properties = usePropsAsObjectProperties(props);
2424
2525
const { control } = useControl(Zoom, properties, attrs);
2626
defineExpose({

src/components/mapControls/OlZoomSliderControl.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const props = withDefaults(
2020
);
2121
2222
const attrs = useAttrs();
23-
const { properties } = usePropsAsObjectProperties(props);
23+
const properties = usePropsAsObjectProperties(props);
2424
2525
const { control } = useControl(ZoomSlider, properties, attrs);
2626
defineExpose({

0 commit comments

Comments
 (0)