Commit 07fd152
authored
refactor!: modularize, align component names and add tree-shaking support
### 🚨 Breaking Changes
#### Tree-Shaking Support & New Import Structure
- **Full tree-shaking support**: You can now import only the modules you need, significantly reducing bundle size.
- **New modular import syntax**: Import components from specific subpaths instead of the main package.
**Migration Examples:**
```js
// ❌ Old import syntax (v11 and below)
import { OlMap, OlTileLayer, OlSourceOSM } from "vue3-openlayers";
// ✅ New import syntax (v12+)
import { OlMap } from "vue3-openlayers/map";
import { OlTileLayer } from "vue3-openlayers/layers";
import { OlSourceOSM } from "vue3-openlayers/sources";
import { OlFullScreenControl } from "vue3-openlayers/controls";
import { OlStyle } from "vue3-openlayers/styles";
import { OlInteractionSelect } from "vue3-openlayers/interactions";
```
#### Component Renaming for Consistency
All components now use consistent **PascalCase** naming. Duplicate files with inconsistent casing have been removed.
**Source Components:**
- `OlSourceOsm` ➡️ renamed to **`OlSourceOSM`**
- `OlSourceBingmaps` ➡️ renamed to **`OlSourceBingMaps`**
- `OlSourceGeoTiff` ➡️ renamed to **`OlSourceGeoTIFF`**
- `OlSourceImageWms` ➡️ renamed to **`OlSourceImageWMS`**
- `OlSourceTileArcgisRest` ➡️ renamed to **`OlSourceTileArcGISRest`**
- `OlSourceTileJson` ➡️ renamed to **`OlSourceTileJSON`**
- `OlSourceTileWms` ➡️ renamed to **`OlSourceTileWMS`**
- `OlSourceWmts` ➡️ renamed to **`OlSourceWMTS`**
- `OlSourceXyz` ➡️ renamed to **`OlSourceXYZ`**
**Map Controls:**
- `OlFullscreenControl` ➡️ renamed to **`OlFullScreenControl`**
- `OlLayerswitcherControl` ➡️ renamed to **`OlLayerSwitcherControl`**
- `OlLayerswitcherimageControl` ➡️ renamed to **`OlLayerSwitcherImageControl`**
- `OlMousepositionControl` ➡️ renamed to **`OlMousePositionControl`**
- `OlOverviewmapControl` ➡️ renamed to **`OlOverviewMapControl`**
- `OlPrintdialogControl` ➡️ renamed to **`OlPrintDialogControl`**
- `OlScalelineControl` ➡️ renamed to **`OlScaleLineControl`**
- `OlVideorecorderControl` ➡️ renamed to **`OlVideoRecorderControl`**
- `OlZoomsliderControl` ➡️ renamed to **`OlZoomSliderControl`**
- `OlZoomtoextentControl` ➡️ renamed to **`OlZoomToExtentControl`**
**Interactions:**
- `OlInteractionClusterselect` ➡️ renamed to **`OlInteractionClusterSelect`**
- `OlInteractionDragbox` ➡️ renamed to **`OlInteractionDragBox`**
- `OlInteractionDragrotate` ➡️ renamed to **`OlInteractionDragRotate`**
- `OlInteractionDragrotatezoom` ➡️ renamed to **`OlInteractionDragRotateAndZoom`**
**Layers:**
- `OlAnimatedClusterlayer` ➡️ renamed to **`OlAnimatedClusterLayer`**
**Map Components:**
- `OlGeolocation` component location/naming has been updated
#### Styles No Longer Auto-Imported
- Styles are no longer automatically imported with the package
- You must explicitly import both OpenLayers and vue3-openlayers styles
```js
// Required imports for styles
import 'ol/ol.css';
import 'vue3-openlayers/vue3-openlayers.css';
```
#### Available Import Paths
The following subpaths are now available for tree-shaking:
- `vue3-openlayers/animations`
- `vue3-openlayers/composables`
- `vue3-openlayers/controls`
- `vue3-openlayers/geometries`
- `vue3-openlayers/helpers`
- `vue3-openlayers/interactions`
- `vue3-openlayers/layers`
- `vue3-openlayers/map`
- `vue3-openlayers/sources`
- `vue3-openlayers/styles`
### 🔧 Migration Guide
1. **Update imports**: Replace single-package imports with subpath imports
2. **Fix component names**: Update any components using the old inconsistent casing
3. **Add style imports**: Explicitly import CSS files where needed
4. **Review bundle**: Take advantage of smaller bundle sizes with selective imports
### ✨ Other Changes
- Internal refactoring for better modularity and future maintenance
- Documentation and examples updated to reflect new import patterns
- Improved TypeScript support with better type definitions for tree-shaken imports
- `package.json` exports configured for all new subpaths
- Removed duplicate component files to eliminate confusion
closes #3781 parent 07395b7 commit 07fd152
File tree
93 files changed
+1062
-1193
lines changed- docs
- .vitepress
- componentsguide
- geolocation
- interactions/clusterselect
- layers/animatedclusterlayer
- mapcontrols
- fullscreen
- layerswitcherimage
- layerswitcher
- mouseposition
- overviewmap
- printdialog
- videorecorder
- zoomslider
- zoomtoextent
- sources
- arcgisrest
- bing
- geotiff
- imagewms
- osm
- tilejson
- tilewms
- xyz
- src
- components
- animations
- geometries
- interaction
- layers
- mapControls
- map
- sources
- styles
- composables
- demos
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
93 files changed
+1062
-1193
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
2 | 45 | | |
3 | 46 | | |
4 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
0 commit comments