Skip to content

Commit

Permalink
Fix bundling issue with Leaflet, v2.6.2 (really)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Nov 3, 2021
1 parent 2df6472 commit 84fbd60
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved UX for blocks (context-sensitive cursors etc.)
- Rendering of data types has been improved
- Process return values consisting of multiple data types don't always return `any`
- Don't include Leaflet multiple times (bundles got larger starting with v2.6.0)

## [2.6.1] - 2021-09-07

Expand Down
4 changes: 1 addition & 3 deletions components/Collection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,12 @@
import Utils from '../utils';
import { Formatters } from '@radiantearth/stac-fields';
import StacMixin from './internal/StacMixin.js';
import StacAsset from './internal/StacAsset.vue';
import { isoDuration, en } from '@musement/iso-duration';
export default {
name: 'Collection',
components: {
ObjectTree: () => import('./ObjectTree.vue'),
StacAsset
ObjectTree: () => import('./ObjectTree.vue')
},
mixins: [StacMixin],
// Mixins don't work properly in web components,
Expand Down
4 changes: 0 additions & 4 deletions components/Item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,12 @@
</template>

<script>
import StacAsset from './internal/StacAsset.vue';
import StacMixin from './internal/StacMixin.js';
import Utils from '../utils';
export default {
name: 'Item',
mixins: [StacMixin],
components: {
StacAsset
},
// Mixins don't work properly in web components,
// see https://github.com/vuejs/vue-web-component-wrapper/issues/30
props: {...StacMixin.props},
Expand Down
3 changes: 2 additions & 1 deletion components/internal/StacMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
Description: () => import('../Description.vue'),
DeprecationNotice: () => import('../DeprecationNotice.vue'),
LinkList: () => import('../LinkList.vue'),
StacAsset: () => import('../internal/StacAsset.vue'),
StacFields: () => import('../internal/StacFields.vue')
},
props: {
Expand Down Expand Up @@ -110,7 +111,7 @@ export default {
// is running. For all other cases store Leaflet in this.map.leaflet, which can be used in other places.
let hasLeaflet = () => Utils.isObject(window.L) && Versions.validate(window.L.version) && Versions.compare(window.L.version, "1.x.x", "=");
if (!hasLeaflet()) {
window.L = require('leaflet');
window.L = await import('leaflet');
}
if (!hasLeaflet()) {
console.warn("Leaflet is not available");
Expand Down

0 comments on commit 84fbd60

Please sign in to comment.