doxa-maps-cdn/embeddables/micro-frontends
Doxa Life abbd86d5e7 Keep the site's own files as upstream has them
Outside the maps folder, the two hidden pages and the three maps, the site is upstream's again: the card styles, the embeddables' legend and the devtools setting are restored, the laptop notes and the embed test page are removed, and DX-MAPS-GALLERY.md is the guide to what this branch changes.
2026-10-01 22:11:27 +00:00
..
1040-maps Keep the site's own files as upstream has them 2026-10-01 22:11:27 +00:00
README.md Maps: Fly, share, bug fixes (#8) 2026-05-28 10:13:51 -05:00

micro-frontends/

Full-application-sized custom elements (Vue + Vite) that bundle into single IIFE files and register as custom elements. Not to be confused with web-components/ (small/single-purpose things).

What lives here

  • _template/ — shared blueprint: components, composables, config loaders that every micro-frontend imports from. The leading underscore marks this as "not a shippable micro-frontend."
  • <name>/ — one folder per micro-frontend. Each has its own package.json, vite.config.js, src/. Built output goes either:
    • ../../public/js/<name>.iife.js (public — served at /js/<name>.iife.js)
    • ./app/<name>.iife.js (private — stays inside the widget, never served)

Naming

  • No -mfe suffix on folder names. The parent micro-frontends/ folder makes the category clear.
  • Custom-element tag name matches the folder name in kebab-case (e.g. <doxa-simple-map>).

Build

cd micro-frontends/doxa-simple-map
npm install
npm run build

Build output lands at doxa-life/public/js/doxa-simple-map.iife.js. Nuxt serves it as a static asset; any external site can <script src="https://doxa.life/js/doxa-simple-map.iife.js">.

Sharing via _template/

Each widget's vite.config.js adds an alias to the shared blueprint:

resolve: {
  alias: {
    '@':         fileURLToPath(new URL('./src', import.meta.url)),
    '@template': fileURLToPath(new URL('../_template/src', import.meta.url))
  }
}

Then import in code:

import Legend from '@template/components/Legend.vue'      // shared
import Profile from '@/app-profiles/doxa-simple-map.vue'   // local to this micro-frontend

Vite traces imports + tree-shakes — each micro-frontend bundles only what it actually imports.

See also

  • web-components/ — smaller, single-purpose custom elements.
  • doxa-life/public/js/ — where public bundles are served from.