-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
isolate embed config into separate package
This allows us to not include all of coral-common into the embed.js, reducing its bundle size down to ~30 KB as it has been for the last few years. Now, we get both the benefits of a shared common/ lib as well as all the small embed size benefits.
- Loading branch information
Showing
21 changed files
with
600 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,14 @@ | ||
import { LanguageCode } from "./helpers"; | ||
import { | ||
EmbedBootstrapConfig as EBC, | ||
ReporterConfig as RC, | ||
SentryReporterConfig as SRC, | ||
StaticConfig as SC, | ||
} from "coral-config/config"; | ||
|
||
/** | ||
* SentryReporterConfig is the ReporterConfig for the Sentry service. | ||
*/ | ||
export interface SentryReporterConfig { | ||
name: "sentry"; | ||
export interface SentryReporterConfig extends SRC {} | ||
|
||
/** | ||
* dsn is the string representing this particular integration. | ||
*/ | ||
dsn: string; | ||
} | ||
export type ReporterConfig = RC; | ||
|
||
export type ReporterConfig = SentryReporterConfig; | ||
export interface StaticConfig extends SC {} | ||
|
||
/** | ||
* StaticConfig is the configuration provided to the client javascript via a | ||
* JSON blob on the HTML of the embedding page. | ||
*/ | ||
export interface StaticConfig { | ||
/** | ||
* staticURI is prepended to the static url's that are included on the static | ||
* pages. | ||
*/ | ||
staticURI: string; | ||
|
||
/** | ||
* tenantDomain is the domain of the currently requested tenant. | ||
*/ | ||
tenantDomain?: string; | ||
|
||
/** | ||
* reporter stores the reporter configuration for the current reporter | ||
* available. | ||
*/ | ||
reporter?: ReporterConfig; | ||
|
||
/** | ||
* graphQLSubscriptionURI is the endpoint that should be used when trying to | ||
* execute subscription GraphQL requests. If an empty string, the default | ||
* should be used that's based on the iFrame location. | ||
*/ | ||
graphQLSubscriptionURI: string; | ||
|
||
/** | ||
* featureFlags are all the feature flags currently enabled on the tenant. | ||
*/ | ||
featureFlags: string[]; | ||
|
||
/** | ||
* flattenReplies is whether or not flattenReplies is enabled on the tenant. | ||
*/ | ||
flattenReplies: boolean; | ||
|
||
/** | ||
* forceAdminLocalAuth is whether local authentication is always available | ||
* for this Coral deployment. This is useful for ensuring that Coral service | ||
* teams can access the admin with their Coral local authentication. | ||
*/ | ||
forceAdminLocalAuth: boolean; | ||
|
||
/** | ||
* archivingEnabled will be true when the deployment has set a valid MongoDB | ||
* URI for MONGODB_ARCHIVE_URI. | ||
*/ | ||
archivingEnabled: boolean; | ||
|
||
/** | ||
* autoArchiveOlderThanMs is the time in milliseconds that a story will | ||
* be kept before being auto-archived. | ||
*/ | ||
autoArchiveOlderThanMs: number; | ||
} | ||
|
||
export interface EmbedBootstrapConfig { | ||
locale: LanguageCode; | ||
assets: { | ||
js: { | ||
src: string; | ||
}[]; | ||
css: { | ||
src: string; | ||
}[]; | ||
}; | ||
customFontsCSSURL: string | undefined; | ||
customCSSURL: string | undefined; | ||
defaultFontsCSSURL: string | undefined; | ||
disableDefaultFonts: boolean; | ||
staticConfig: StaticConfig; | ||
} | ||
export interface EmbedBootstrapConfig extends EBC {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.d.ts | ||
*.graphql.ts | ||
**/__generated__/** | ||
docs/build | ||
docs/.docusaurus |
Oops, something went wrong.