Description
initialize() lets a site replace the logging, analytics and auth service implementations through its site config, reading loggingService, analyticsService and authService off getSiteConfig() and falling back to the built-in defaults when they are absent. The SiteConfig type does not know about any of them: OptionalSiteConfig in types.ts stops at segmentKey, so a config that sets one of these fails to compile even though the runtime would honor it.
The effect is that a documented extension point is unreachable from TypeScript. A site wanting its own logging service has to either cast its config or suppress the error, and neither is something we should be asking of it.
The fix is to declare the three properties on OptionalSiteConfig so the type matches what the runtime already accepts. This is a typing correction with no runtime component.
Discovered by an external contributor while configuring a custom logging service.
A fix is proposed in #281.
Description
initialize()lets a site replace the logging, analytics and auth service implementations through its site config, readingloggingService,analyticsServiceandauthServiceoffgetSiteConfig()and falling back to the built-in defaults when they are absent. TheSiteConfigtype does not know about any of them:OptionalSiteConfigintypes.tsstops atsegmentKey, so a config that sets one of these fails to compile even though the runtime would honor it.The effect is that a documented extension point is unreachable from TypeScript. A site wanting its own logging service has to either cast its config or suppress the error, and neither is something we should be asking of it.
The fix is to declare the three properties on
OptionalSiteConfigso the type matches what the runtime already accepts. This is a typing correction with no runtime component.Discovered by an external contributor while configuring a custom logging service.
A fix is proposed in #281.