Retire the last one-cycle re-export in the dashboard composables

useDashboardAggregations re-exported lbl, aggregate, OTHER_KEY, otherLabel
and NEUTRAL from @map/composables/useFacetAggregation.js, so that callers
could migrate after kit landing 4c-1 moved the generic half to the library.
Five files were still importing through it. They now import from the library
directly and the re-export line is gone; what stays in this module — colorFor
and its facet branches, the religion palettes, the donut and bar builders —
is research-specific.

DashboardChartsRail keeps its three builders from here and takes the other
four symbols from the library, so the split is by what each symbol is, not
by which file is nearer.

NEUTRAL is still imported: colorFor and buildCountryRegionColors read it five
times as the "no palette for this key" colour. Kit landing 4c-1 updated the
re-export line and not the import beside it, and every read threw
ReferenceError until that was fixed — deleting a re-export is not the same as
deleting the import next to it, so the import stays and the now-unused lbl
and aggregate come out of it.

Rebuild-and-compare on dashboard-plus-grid: 821.50 kB before and after,
899,237 bytes both, and every string literal appears the same number of times
in each. The builds differ only in which short names the minifier assigned,
which is what a change of module order looks like.
This commit is contained in:
Doxa Maps 2026-09-29 06:01:44 +00:00
parent 5c54750d58
commit f2cdcd0b62
6 changed files with 18 additions and 16 deletions

View file

@ -8,7 +8,7 @@
* generically. Values are copied faithfully from the original research-dashboard so the
* migrated bundle behaves identically.
*/
import { lbl } from './src/composables/useDashboardAggregations.js'
import { lbl } from '@map/composables/useFacetAggregation.js'
import { tStatic } from '@map/i18n/index.js'
import { RELIGION_FAMILIES } from '@map/colors/religion.js'
import { canonicalFamilyName } from '@map/colors/language-family.js'

View file

@ -12,7 +12,8 @@ import { tStatic, getRuntimeLocale } from '@map/i18n/index.js'
*/
import { inject, computed, ref } from 'vue'
import { useShadowStyles } from '@map/composables/useShadowStyles.js'
import { aggregate, buildDonut, buildBars, lbl, buildCountryRegionColors, OTHER_KEY, otherLabel } from '../../composables/useDashboardAggregations.js'
import { buildDonut, buildBars, buildCountryRegionColors } from '../../composables/useDashboardAggregations.js'
import { aggregate, lbl, OTHER_KEY, otherLabel } from '@map/composables/useFacetAggregation.js'
import { buildSearchAccessors, makeSearchMatcher, filterRowsBySearch } from '@map/composables/useDashboardSearch.js'
/**

View file

@ -24,7 +24,7 @@ import { useShadowStyles } from '@map/composables/useShadowStyles.js'
import { useCsvExport } from '@map/composables/useCsvExport.js'
import { formatCount } from '@map/utils/formatCount.js'
import { useTreeLegendLabels } from '../../composables/useTreeLegendLabels.js'
import { lbl } from '../../composables/useDashboardAggregations.js'
import { lbl } from '@map/composables/useFacetAggregation.js'
const dash = inject('dashboardData', null)
const bus = inject('selectionBus', null)

View file

@ -28,7 +28,7 @@ import { useSelectionCamera } from '@map/composables/useSelectionCamera.js'
import MapToolbar from '@map/components/map-controls/MapToolbar.vue'
import ZoomInButton from '@map/components/map-controls/ZoomInButton.vue'
import ZoomOutButton from '@map/components/map-controls/ZoomOutButton.vue'
import { lbl } from '../../composables/useDashboardAggregations.js'
import { lbl } from '@map/composables/useFacetAggregation.js'
import { buildSearchAccessors, makeSearchMatcher, filterRowsBySearch } from '@map/composables/useDashboardSearch.js'
// ── THE PRAYER COLOUR STRATEGY, REUSED NOT RE-DERIVED ──
// applyColor() returns the SAME 3-tier expression the prayer map paints with, keyed off the

View file

@ -95,7 +95,7 @@ import SearchBar from '@map/components/search/SearchBar.vue'
// DashboardBreadcrumb is NOT imported here — it renders bus.filterSet, i.e. selection state, which
// this header must not show (see the ★ rule at the top). It remains exported from ./index.js.
import ShareButton from '@map/components/map-controls/ShareButton.vue'
import { lbl } from '../../composables/useDashboardAggregations.js'
import { lbl } from '@map/composables/useFacetAggregation.js'
const dash = inject('dashboardData', null)
const bus = inject('selectionBus', null)

View file

@ -49,17 +49,18 @@ import { PALETTE as RELIGION_PALETTE, RELIGION_FAMILIES, getReligionFamily } fro
* than re-implemented, so chart and pin can never drift.
*/
// ★ THE GENERIC HALF MOVED OUT (kit landing 4c-1) AND IS RE-EXPORTED HERE FOR ONE CYCLE.
// lbl() and aggregate() are pure counting and now live in @map/composables/useFacetAggregation.js.
// Everything still in this file — colorFor and its hardcoded facet branches, the religion palettes,
// the donut and bar builders — is research-specific and stays. DashboardChartsRail imports those and
// is untouched by this commit.
export { lbl, aggregate, OTHER_KEY, otherLabel, NEUTRAL } from '@map/composables/useFacetAggregation.js'
// NEUTRAL is imported as well as re-exported: colorFor() and buildCountryRegionColors() below read it
// five times as the "this facet has no palette for that key" colour. Kit landing 4c-1 moved it to the
// library and updated the re-export line but not this one, so every read threw ReferenceError and
// Big Picture's Religion and Region charts came up empty on both engines and both languages.
import { lbl, aggregate, NEUTRAL } from '@map/composables/useFacetAggregation.js'
// ★ THE GENERIC HALF LIVES IN THE LIBRARY. lbl() and aggregate() are pure counting and moved to
// @map/composables/useFacetAggregation.js in kit landing 4c-1, re-exported from here for one cycle
// so callers could migrate. That cycle is over: every caller now imports them from the library
// directly, so the re-export is gone. What remains in this file — colorFor and its facet branches,
// the religion palettes, the donut and bar builders — is research-specific and stays.
//
// NEUTRAL is still IMPORTED, because colorFor() and buildCountryRegionColors() below read it five
// times as the "this facet has no palette for that key" colour. When 4c-1 moved it to the library it
// updated the re-export line and not this import, so every read threw ReferenceError and Big
// Picture's Religion and Region charts came up empty on both engines and both languages. Deleting a
// re-export is not the same as deleting the import beside it.
import { NEUTRAL } from '@map/composables/useFacetAggregation.js'
// Place: the facet emits the localized label but the authoritative palette is slug-keyed