Description
runtime/i18n re-exports IntlShape, IntlConfig, and ResolvedIntlConfig, but not MessageDescriptor. Apps that type a message-carrying prop or context value have no way to name that type through @openedx/frontend-base, so they import it from react-intl directly, a package they do not declare and only resolve through hoisting.
src/dashboardConfig/DashboardConfigContext.tsx in frontend-app-instructor-dashboard is the motivating case: its DashboardConfig interface has titleMessage and headerMessage fields. openedx/frontend-app-instructor-dashboard#235 moved that repository's other undeclared react-intl import, IntlShape in src/dataDownloads/utils.ts, over to frontend-base and had to leave this one behind.
Adding type MessageDescriptor to the export list in runtime/i18n/index.ts, alongside the three types already there and surfaced through runtime/index.ts, would close the gap. defineMessages is already exported, so the type describing what it returns arguably should be too.
Description
runtime/i18nre-exportsIntlShape,IntlConfig, andResolvedIntlConfig, but notMessageDescriptor. Apps that type a message-carrying prop or context value have no way to name that type through@openedx/frontend-base, so they import it fromreact-intldirectly, a package they do not declare and only resolve through hoisting.src/dashboardConfig/DashboardConfigContext.tsxin frontend-app-instructor-dashboard is the motivating case: itsDashboardConfiginterface hastitleMessageandheaderMessagefields. openedx/frontend-app-instructor-dashboard#235 moved that repository's other undeclaredreact-intlimport,IntlShapeinsrc/dataDownloads/utils.ts, over to frontend-base and had to leave this one behind.Adding
type MessageDescriptorto the export list inruntime/i18n/index.ts, alongside the three types already there and surfaced throughruntime/index.ts, would close the gap.defineMessagesis already exported, so the type describing what it returns arguably should be too.