Update flights-map barrel and MF expose from stub to real

Populate the feature barrel with all 4A-4D exports. Replace the
FlightsMap MF expose stub with lazy-loaded FlightsMapStartPage,
gated by the flightsMap feature flag.
This commit is contained in:
2026-04-15 09:43:54 +03:00
parent 0f5d7915be
commit a60494366f
2 changed files with 66 additions and 5 deletions
+39 -1
View File
@@ -1,2 +1,40 @@
// Public barrel for the flights-map feature. See frozen-barrels.md.
export {};
// 4A -- Types
export type {
FlightsMapSearchParams,
FlightsMapCalendarParams,
IFlightRoute,
IDestinationsResponse,
IFlightsMapDaysResponse,
IMapMarker,
IMapPolyline,
IMapPopup,
MarkerStyle,
PolylineStyle,
IFlightsMapFilterState,
} from "./types.js";
// 4A -- API functions
export { searchDestinations, getFlightsMapCalendar } from "./api.js";
// 4A -- React hooks
export { useFlightsMapSearch } from "./hooks/useFlightsMapSearch.js";
export type { UseFlightsMapSearchResult } from "./hooks/useFlightsMapSearch.js";
export { useFlightsMapCalendar } from "./hooks/useFlightsMapCalendar.js";
export type { UseFlightsMapCalendarResult } from "./hooks/useFlightsMapCalendar.js";
export { useFeatureFlag } from "./hooks/useFeatureFlag.js";
// 4D -- SEO builder functions
export { buildFlightsMapSeo } from "./seo.js";
export type { TFunction } from "./seo.js";
// 4D -- JSON-LD builder functions
export { buildFlightsMapJsonLd } from "./json-ld.js";
// 4C -- Feature-specific page components
export { FlightsMapStartPage } from "./components/FlightsMapStartPage.js";
export { FlightsMapFilter } from "./components/FlightsMapFilter.js";
export type { FlightsMapFilterProps } from "./components/FlightsMapFilter.js";
export { ClientOnly } from "./components/ClientOnly.js";
export type { ClientOnlyProps } from "./components/ClientOnly.js";
+27 -4
View File
@@ -1,17 +1,40 @@
import type { HostContract } from "@/host-contract";
/**
* MF expose wrapper for the Flights Map feature.
* Phase 4 (flights-map port) replaces the body with the real root.
*
* Lazy-loads the FlightsMapStartPage via React.lazy + Suspense.
* Gated by the flightsMap feature flag.
*/
import { lazy, Suspense } from "react";
import type { HostContract } from "@/host-contract";
import { useFeatureFlag } from "@/features/flights-map/hooks/useFeatureFlag.js";
const FlightsMapStartPage = lazy(() =>
import("@/features/flights-map/components/FlightsMapStartPage.js").then(
(m) => ({ default: m.FlightsMapStartPage }),
),
);
export interface FlightsMapRemoteProps {
hostContract: HostContract;
}
export default function FlightsMapRemote(_props: FlightsMapRemoteProps): JSX.Element {
const isEnabled = useFeatureFlag("flightsMap");
if (!isEnabled) {
return (
<div data-mf-expose="FlightsMap">
<p>Flights Map remote stub. Populated in Phase 4.</p>
<p>Flights Map is currently unavailable.</p>
</div>
);
}
return (
<div data-mf-expose="FlightsMap">
<Suspense fallback={<div aria-busy="true">Loading Flights Map...</div>}>
<FlightsMapStartPage />
</Suspense>
</div>
);
}