@edx/frontend-platform 4.4.0 → 4.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config.js CHANGED
@@ -2,23 +2,122 @@
2
2
  * #### Import members from **@edx/frontend-platform**
3
3
  *
4
4
  * The configuration module provides utilities for working with an application's configuration
5
- * document (ConfigDocument). This module uses `process.env` to import configuration variables
6
- * from the command-line build process. It can be dynamically extended at run-time using a
7
- * `config` initialization handler. Please see the Initialization documentation for more
8
- * information on handlers and initialization phases.
5
+ * document (ConfigDocument). Configuration variables can be supplied to the
6
+ * application in four different ways. They are applied in the following order:
7
+ *
8
+ * - Build-time Configuration
9
+ * - Environment Variables
10
+ * - JavaScript File
11
+ * - Runtime Configuration
12
+ *
13
+ * Last one in wins. Variables with the same name defined via the later methods will override any
14
+ * defined using an earlier method. i.e., if a variable is defined in Runtime Configuration, that
15
+ * will override the same variable defined in either Build-time Configuration method (environment
16
+ * variables or JS file). Configuration defined in a JS file will override environment variables.
17
+ *
18
+ * ##### Build-time Configuration
19
+ *
20
+ * Build-time configuration methods add config variables into the app when it is built by webpack.
21
+ * This saves the app an API call and means it has all the information it needs to initialize right
22
+ * away. There are two methods of supplying build-time configuration: environment variables and a
23
+ * JavaScript file.
24
+ *
25
+ * ###### Environment Variables
26
+ *
27
+ * A set list of required config variables can be supplied as
28
+ * command-line environment variables during the build process.
29
+ *
30
+ * As a simple example, these are supplied on the command-line before invoking `npm run build`:
9
31
  *
10
32
  * ```
11
- * import { getConfig } from '@edx/frontend-platform';
33
+ * LMS_BASE_URL=http://localhost:18000 npm run build
34
+ * ```
12
35
  *
13
- * const {
14
- * BASE_URL,
15
- * LMS_BASE_URL,
16
- * LOGIN_URL,
17
- * LOGIN_URL,
18
- * REFRESH_ACCESS_TOKEN_ENDPOINT,
19
- * ACCESS_TOKEN_COOKIE_NAME,
20
- * CSRF_TOKEN_API_PATH,
21
- * } = getConfig();
36
+ * Note that additional variables _cannot_ be supplied via this method without using the `config`
37
+ * initialization handler. The app won't pick them up and they'll appear `undefined`.
38
+ *
39
+ * This configuration method is being deprecated in favor of JavaScript File Configuration.
40
+ *
41
+ * ###### JavaScript File Configuration
42
+ *
43
+ * Configuration variables can be supplied in an optional file named env.config.js. This file must
44
+ * export either an Object containing configuration variables or a function. The function must
45
+ * return an Object containing configuration variables or, alternately, a promise which resolves to
46
+ * an Object.
47
+ *
48
+ * Using a function or async function allows the configuration to be resolved at runtime (because
49
+ * the function will be executed at runtime). This is not common, and the capability is included
50
+ * for the sake of flexibility.
51
+ *
52
+ * JavaScript File Configuration is well-suited to extensibility use cases or component overrides,
53
+ * in that the configuration file can depend on any installed JavaScript module. It is also the
54
+ * preferred way of doing build-time configuration if runtime configuration isn't used by your
55
+ * deployment of the platform.
56
+ *
57
+ * Exporting a config object:
58
+ * ```
59
+ * const config = {
60
+ * LMS_BASE_URL: 'http://localhost:18000'
61
+ * };
62
+ *
63
+ * export default config;
64
+ * ```
65
+ *
66
+ * Exporting a function that returns an object:
67
+ * ```
68
+ * function getConfig() {
69
+ * return {
70
+ * LMS_BASE_URL: 'http://localhost:18000'
71
+ * };
72
+ * }
73
+ * ```
74
+ *
75
+ * Exporting a function that returns a promise that resolves to an object:
76
+ * ```
77
+ * function getAsyncConfig() {
78
+ * return new Promise((resolve, reject) => {
79
+ * resolve({
80
+ * LMS_BASE_URL: 'http://localhost:18000'
81
+ * });
82
+ * });
83
+ * }
84
+ *
85
+ * export default getAsyncConfig;
86
+ * ```
87
+ *
88
+ * ##### Runtime Configuration
89
+ *
90
+ * Configuration variables can also be supplied using the "runtime configuration" method, taking
91
+ * advantage of the Micro-frontend Config API in edx-platform. More information on this API can be
92
+ * found in the ADR which introduced it:
93
+ *
94
+ * https://github.com/openedx/edx-platform/blob/master/lms/djangoapps/mfe_config_api/docs/decisions/0001-mfe-config-api.rst
95
+ *
96
+ * The runtime configuration method can be enabled by supplying a MFE_CONFIG_API_URL via one of the other
97
+ * two configuration methods above.
98
+ *
99
+ * Runtime configuration is particularly useful if you need to supply different configurations to
100
+ * a single deployment of a micro-frontend, for instance. It is also a perfectly valid alternative
101
+ * to build-time configuration, though it introduces an additional API call to edx-platform on MFE
102
+ * initialization.
103
+ *
104
+ * ##### Initialization Config Handler
105
+ *
106
+ * The configuration document can be extended by
107
+ * applications at run-time using a `config` initialization handler. Please see the Initialization
108
+ * documentation for more information on handlers and initialization phases.
109
+ *
110
+ * ```
111
+ * initialize({
112
+ * handlers: {
113
+ * config: () => {
114
+ * mergeConfig({
115
+ * CUSTOM_VARIABLE: 'custom value',
116
+ * LMS_BASE_URL: 'http://localhost:18001' // You can override variables, but this is uncommon.
117
+ * }, 'App config override handler');
118
+ * },
119
+ * },
120
+ * });
22
121
  * ```
23
122
  *
24
123
  * @module Config
@@ -73,8 +172,17 @@ var config = {
73
172
 
74
173
  /**
75
174
  * Getter for the application configuration document. This is synchronous and merely returns a
76
- * reference to an existing object, and is thus safe to call as often as desired. The document
77
- * should have the following keys at a minimum:
175
+ * reference to an existing object, and is thus safe to call as often as desired.
176
+ *
177
+ * Example:
178
+ *
179
+ * ```
180
+ * import { getConfig } from '@edx/frontend-platform';
181
+ *
182
+ * const {
183
+ * LMS_BASE_URL,
184
+ * } = getConfig();
185
+ * ```
78
186
  *
79
187
  * @returns {ConfigDocument}
80
188
  */
@@ -88,6 +196,16 @@ export function getConfig() {
88
196
  * The supplied config document will be tested with `ensureDefinedConfig` to ensure it does not
89
197
  * have any `undefined` keys.
90
198
  *
199
+ * Example:
200
+ *
201
+ * ```
202
+ * import { setConfig } from '@edx/frontend-platform';
203
+ *
204
+ * setConfig({
205
+ * LMS_BASE_URL, // This is overriding the ENTIRE document - this is not merged in!
206
+ * });
207
+ * ```
208
+ *
91
209
  * @param {ConfigDocument} newConfig
92
210
  */
93
211
  export function setConfig(newConfig) {
@@ -155,7 +273,10 @@ export function ensureConfig(keys) {
155
273
  /**
156
274
  * An object describing the current application configuration.
157
275
  *
158
- * The implementation loads this document via `process.env` variables.
276
+ * In its most basic form, the initialization process loads this document via `process.env`
277
+ * variables. There are other ways to add configuration variables to the ConfigDocument as
278
+ * documented above (JavaScript File Configuration, Runtime Configuration, and the Initialization
279
+ * Config Handler)
159
280
  *
160
281
  * ```
161
282
  * {
package/config.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":["APP_CONFIG_INITIALIZED","CONFIG_CHANGED","publish","subscribe","ensureDefinedConfig","extractRegex","envVar","trim","RegExp","undefined","ENVIRONMENT","process","env","NODE_ENV","config","ACCESS_TOKEN_COOKIE_NAME","ACCOUNT_PROFILE_URL","ACCOUNT_SETTINGS_URL","BASE_URL","PUBLIC_PATH","CREDENTIALS_BASE_URL","CSRF_TOKEN_API_PATH","DISCOVERY_API_BASE_URL","PUBLISHER_BASE_URL","ECOMMERCE_BASE_URL","IGNORED_ERROR_REGEX","LANGUAGE_PREFERENCE_COOKIE_NAME","LEARNING_BASE_URL","LMS_BASE_URL","LOGIN_URL","LOGOUT_URL","STUDIO_BASE_URL","MARKETING_SITE_BASE_URL","ORDER_HISTORY_URL","REFRESH_ACCESS_TOKEN_ENDPOINT","SECURE_COOKIES","SEGMENT_KEY","SITE_NAME","USER_INFO_COOKIE_NAME","LOGO_URL","LOGO_TRADEMARK_URL","LOGO_WHITE_URL","FAVICON_URL","MFE_CONFIG_API_URL","APP_ID","SUPPORT_URL","getConfig","setConfig","newConfig","mergeConfig","Object","assign","ensureConfig","keys","requester","arguments","length","forEach","key","console","warn","concat"],"sources":["../src/config.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The configuration module provides utilities for working with an application's configuration\n * document (ConfigDocument). This module uses `process.env` to import configuration variables\n * from the command-line build process. It can be dynamically extended at run-time using a\n * `config` initialization handler. Please see the Initialization documentation for more\n * information on handlers and initialization phases.\n *\n * ```\n * import { getConfig } from '@edx/frontend-platform';\n *\n * const {\n * BASE_URL,\n * LMS_BASE_URL,\n * LOGIN_URL,\n * LOGIN_URL,\n * REFRESH_ACCESS_TOKEN_ENDPOINT,\n * ACCESS_TOKEN_COOKIE_NAME,\n * CSRF_TOKEN_API_PATH,\n * } = getConfig();\n * ```\n *\n * @module Config\n */\n\nimport { APP_CONFIG_INITIALIZED, CONFIG_CHANGED } from './constants';\n\nimport { publish, subscribe } from './pubSub';\nimport { ensureDefinedConfig } from './utils';\n\nfunction extractRegex(envVar) {\n // Convert the environment variable string to a regex, while guarding\n // against a non-string and an empty/whitespace-only string.\n if (typeof envVar === 'string' && envVar.trim() !== '') {\n return new RegExp(envVar);\n }\n return undefined;\n}\n\nconst ENVIRONMENT = process.env.NODE_ENV;\nlet config = {\n ACCESS_TOKEN_COOKIE_NAME: process.env.ACCESS_TOKEN_COOKIE_NAME,\n ACCOUNT_PROFILE_URL: process.env.ACCOUNT_PROFILE_URL,\n ACCOUNT_SETTINGS_URL: process.env.ACCOUNT_SETTINGS_URL,\n BASE_URL: process.env.BASE_URL,\n PUBLIC_PATH: process.env.PUBLIC_PATH || '/',\n CREDENTIALS_BASE_URL: process.env.CREDENTIALS_BASE_URL,\n CSRF_TOKEN_API_PATH: process.env.CSRF_TOKEN_API_PATH,\n DISCOVERY_API_BASE_URL: process.env.DISCOVERY_API_BASE_URL,\n PUBLISHER_BASE_URL: process.env.PUBLISHER_BASE_URL,\n ECOMMERCE_BASE_URL: process.env.ECOMMERCE_BASE_URL,\n ENVIRONMENT,\n IGNORED_ERROR_REGEX: extractRegex(process.env.IGNORED_ERROR_REGEX),\n LANGUAGE_PREFERENCE_COOKIE_NAME: process.env.LANGUAGE_PREFERENCE_COOKIE_NAME,\n LEARNING_BASE_URL: process.env.LEARNING_BASE_URL,\n LMS_BASE_URL: process.env.LMS_BASE_URL,\n LOGIN_URL: process.env.LOGIN_URL,\n LOGOUT_URL: process.env.LOGOUT_URL,\n STUDIO_BASE_URL: process.env.STUDIO_BASE_URL,\n MARKETING_SITE_BASE_URL: process.env.MARKETING_SITE_BASE_URL,\n ORDER_HISTORY_URL: process.env.ORDER_HISTORY_URL,\n REFRESH_ACCESS_TOKEN_ENDPOINT: process.env.REFRESH_ACCESS_TOKEN_ENDPOINT,\n SECURE_COOKIES: ENVIRONMENT !== 'development',\n SEGMENT_KEY: process.env.SEGMENT_KEY,\n SITE_NAME: process.env.SITE_NAME,\n USER_INFO_COOKIE_NAME: process.env.USER_INFO_COOKIE_NAME,\n LOGO_URL: process.env.LOGO_URL,\n LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,\n LOGO_WHITE_URL: process.env.LOGO_WHITE_URL,\n FAVICON_URL: process.env.FAVICON_URL,\n MFE_CONFIG_API_URL: process.env.MFE_CONFIG_API_URL,\n APP_ID: process.env.APP_ID,\n SUPPORT_URL: process.env.SUPPORT_URL,\n};\n\n/**\n * Getter for the application configuration document. This is synchronous and merely returns a\n * reference to an existing object, and is thus safe to call as often as desired. The document\n * should have the following keys at a minimum:\n *\n * @returns {ConfigDocument}\n */\nexport function getConfig() {\n return config;\n}\n\n/**\n * Replaces the existing ConfigDocument. This is not commonly used, but can be helpful for tests.\n *\n * The supplied config document will be tested with `ensureDefinedConfig` to ensure it does not\n * have any `undefined` keys.\n *\n * @param {ConfigDocument} newConfig\n */\nexport function setConfig(newConfig) {\n ensureDefinedConfig(config, 'config');\n config = newConfig;\n publish(CONFIG_CHANGED);\n}\n\n/**\n * Merges additional configuration values into the ConfigDocument returned by `getConfig`. Will\n * override any values that exist with the same keys.\n *\n * ```\n * mergeConfig({\n * NEW_KEY: 'new value',\n * OTHER_NEW_KEY: 'other new value',\n * });\n *\n * If any of the key values are `undefined`, an error will be logged to 'warn'.\n *\n * @param {Object} newConfig\n */\nexport function mergeConfig(newConfig) {\n ensureDefinedConfig(newConfig, 'ProcessEnvConfigService');\n config = Object.assign(config, newConfig);\n publish(CONFIG_CHANGED);\n}\n\n/**\n * A method allowing application code to indicate that particular ConfigDocument keys are required\n * for them to function. This is useful for diagnosing development/deployment issues, primarily,\n * by surfacing misconfigurations early. For instance, if the build process fails to supply an\n * environment variable on the command-line, it's possible that one of the `process.env` variables\n * will be undefined. Should be used in conjunction with `mergeConfig` for custom `ConfigDocument`\n * properties. Requester is for informational/error reporting purposes only.\n *\n * ```\n * ensureConfig(['LMS_BASE_URL', 'LOGIN_URL'], 'MySpecialComponent');\n *\n * // Will log a warning with:\n * // \"App configuration error: LOGIN_URL is required by MySpecialComponent.\"\n * // if LOGIN_URL is undefined, for example.\n * ```\n *\n * *NOTE*: `ensureConfig` waits until `APP_CONFIG_INITIALIZED` is published to verify the existence\n * of the specified properties. This means that this function is compatible with custom `config`\n * phase handlers responsible for loading additional configuration data in the initialization\n * sequence.\n *\n * @param {Array} keys\n * @param {string} [requester='unspecified application code']\n */\nexport function ensureConfig(keys, requester = 'unspecified application code') {\n subscribe(APP_CONFIG_INITIALIZED, () => {\n keys.forEach((key) => {\n if (config[key] === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`App configuration error: ${key} is required by ${requester}.`);\n }\n });\n });\n}\n\n/**\n * An object describing the current application configuration.\n *\n * The implementation loads this document via `process.env` variables.\n *\n * ```\n * {\n * BASE_URL: process.env.BASE_URL,\n * // ... other vars\n * }\n * ```\n *\n * When using Webpack (i.e., normal usage), the build process is responsible for supplying these\n * variables via command-line environment variables. That means they must be supplied at build\n * time.\n *\n * @name ConfigDocument\n * @memberof module:Config\n * @property {string} ACCESS_TOKEN_COOKIE_NAME\n * @property {string} ACCOUNT_PROFILE_URL\n * @property {string} ACCOUNT_SETTINGS_URL\n * @property {string} BASE_URL The URL of the current application.\n * @property {string} CREDENTIALS_BASE_URL\n * @property {string} CSRF_TOKEN_API_PATH\n * @property {string} DISCOVERY_API_BASE_URL\n * @property {string} PUBLISHER_BASE_URL\n * @property {string} ECOMMERCE_BASE_URL\n * @property {string} ENVIRONMENT This is one of: development, production, or test.\n * @property {string} IGNORED_ERROR_REGEX\n * @property {string} LANGUAGE_PREFERENCE_COOKIE_NAME\n * @property {string} LEARNING_BASE_URL\n * @property {string} LMS_BASE_URL\n * @property {string} LOGIN_URL\n * @property {string} LOGOUT_URL\n * @property {string} STUDIO_BASE_URL\n * @property {string} MARKETING_SITE_BASE_URL\n * @property {string} ORDER_HISTORY_URL\n * @property {string} REFRESH_ACCESS_TOKEN_ENDPOINT\n * @property {boolean} SECURE_COOKIES\n * @property {string} SEGMENT_KEY\n * @property {string} SITE_NAME\n * @property {string} USER_INFO_COOKIE_NAME\n * @property {string} LOGO_URL\n * @property {string} LOGO_TRADEMARK_URL\n * @property {string} LOGO_WHITE_URL\n * @property {string} FAVICON_URL\n * @property {string} MFE_CONFIG_API_URL\n * @property {string} APP_ID\n * @property {string} SUPPORT_URL\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,sBAAsB,EAAEC,cAAc,QAAQ,aAAa;AAEpE,SAASC,OAAO,EAAEC,SAAS,QAAQ,UAAU;AAC7C,SAASC,mBAAmB,QAAQ,SAAS;AAE7C,SAASC,YAAYA,CAACC,MAAM,EAAE;EAC5B;EACA;EACA,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAIA,MAAM,CAACC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;IACtD,OAAO,IAAIC,MAAM,CAACF,MAAM,CAAC;EAC3B;EACA,OAAOG,SAAS;AAClB;AAEA,IAAMC,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,QAAQ;AACxC,IAAIC,MAAM,GAAG;EACXC,wBAAwB,EAAEJ,OAAO,CAACC,GAAG,CAACG,wBAAwB;EAC9DC,mBAAmB,EAAEL,OAAO,CAACC,GAAG,CAACI,mBAAmB;EACpDC,oBAAoB,EAAEN,OAAO,CAACC,GAAG,CAACK,oBAAoB;EACtDC,QAAQ,EAAEP,OAAO,CAACC,GAAG,CAACM,QAAQ;EAC9BC,WAAW,EAAER,OAAO,CAACC,G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AAC4C,GAAG,CAAC,KAAKjD,SAAS,EAAE;QAC7B;QACAkD,OAAO,CAACC,IAAI,6BAAAC,MAAA,CAA6BH,GAAG,sBAAAG,MAAA,CAAmBP,SAAS,MAAG,CAAC;MAC9E;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
1
+ {"version":3,"file":"config.js","names":["APP_CONFIG_INITIALIZED","CONFIG_CHANGED","publish","subscribe","ensureDefinedConfig","extractRegex","envVar","trim","RegExp","undefined","ENVIRONMENT","process","env","NODE_ENV","config","ACCESS_TOKEN_COOKIE_NAME","ACCOUNT_PROFILE_URL","ACCOUNT_SETTINGS_URL","BASE_URL","PUBLIC_PATH","CREDENTIALS_BASE_URL","CSRF_TOKEN_API_PATH","DISCOVERY_API_BASE_URL","PUBLISHER_BASE_URL","ECOMMERCE_BASE_URL","IGNORED_ERROR_REGEX","LANGUAGE_PREFERENCE_COOKIE_NAME","LEARNING_BASE_URL","LMS_BASE_URL","LOGIN_URL","LOGOUT_URL","STUDIO_BASE_URL","MARKETING_SITE_BASE_URL","ORDER_HISTORY_URL","REFRESH_ACCESS_TOKEN_ENDPOINT","SECURE_COOKIES","SEGMENT_KEY","SITE_NAME","USER_INFO_COOKIE_NAME","LOGO_URL","LOGO_TRADEMARK_URL","LOGO_WHITE_URL","FAVICON_URL","MFE_CONFIG_API_URL","APP_ID","SUPPORT_URL","getConfig","setConfig","newConfig","mergeConfig","Object","assign","ensureConfig","keys","requester","arguments","length","forEach","key","console","warn","concat"],"sources":["../src/config.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The configuration module provides utilities for working with an application's configuration\n * document (ConfigDocument). Configuration variables can be supplied to the\n * application in four different ways. They are applied in the following order:\n *\n * - Build-time Configuration\n * - Environment Variables\n * - JavaScript File\n * - Runtime Configuration\n *\n * Last one in wins. Variables with the same name defined via the later methods will override any\n * defined using an earlier method. i.e., if a variable is defined in Runtime Configuration, that\n * will override the same variable defined in either Build-time Configuration method (environment\n * variables or JS file). Configuration defined in a JS file will override environment variables.\n *\n * ##### Build-time Configuration\n *\n * Build-time configuration methods add config variables into the app when it is built by webpack.\n * This saves the app an API call and means it has all the information it needs to initialize right\n * away. There are two methods of supplying build-time configuration: environment variables and a\n * JavaScript file.\n *\n * ###### Environment Variables\n *\n * A set list of required config variables can be supplied as\n * command-line environment variables during the build process.\n *\n * As a simple example, these are supplied on the command-line before invoking `npm run build`:\n *\n * ```\n * LMS_BASE_URL=http://localhost:18000 npm run build\n * ```\n *\n * Note that additional variables _cannot_ be supplied via this method without using the `config`\n * initialization handler. The app won't pick them up and they'll appear `undefined`.\n *\n * This configuration method is being deprecated in favor of JavaScript File Configuration.\n *\n * ###### JavaScript File Configuration\n *\n * Configuration variables can be supplied in an optional file named env.config.js. This file must\n * export either an Object containing configuration variables or a function. The function must\n * return an Object containing configuration variables or, alternately, a promise which resolves to\n * an Object.\n *\n * Using a function or async function allows the configuration to be resolved at runtime (because\n * the function will be executed at runtime). This is not common, and the capability is included\n * for the sake of flexibility.\n *\n * JavaScript File Configuration is well-suited to extensibility use cases or component overrides,\n * in that the configuration file can depend on any installed JavaScript module. It is also the\n * preferred way of doing build-time configuration if runtime configuration isn't used by your\n * deployment of the platform.\n *\n * Exporting a config object:\n * ```\n * const config = {\n * LMS_BASE_URL: 'http://localhost:18000'\n * };\n *\n * export default config;\n * ```\n *\n * Exporting a function that returns an object:\n * ```\n * function getConfig() {\n * return {\n * LMS_BASE_URL: 'http://localhost:18000'\n * };\n * }\n * ```\n *\n * Exporting a function that returns a promise that resolves to an object:\n * ```\n * function getAsyncConfig() {\n * return new Promise((resolve, reject) => {\n * resolve({\n * LMS_BASE_URL: 'http://localhost:18000'\n * });\n * });\n * }\n *\n * export default getAsyncConfig;\n * ```\n *\n * ##### Runtime Configuration\n *\n * Configuration variables can also be supplied using the \"runtime configuration\" method, taking\n * advantage of the Micro-frontend Config API in edx-platform. More information on this API can be\n * found in the ADR which introduced it:\n *\n * https://github.com/openedx/edx-platform/blob/master/lms/djangoapps/mfe_config_api/docs/decisions/0001-mfe-config-api.rst\n *\n * The runtime configuration method can be enabled by supplying a MFE_CONFIG_API_URL via one of the other\n * two configuration methods above.\n *\n * Runtime configuration is particularly useful if you need to supply different configurations to\n * a single deployment of a micro-frontend, for instance. It is also a perfectly valid alternative\n * to build-time configuration, though it introduces an additional API call to edx-platform on MFE\n * initialization.\n *\n * ##### Initialization Config Handler\n *\n * The configuration document can be extended by\n * applications at run-time using a `config` initialization handler. Please see the Initialization\n * documentation for more information on handlers and initialization phases.\n *\n * ```\n * initialize({\n * handlers: {\n * config: () => {\n * mergeConfig({\n * CUSTOM_VARIABLE: 'custom value',\n * LMS_BASE_URL: 'http://localhost:18001' // You can override variables, but this is uncommon.\n * }, 'App config override handler');\n * },\n * },\n * });\n * ```\n *\n * @module Config\n */\n\nimport { APP_CONFIG_INITIALIZED, CONFIG_CHANGED } from './constants';\n\nimport { publish, subscribe } from './pubSub';\nimport { ensureDefinedConfig } from './utils';\n\nfunction extractRegex(envVar) {\n // Convert the environment variable string to a regex, while guarding\n // against a non-string and an empty/whitespace-only string.\n if (typeof envVar === 'string' && envVar.trim() !== '') {\n return new RegExp(envVar);\n }\n return undefined;\n}\n\nconst ENVIRONMENT = process.env.NODE_ENV;\nlet config = {\n ACCESS_TOKEN_COOKIE_NAME: process.env.ACCESS_TOKEN_COOKIE_NAME,\n ACCOUNT_PROFILE_URL: process.env.ACCOUNT_PROFILE_URL,\n ACCOUNT_SETTINGS_URL: process.env.ACCOUNT_SETTINGS_URL,\n BASE_URL: process.env.BASE_URL,\n PUBLIC_PATH: process.env.PUBLIC_PATH || '/',\n CREDENTIALS_BASE_URL: process.env.CREDENTIALS_BASE_URL,\n CSRF_TOKEN_API_PATH: process.env.CSRF_TOKEN_API_PATH,\n DISCOVERY_API_BASE_URL: process.env.DISCOVERY_API_BASE_URL,\n PUBLISHER_BASE_URL: process.env.PUBLISHER_BASE_URL,\n ECOMMERCE_BASE_URL: process.env.ECOMMERCE_BASE_URL,\n ENVIRONMENT,\n IGNORED_ERROR_REGEX: extractRegex(process.env.IGNORED_ERROR_REGEX),\n LANGUAGE_PREFERENCE_COOKIE_NAME: process.env.LANGUAGE_PREFERENCE_COOKIE_NAME,\n LEARNING_BASE_URL: process.env.LEARNING_BASE_URL,\n LMS_BASE_URL: process.env.LMS_BASE_URL,\n LOGIN_URL: process.env.LOGIN_URL,\n LOGOUT_URL: process.env.LOGOUT_URL,\n STUDIO_BASE_URL: process.env.STUDIO_BASE_URL,\n MARKETING_SITE_BASE_URL: process.env.MARKETING_SITE_BASE_URL,\n ORDER_HISTORY_URL: process.env.ORDER_HISTORY_URL,\n REFRESH_ACCESS_TOKEN_ENDPOINT: process.env.REFRESH_ACCESS_TOKEN_ENDPOINT,\n SECURE_COOKIES: ENVIRONMENT !== 'development',\n SEGMENT_KEY: process.env.SEGMENT_KEY,\n SITE_NAME: process.env.SITE_NAME,\n USER_INFO_COOKIE_NAME: process.env.USER_INFO_COOKIE_NAME,\n LOGO_URL: process.env.LOGO_URL,\n LOGO_TRADEMARK_URL: process.env.LOGO_TRADEMARK_URL,\n LOGO_WHITE_URL: process.env.LOGO_WHITE_URL,\n FAVICON_URL: process.env.FAVICON_URL,\n MFE_CONFIG_API_URL: process.env.MFE_CONFIG_API_URL,\n APP_ID: process.env.APP_ID,\n SUPPORT_URL: process.env.SUPPORT_URL,\n};\n\n/**\n * Getter for the application configuration document. This is synchronous and merely returns a\n * reference to an existing object, and is thus safe to call as often as desired.\n *\n * Example:\n *\n * ```\n * import { getConfig } from '@edx/frontend-platform';\n *\n * const {\n * LMS_BASE_URL,\n * } = getConfig();\n * ```\n *\n * @returns {ConfigDocument}\n */\nexport function getConfig() {\n return config;\n}\n\n/**\n * Replaces the existing ConfigDocument. This is not commonly used, but can be helpful for tests.\n *\n * The supplied config document will be tested with `ensureDefinedConfig` to ensure it does not\n * have any `undefined` keys.\n *\n * Example:\n *\n * ```\n * import { setConfig } from '@edx/frontend-platform';\n *\n * setConfig({\n * LMS_BASE_URL, // This is overriding the ENTIRE document - this is not merged in!\n * });\n * ```\n *\n * @param {ConfigDocument} newConfig\n */\nexport function setConfig(newConfig) {\n ensureDefinedConfig(config, 'config');\n config = newConfig;\n publish(CONFIG_CHANGED);\n}\n\n/**\n * Merges additional configuration values into the ConfigDocument returned by `getConfig`. Will\n * override any values that exist with the same keys.\n *\n * ```\n * mergeConfig({\n * NEW_KEY: 'new value',\n * OTHER_NEW_KEY: 'other new value',\n * });\n *\n * If any of the key values are `undefined`, an error will be logged to 'warn'.\n *\n * @param {Object} newConfig\n */\nexport function mergeConfig(newConfig) {\n ensureDefinedConfig(newConfig, 'ProcessEnvConfigService');\n config = Object.assign(config, newConfig);\n publish(CONFIG_CHANGED);\n}\n\n/**\n * A method allowing application code to indicate that particular ConfigDocument keys are required\n * for them to function. This is useful for diagnosing development/deployment issues, primarily,\n * by surfacing misconfigurations early. For instance, if the build process fails to supply an\n * environment variable on the command-line, it's possible that one of the `process.env` variables\n * will be undefined. Should be used in conjunction with `mergeConfig` for custom `ConfigDocument`\n * properties. Requester is for informational/error reporting purposes only.\n *\n * ```\n * ensureConfig(['LMS_BASE_URL', 'LOGIN_URL'], 'MySpecialComponent');\n *\n * // Will log a warning with:\n * // \"App configuration error: LOGIN_URL is required by MySpecialComponent.\"\n * // if LOGIN_URL is undefined, for example.\n * ```\n *\n * *NOTE*: `ensureConfig` waits until `APP_CONFIG_INITIALIZED` is published to verify the existence\n * of the specified properties. This means that this function is compatible with custom `config`\n * phase handlers responsible for loading additional configuration data in the initialization\n * sequence.\n *\n * @param {Array} keys\n * @param {string} [requester='unspecified application code']\n */\nexport function ensureConfig(keys, requester = 'unspecified application code') {\n subscribe(APP_CONFIG_INITIALIZED, () => {\n keys.forEach((key) => {\n if (config[key] === undefined) {\n // eslint-disable-next-line no-console\n console.warn(`App configuration error: ${key} is required by ${requester}.`);\n }\n });\n });\n}\n\n/**\n * An object describing the current application configuration.\n *\n * In its most basic form, the initialization process loads this document via `process.env`\n * variables. There are other ways to add configuration variables to the ConfigDocument as\n * documented above (JavaScript File Configuration, Runtime Configuration, and the Initialization\n * Config Handler)\n *\n * ```\n * {\n * BASE_URL: process.env.BASE_URL,\n * // ... other vars\n * }\n * ```\n *\n * When using Webpack (i.e., normal usage), the build process is responsible for supplying these\n * variables via command-line environment variables. That means they must be supplied at build\n * time.\n *\n * @name ConfigDocument\n * @memberof module:Config\n * @property {string} ACCESS_TOKEN_COOKIE_NAME\n * @property {string} ACCOUNT_PROFILE_URL\n * @property {string} ACCOUNT_SETTINGS_URL\n * @property {string} BASE_URL The URL of the current application.\n * @property {string} CREDENTIALS_BASE_URL\n * @property {string} CSRF_TOKEN_API_PATH\n * @property {string} DISCOVERY_API_BASE_URL\n * @property {string} PUBLISHER_BASE_URL\n * @property {string} ECOMMERCE_BASE_URL\n * @property {string} ENVIRONMENT This is one of: development, production, or test.\n * @property {string} IGNORED_ERROR_REGEX\n * @property {string} LANGUAGE_PREFERENCE_COOKIE_NAME\n * @property {string} LEARNING_BASE_URL\n * @property {string} LMS_BASE_URL\n * @property {string} LOGIN_URL\n * @property {string} LOGOUT_URL\n * @property {string} STUDIO_BASE_URL\n * @property {string} MARKETING_SITE_BASE_URL\n * @property {string} ORDER_HISTORY_URL\n * @property {string} REFRESH_ACCESS_TOKEN_ENDPOINT\n * @property {boolean} SECURE_COOKIES\n * @property {string} SEGMENT_KEY\n * @property {string} SITE_NAME\n * @property {string} USER_INFO_COOKIE_NAME\n * @property {string} LOGO_URL\n * @property {string} LOGO_TRADEMARK_URL\n * @property {string} LOGO_WHITE_URL\n * @property {string} FAVICON_URL\n * @property {string} MFE_CONFIG_API_URL\n * @property {string} APP_ID\n * @property {string} SUPPORT_URL\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,sBAAsB,EAAEC,cAAc,QAAQ,aAAa;AAEpE,SAASC,OAAO,EAAEC,SAAS,QAAQ,UAAU;AAC7C,SAASC,mBAAmB,QAAQ,SAAS;AAE7C,SAASC,YAAYA,CAACC,MAAM,EAAE;EAC5B;EACA;EACA,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAIA,MAAM,CAACC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;IACtD,OAAO,IAAIC,MAAM,CAACF,MAAM,CAAC;EAC3B;EACA,OAAOG,SAAS;AAClB;AAEA,IAAMC,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,QAAQ;AACxC,IAAIC,MAAM,GAAG;EACXC,wBAAwB,EAAEJ,OAAO,CAACC,GAAG,CAACG,wBAAwB;EAC9DC,mBAAmB,EAAEL,OAAO,CAACC,GAAG,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3B,OAAO,CAACC,GAAG,CAAC0B,qBAAqB;EACxDC,QAAQ,EAAE5B,OAAO,CAACC,GAAG,CAAC2B,QAAQ;EAC9BC,kBAAkB,EAAE7B,OAAO,CAACC,GAAG,CAAC4B,kBAAkB;EAClDC,cAAc,EAAE9B,OAAO,CAACC,GAAG,CAAC6B,cAAc;EAC1CC,WAAW,EAAE/B,OAAO,CAACC,GAAG,CAAC8B,WAAW;EACpCC,kBAAkB,EAAEhC,OAAO,CAACC,GAAG,CAAC+B,kBAAkB;EAClDC,MAAM,EAAEjC,OAAO,CAACC,GAAG,CAACgC,MAAM;EAC1BC,WAAW,EAAElC,OAAO,CAACC,GAAG,CAACiC;AAC3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAAA,EAAG;EAC1B,OAAOhC,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASiC,SAASA,CAACC,SAAS,EAAE;EACnC5C,mBAAmB,CAACU,MAAM,EAAE,QAAQ,CAAC;EACrCA,MAAM,GAAGkC,SAAS;EAClB9C,OAAO,CAACD,cAAc,CAAC;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASgD,WAAWA,CAACD,SAAS,EAAE;EACrC5C,mBAAmB,CAAC4C,SAAS,EAAE,yBAAyB,CAAC;EACzDlC,MAAM,GAAGoC,MAAM,CAACC,MAAM,CAACrC,MAAM,EAAEkC,SAAS,CAAC;EACzC9C,OAAO,CAACD,cAAc,CAAC;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASmD,YAAYA,CAACC,IAAI,EAA8C;EAAA,IAA5CC,SAAS,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAA9C,SAAA,GAAA8C,SAAA,MAAG,8BAA8B;EAC3EpD,SAAS,CAACH,sBAAsB,EAAE,YAAM;IACtCqD,IAAI,CAACI,OAAO,CAAC,UAACC,GAAG,EAAK;MACpB,IAAI5C,MAAM,CAAC4C,GAAG,CAAC,KAAKjD,SAAS,EAAE;QAC7B;QACAkD,OAAO,CAACC,IAAI,6BAAAC,MAAA,CAA6BH,GAAG,sBAAAG,MAAA,CAAmBP,SAAS,MAAG,CAAC;MAC9E;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
package/initialize.js CHANGED
@@ -55,6 +55,15 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
55
55
  */
56
56
 
57
57
  import { createBrowserHistory, createMemoryHistory } from 'history';
58
+ /*
59
+ This 'env.config' package is a special 'magic' alias in our webpack configuration in frontend-build.
60
+ It points at an `env.config.js` file in the root of an MFE's repository if it exists and falls back
61
+ to an empty object `{}` if the file doesn't exist. This acts like an 'optional' import, in a sense.
62
+ Note that the env.config.js file in frontend-platform's root directory is NOT used by the actual
63
+ initialization code, it's just there for the test suite and example application.
64
+ */
65
+ import envConfig from 'env.config'; // eslint-disable-line import/no-unresolved
66
+
58
67
  import { publish } from './pubSub';
59
68
  // eslint-disable-next-line import/no-cycle
60
69
  import { getConfig, mergeConfig } from './config';
@@ -118,10 +127,14 @@ function _initError() {
118
127
  export function auth(_x2, _x3) {
119
128
  return _auth.apply(this, arguments);
120
129
  }
121
- /*
122
- * Set or overrides configuration through an API.
123
- * This method allows runtime configuration.
124
- * Set a basic configuration when an error happen and allow initError and display the ErrorPage.
130
+
131
+ /**
132
+ * Set or overrides configuration via an env.config.js file in the consuming application.
133
+ * This env.config.js is loaded at runtime and must export one of two things:
134
+ *
135
+ * - An object which will be merged into the application config via `mergeConfig`.
136
+ * - A function which returns an object which will be merged into the application config via
137
+ * `mergeConfig`. This function can return a promise.
125
138
  */
126
139
  function _auth() {
127
140
  _auth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(requireUser, hydrateUser) {
@@ -155,19 +168,56 @@ function _auth() {
155
168
  }));
156
169
  return _auth.apply(this, arguments);
157
170
  }
158
- export function runtimeConfig() {
171
+ function jsFileConfig() {
172
+ return _jsFileConfig.apply(this, arguments);
173
+ }
174
+ /*
175
+ * Set or overrides configuration through an API.
176
+ * This method allows runtime configuration.
177
+ * Set a basic configuration when an error happen and allow initError and display the ErrorPage.
178
+ */
179
+ function _jsFileConfig() {
180
+ _jsFileConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
181
+ var config;
182
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
183
+ while (1) switch (_context4.prev = _context4.next) {
184
+ case 0:
185
+ config = {};
186
+ if (!(typeof envConfig === 'function')) {
187
+ _context4.next = 7;
188
+ break;
189
+ }
190
+ _context4.next = 4;
191
+ return envConfig();
192
+ case 4:
193
+ config = _context4.sent;
194
+ _context4.next = 8;
195
+ break;
196
+ case 7:
197
+ config = envConfig;
198
+ case 8:
199
+ mergeConfig(config);
200
+ case 9:
201
+ case "end":
202
+ return _context4.stop();
203
+ }
204
+ }, _callee4);
205
+ }));
206
+ return _jsFileConfig.apply(this, arguments);
207
+ }
208
+ function runtimeConfig() {
159
209
  return _runtimeConfig.apply(this, arguments);
160
210
  }
161
211
  function _runtimeConfig() {
162
- _runtimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
212
+ _runtimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
163
213
  var _getConfig, MFE_CONFIG_API_URL, APP_ID, apiConfig, apiService, params, url, _yield$apiService$get, data;
164
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
165
- while (1) switch (_context4.prev = _context4.next) {
214
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
215
+ while (1) switch (_context5.prev = _context5.next) {
166
216
  case 0:
167
- _context4.prev = 0;
217
+ _context5.prev = 0;
168
218
  _getConfig = getConfig(), MFE_CONFIG_API_URL = _getConfig.MFE_CONFIG_API_URL, APP_ID = _getConfig.APP_ID;
169
219
  if (!MFE_CONFIG_API_URL) {
170
- _context4.next = 15;
220
+ _context5.next = 15;
171
221
  break;
172
222
  }
173
223
  apiConfig = {
@@ -175,32 +225,32 @@ function _runtimeConfig() {
175
225
  accept: 'application/json'
176
226
  }
177
227
  };
178
- _context4.next = 6;
228
+ _context5.next = 6;
179
229
  return configureCache();
180
230
  case 6:
181
- apiService = _context4.sent;
231
+ apiService = _context5.sent;
182
232
  params = new URLSearchParams();
183
233
  params.append('mfe', APP_ID);
184
234
  url = "".concat(MFE_CONFIG_API_URL, "?").concat(params.toString());
185
- _context4.next = 12;
235
+ _context5.next = 12;
186
236
  return apiService.get(url, apiConfig);
187
237
  case 12:
188
- _yield$apiService$get = _context4.sent;
238
+ _yield$apiService$get = _context5.sent;
189
239
  data = _yield$apiService$get.data;
190
240
  mergeConfig(data);
191
241
  case 15:
192
- _context4.next = 20;
242
+ _context5.next = 20;
193
243
  break;
194
244
  case 17:
195
- _context4.prev = 17;
196
- _context4.t0 = _context4["catch"](0);
245
+ _context5.prev = 17;
246
+ _context5.t0 = _context5["catch"](0);
197
247
  // eslint-disable-next-line no-console
198
- console.error('Error with config API', _context4.t0.message);
248
+ console.error('Error with config API', _context5.t0.message);
199
249
  case 20:
200
250
  case "end":
201
- return _context4.stop();
251
+ return _context5.stop();
202
252
  }
203
- }, _callee4, null, [[0, 17]]);
253
+ }, _callee5, null, [[0, 17]]);
204
254
  }));
205
255
  return _runtimeConfig.apply(this, arguments);
206
256
  }
@@ -223,27 +273,27 @@ export function analytics() {
223
273
  return _analytics.apply(this, arguments);
224
274
  }
225
275
  function _analytics() {
226
- _analytics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
276
+ _analytics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
227
277
  var authenticatedUser;
228
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
229
- while (1) switch (_context5.prev = _context5.next) {
278
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
279
+ while (1) switch (_context6.prev = _context6.next) {
230
280
  case 0:
231
281
  authenticatedUser = getAuthenticatedUser();
232
282
  if (!(authenticatedUser && authenticatedUser.userId)) {
233
- _context5.next = 5;
283
+ _context6.next = 5;
234
284
  break;
235
285
  }
236
286
  identifyAuthenticatedUser(authenticatedUser.userId);
237
- _context5.next = 7;
287
+ _context6.next = 7;
238
288
  break;
239
289
  case 5:
240
- _context5.next = 7;
290
+ _context6.next = 7;
241
291
  return identifyAnonymousUser();
242
292
  case 7:
243
293
  case "end":
244
- return _context5.stop();
294
+ return _context6.stop();
245
295
  }
246
- }, _callee5);
296
+ }, _callee6);
247
297
  }));
248
298
  return _analytics.apply(this, arguments);
249
299
  }
@@ -326,60 +376,70 @@ export function initialize(_x4) {
326
376
  return _initialize.apply(this, arguments);
327
377
  }
328
378
  function _initialize() {
329
- _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref2) {
330
- var _ref2$loggingService, loggingService, _ref2$analyticsServic, analyticsService, _ref2$authService, authService, _ref2$authMiddleware, authMiddleware, _ref2$externalScripts, externalScripts, _ref2$requireAuthenti, requireUser, _ref2$hydrateAuthenti, hydrateUser, messages, _ref2$handlers, overrideHandlers, handlers;
331
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
332
- while (1) switch (_context6.prev = _context6.next) {
379
+ _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_ref2) {
380
+ var _ref2$loggingService, loggingService, _ref2$analyticsServic, analyticsService, _ref2$authService, authService, _ref2$authMiddleware, authMiddleware, _ref2$externalScripts, externalScripts, _ref2$requireAuthenti, requireUser, _ref2$hydrateAuthenti, hydrateUser, messages, _ref2$handlers, overrideHandlers, handlers, loggingServiceImpl, analyticsServiceImpl, authServiceImpl;
381
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
382
+ while (1) switch (_context7.prev = _context7.next) {
333
383
  case 0:
334
384
  _ref2$loggingService = _ref2.loggingService, loggingService = _ref2$loggingService === void 0 ? NewRelicLoggingService : _ref2$loggingService, _ref2$analyticsServic = _ref2.analyticsService, analyticsService = _ref2$analyticsServic === void 0 ? SegmentAnalyticsService : _ref2$analyticsServic, _ref2$authService = _ref2.authService, authService = _ref2$authService === void 0 ? AxiosJwtAuthService : _ref2$authService, _ref2$authMiddleware = _ref2.authMiddleware, authMiddleware = _ref2$authMiddleware === void 0 ? [] : _ref2$authMiddleware, _ref2$externalScripts = _ref2.externalScripts, externalScripts = _ref2$externalScripts === void 0 ? [GoogleAnalyticsLoader] : _ref2$externalScripts, _ref2$requireAuthenti = _ref2.requireAuthenticatedUser, requireUser = _ref2$requireAuthenti === void 0 ? false : _ref2$requireAuthenti, _ref2$hydrateAuthenti = _ref2.hydrateAuthenticatedUser, hydrateUser = _ref2$hydrateAuthenti === void 0 ? false : _ref2$hydrateAuthenti, messages = _ref2.messages, _ref2$handlers = _ref2.handlers, overrideHandlers = _ref2$handlers === void 0 ? {} : _ref2$handlers;
335
385
  handlers = applyOverrideHandlers(overrideHandlers);
336
- _context6.prev = 2;
337
- _context6.next = 5;
386
+ _context7.prev = 2;
387
+ _context7.next = 5;
338
388
  return handlers.pubSub();
339
389
  case 5:
340
390
  publish(APP_PUBSUB_INITIALIZED);
341
391
 
342
392
  // Configuration
343
- _context6.next = 8;
393
+ _context7.next = 8;
344
394
  return handlers.config();
345
395
  case 8:
346
- _context6.next = 10;
347
- return runtimeConfig();
396
+ _context7.next = 10;
397
+ return jsFileConfig();
348
398
  case 10:
399
+ _context7.next = 12;
400
+ return runtimeConfig();
401
+ case 12:
349
402
  publish(APP_CONFIG_INITIALIZED);
350
403
  loadExternalScripts(externalScripts, {
351
404
  config: getConfig()
352
405
  });
353
406
 
354
- // Logging
355
- configureLogging(loggingService, {
407
+ // This allows us to replace the implementations of the logging, analytics, and auth services
408
+ // based on keys in the ConfigDocument. The JavaScript File Configuration method is the only
409
+ // one capable of supplying an alternate implementation since it can import other modules.
410
+ // If a service wasn't supplied we fall back to the default parameters on the initialize
411
+ // function signature.
412
+ loggingServiceImpl = getConfig().loggingService || loggingService;
413
+ analyticsServiceImpl = getConfig().analyticsService || analyticsService;
414
+ authServiceImpl = getConfig().authService || authService; // Logging
415
+ configureLogging(loggingServiceImpl, {
356
416
  config: getConfig()
357
417
  });
358
- _context6.next = 15;
418
+ _context7.next = 20;
359
419
  return handlers.logging();
360
- case 15:
420
+ case 20:
361
421
  publish(APP_LOGGING_INITIALIZED);
362
422
 
363
423
  // Authentication
364
- configureAuth(authService, {
424
+ configureAuth(authServiceImpl, {
365
425
  loggingService: getLoggingService(),
366
426
  config: getConfig(),
367
427
  middleware: authMiddleware
368
428
  });
369
- _context6.next = 19;
429
+ _context7.next = 24;
370
430
  return handlers.auth(requireUser, hydrateUser);
371
- case 19:
431
+ case 24:
372
432
  publish(APP_AUTH_INITIALIZED);
373
433
 
374
434
  // Analytics
375
- configureAnalytics(analyticsService, {
435
+ configureAnalytics(analyticsServiceImpl, {
376
436
  config: getConfig(),
377
437
  loggingService: getLoggingService(),
378
438
  httpClient: getAuthenticatedHttpClient()
379
439
  });
380
- _context6.next = 23;
440
+ _context7.next = 28;
381
441
  return handlers.analytics();
382
- case 23:
442
+ case 28:
383
443
  publish(APP_ANALYTICS_INITIALIZED);
384
444
 
385
445
  // Internationalization
@@ -388,34 +448,34 @@ function _initialize() {
388
448
  config: getConfig(),
389
449
  loggingService: getLoggingService()
390
450
  });
391
- _context6.next = 27;
451
+ _context7.next = 32;
392
452
  return handlers.i18n();
393
- case 27:
453
+ case 32:
394
454
  publish(APP_I18N_INITIALIZED);
395
455
 
396
456
  // Application Ready
397
- _context6.next = 30;
457
+ _context7.next = 35;
398
458
  return handlers.ready();
399
- case 30:
459
+ case 35:
400
460
  publish(APP_READY);
401
- _context6.next = 39;
461
+ _context7.next = 44;
402
462
  break;
403
- case 33:
404
- _context6.prev = 33;
405
- _context6.t0 = _context6["catch"](2);
406
- if (_context6.t0.isRedirecting) {
407
- _context6.next = 39;
463
+ case 38:
464
+ _context7.prev = 38;
465
+ _context7.t0 = _context7["catch"](2);
466
+ if (_context7.t0.isRedirecting) {
467
+ _context7.next = 44;
408
468
  break;
409
469
  }
410
- _context6.next = 38;
411
- return handlers.initError(_context6.t0);
412
- case 38:
413
- publish(APP_INIT_ERROR, _context6.t0);
414
- case 39:
470
+ _context7.next = 43;
471
+ return handlers.initError(_context7.t0);
472
+ case 43:
473
+ publish(APP_INIT_ERROR, _context7.t0);
474
+ case 44:
415
475
  case "end":
416
- return _context6.stop();
476
+ return _context7.stop();
417
477
  }
418
- }, _callee6, null, [[2, 33]]);
478
+ }, _callee7, null, [[2, 38]]);
419
479
  }));
420
480
  return _initialize.apply(this, arguments);
421
481
  }
package/initialize.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"initialize.js","names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","createBrowserHistory","createMemoryHistory","publish","getConfig","mergeConfig","configure","configureLogging","getLoggingService","NewRelicLoggingService","logError","configureAnalytics","SegmentAnalyticsService","identifyAnonymousUser","identifyAuthenticatedUser","GoogleAnalyticsLoader","getAuthenticatedHttpClient","configureAuth","ensureAuthenticatedUser","fetchAuthenticatedUser","hydrateAuthenticatedUser","getAuthenticatedUser","AxiosJwtAuthService","configureI18n","APP_PUBSUB_INITIALIZED","APP_CONFIG_INITIALIZED","APP_AUTH_INITIALIZED","APP_I18N_INITIALIZED","APP_LOGGING_INITIALIZED","APP_ANALYTICS_INITIALIZED","APP_READY","APP_INIT_ERROR","configureCache","history","window","basename","PUBLIC_PATH","initError","_x","_initError","_callee2","_callee2$","_context2","auth","_x2","_x3","_auth","_callee3","requireUser","hydrateUser","_callee3$","_context3","global","location","href","runtimeConfig","_runtimeConfig","_callee4","_getConfig","MFE_CONFIG_API_URL","APP_ID","apiConfig","apiService","params","url","_yield$apiService$get","data","_callee4$","_context4","headers","accept","URLSearchParams","append","concat","toString","get","t0","console","message","loadExternalScripts","externalScripts","ExternalScript","script","loadScript","analytics","_analytics","_callee5","authenticatedUser","_callee5$","_context5","userId","applyOverrideHandlers","overrides","noOp","_ref","_callee","_callee$","_context","_objectSpread","pubSub","config","logging","i18n","ready","initialize","_x4","_initialize","_callee6","_ref2","_ref2$loggingService","loggingService","_ref2$analyticsServic","analyticsService","_ref2$authService","authService","_ref2$authMiddleware","authMiddleware","_ref2$externalScripts","_ref2$requireAuthenti","_ref2$hydrateAuthenti","messages","_ref2$handlers","overrideHandlers","handlers","_callee6$","_context6","requireAuthenticatedUser","middleware","httpClient","isRedirecting"],"sources":["../src/initialize.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The initialization module provides a function for managing an application's initialization\n * lifecycle. It also provides constants and default handler implementations.\n *\n * ```\n * import {\n * initialize,\n * APP_INIT_ERROR,\n * APP_READY,\n * subscribe,\n * } from '@edx/frontend-platform';\n * import { AppProvider, ErrorPage, PageRoute } from '@edx/frontend-platform/react';\n * import React from 'react';\n * import ReactDOM from 'react-dom';\n * import { Switch } from 'react-router-dom';\n *\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider store={configureStore()}>\n * <Header />\n * <main>\n * <Switch>\n * <PageRoute exact path=\"/\" component={PaymentPage} />\n * </Switch>\n * </main>\n * <Footer />\n * </AppProvider>,\n * document.getElementById('root'),\n * );\n * });\n *\n * subscribe(APP_INIT_ERROR, (error) => {\n * ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));\n * });\n *\n * initialize({\n * messages: [appMessages],\n * requireAuthenticatedUser: true,\n * hydrateAuthenticatedUser: true,\n * });\n\n```\n * @module Initialization\n */\n\nimport { createBrowserHistory, createMemoryHistory } from 'history';\nimport {\n publish,\n} from './pubSub';\n// eslint-disable-next-line import/no-cycle\nimport {\n getConfig, mergeConfig,\n} from './config';\nimport {\n configure as configureLogging, getLoggingService, NewRelicLoggingService, logError,\n} from './logging';\nimport {\n configure as configureAnalytics, SegmentAnalyticsService, identifyAnonymousUser, identifyAuthenticatedUser,\n} from './analytics';\nimport { GoogleAnalyticsLoader } from './scripts';\nimport {\n getAuthenticatedHttpClient,\n configure as configureAuth,\n ensureAuthenticatedUser,\n fetchAuthenticatedUser,\n hydrateAuthenticatedUser,\n getAuthenticatedUser,\n AxiosJwtAuthService,\n} from './auth';\nimport { configure as configureI18n } from './i18n';\nimport {\n APP_PUBSUB_INITIALIZED,\n APP_CONFIG_INITIALIZED,\n APP_AUTH_INITIALIZED,\n APP_I18N_INITIALIZED,\n APP_LOGGING_INITIALIZED,\n APP_ANALYTICS_INITIALIZED,\n APP_READY, APP_INIT_ERROR,\n} from './constants';\nimport configureCache from './auth/LocalForageCache';\n\n/**\n * A browser history or memory history object created by the [history](https://github.com/ReactTraining/history)\n * package. Applications are encouraged to use this history object, rather than creating their own,\n * as behavior may be undefined when managing history via multiple mechanisms/instances. Note that\n * in environments where browser history may be inaccessible due to `window` being undefined, this\n * falls back to memory history.\n */\nexport const history = (typeof window !== 'undefined')\n ? createBrowserHistory({\n basename: getConfig().PUBLIC_PATH,\n }) : createMemoryHistory();\n\n/**\n * The default handler for the initialization lifecycle's `initError` phase. Logs the error to the\n * LoggingService using `logError`\n *\n * @see {@link module:frontend-platform/logging~logError}\n * @param {*} error\n */\nexport async function initError(error) {\n logError(error);\n}\n\n/**\n * The default handler for the initialization lifecycle's `auth` phase.\n *\n * The handler has several responsibilities:\n * - Determining the user's authentication state (authenticated or anonymous)\n * - Optionally redirecting to login if the application requires an authenticated user.\n * - Optionally loading additional user information via the application's user account data\n * endpoint.\n *\n * @param {boolean} requireUser Whether or not we should redirect to login if a user is not\n * authenticated.\n * @param {boolean} hydrateUser Whether or not we should fetch additional user account data.\n */\nexport async function auth(requireUser, hydrateUser) {\n if (requireUser) {\n await ensureAuthenticatedUser(global.location.href);\n } else {\n await fetchAuthenticatedUser();\n }\n\n if (hydrateUser && getAuthenticatedUser() !== null) {\n // We intentionally do not await the promise returned by hydrateAuthenticatedUser. All the\n // critical data is returned as part of fetch/ensureAuthenticatedUser above, and anything else\n // is a nice-to-have for application code.\n hydrateAuthenticatedUser();\n }\n}\n/*\n * Set or overrides configuration through an API.\n * This method allows runtime configuration.\n * Set a basic configuration when an error happen and allow initError and display the ErrorPage.\n */\n\nexport async function runtimeConfig() {\n try {\n const { MFE_CONFIG_API_URL, APP_ID } = getConfig();\n\n if (MFE_CONFIG_API_URL) {\n const apiConfig = { headers: { accept: 'application/json' } };\n const apiService = await configureCache();\n\n const params = new URLSearchParams();\n params.append('mfe', APP_ID);\n const url = `${MFE_CONFIG_API_URL}?${params.toString()}`;\n\n const { data } = await apiService.get(url, apiConfig);\n mergeConfig(data);\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error with config API', error.message);\n }\n}\n\nexport function loadExternalScripts(externalScripts, data) {\n externalScripts.forEach(ExternalScript => {\n const script = new ExternalScript(data);\n script.loadScript();\n });\n}\n\n/**\n * The default handler for the initialization lifecycle's `analytics` phase.\n *\n * The handler is responsible for identifying authenticated and anonymous users with the analytics\n * service. This is a pre-requisite for sending analytics events, thus, we do it during the\n * initialization sequence so that analytics is ready once the application's UI code starts to load.\n *\n */\nexport async function analytics() {\n const authenticatedUser = getAuthenticatedUser();\n if (authenticatedUser && authenticatedUser.userId) {\n identifyAuthenticatedUser(authenticatedUser.userId);\n } else {\n await identifyAnonymousUser();\n }\n}\n\nfunction applyOverrideHandlers(overrides) {\n const noOp = async () => { };\n return {\n pubSub: noOp,\n config: noOp,\n logging: noOp,\n auth,\n analytics,\n i18n: noOp,\n ready: noOp,\n initError,\n ...overrides, // This will override any same-keyed handlers from above.\n };\n}\n\n/**\n * Invokes the application initialization sequence.\n *\n * The sequence proceeds through a number of lifecycle phases, during which pertinent services are\n * configured.\n *\n * Using the `handlers` option, lifecycle phase handlers can be overridden to perform custom\n * functionality. Note that while these override handlers _do_ replace the default handler\n * functionality for analytics, auth, and initError (the other phases have no default\n * functionality), they do _not_ override the configuration of the actual services that those\n * handlers leverage.\n *\n * Some services can be overridden via the loggingService and analyticsService options. The other\n * services (auth and i18n) cannot currently be overridden.\n *\n * The following lifecycle phases exist:\n *\n * - pubSub: A no-op by default.\n * - config: A no-op by default.\n * - logging: A no-op by default.\n * - auth: Uses the 'auth' handler defined above.\n * - analytics: Uses the 'analytics' handler defined above.\n * - i18n: A no-op by default.\n * - ready: A no-op by default.\n * - initError: Uses the 'initError' handler defined above.\n *\n * @param {Object} [options]\n * @param {*} [options.loggingService=NewRelicLoggingService] The `LoggingService` implementation\n * to use.\n * @param {*} [options.analyticsService=SegmentAnalyticsService] The `AnalyticsService`\n * implementation to use.\n * @param {*} [options.authMiddleware=[]] An array of middleware to apply to http clients in the auth service.\n * @param {*} [options.externalScripts=[GoogleAnalyticsLoader]] An array of externalScripts.\n * By default added GoogleAnalyticsLoader.\n * @param {*} [options.requireAuthenticatedUser=false] If true, turns on automatic login\n * redirection for unauthenticated users. Defaults to false, meaning that by default the\n * application will allow anonymous/unauthenticated sessions.\n * @param {*} [options.hydrateAuthenticatedUser=false] If true, makes an API call to the user\n * account endpoint (`${App.config.LMS_BASE_URL}/api/user/v1/accounts/${username}`) to fetch\n * detailed account information for the authenticated user. This data is merged into the return\n * value of `getAuthenticatedUser`, overriding any duplicate keys that already exist. Defaults to\n * false, meaning that no additional account information will be loaded.\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {*} [options.handlers={}] An optional object of handlers which can be used to replace the\n * default behavior of any part of the startup sequence. It can also be used to add additional\n * initialization behavior before or after the rest of the sequence.\n */\nexport async function initialize({\n loggingService = NewRelicLoggingService,\n analyticsService = SegmentAnalyticsService,\n authService = AxiosJwtAuthService,\n authMiddleware = [],\n externalScripts = [GoogleAnalyticsLoader],\n requireAuthenticatedUser: requireUser = false,\n hydrateAuthenticatedUser: hydrateUser = false,\n messages,\n handlers: overrideHandlers = {},\n}) {\n const handlers = applyOverrideHandlers(overrideHandlers);\n try {\n // Pub/Sub\n await handlers.pubSub();\n publish(APP_PUBSUB_INITIALIZED);\n\n // Configuration\n await handlers.config();\n await runtimeConfig();\n publish(APP_CONFIG_INITIALIZED);\n\n loadExternalScripts(externalScripts, {\n config: getConfig(),\n });\n\n // Logging\n configureLogging(loggingService, {\n config: getConfig(),\n });\n await handlers.logging();\n publish(APP_LOGGING_INITIALIZED);\n\n // Authentication\n configureAuth(authService, {\n loggingService: getLoggingService(),\n config: getConfig(),\n middleware: authMiddleware,\n });\n\n await handlers.auth(requireUser, hydrateUser);\n publish(APP_AUTH_INITIALIZED);\n\n // Analytics\n configureAnalytics(analyticsService, {\n config: getConfig(),\n loggingService: getLoggingService(),\n httpClient: getAuthenticatedHttpClient(),\n });\n await handlers.analytics();\n publish(APP_ANALYTICS_INITIALIZED);\n\n // Internationalization\n configureI18n({\n messages,\n config: getConfig(),\n loggingService: getLoggingService(),\n });\n await handlers.i18n();\n publish(APP_I18N_INITIALIZED);\n\n // Application Ready\n await handlers.ready();\n publish(APP_READY);\n } catch (error) {\n if (!error.isRedirecting) {\n // Initialization Error\n await handlers.initError(error);\n publish(APP_INIT_ERROR, error);\n }\n }\n}\n"],"mappings":";;;;;;+CACA,qJAAAA,mBAAA,YAAAA,oBAAA,WAAAC,OAAA,SAAAA,OAAA,OAAAC,EAAA,GAAAC,MAAA,CAAAC,SAAA,EAAAC,MAAA,GAAAH,EAAA,CAAAI,cAAA,EAAAC,cAAA,GAAAJ,MAAA,CAAAI,cAAA,cAAAC,GAAA,EAAAC,GAAA,EAAAC,IAAA,IAAAF,GAAA,CAAAC,GAAA,IAAAC,IAAA,CAAAC,KAAA,KAAAC,OAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,cAAA,GAAAF,OAAA,CAAAG,QAAA,kBAAAC,mBAAA,GAAAJ,OAAA,CAAAK,aAAA,uBAAAC,iBAAA,GAAAN,OAAA,CAAAO,WAAA,8BAAAC,OAAAZ,GAAA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AK,CAAC,CAAC;QAAA;UACtBpG,OAAO,CAAC2B,SAAS,CAAC;UAAC+F,SAAA,CAAA5L,IAAA;UAAA;QAAA;UAAA4L,SAAA,CAAAtJ,IAAA;UAAAsJ,SAAA,CAAAjD,EAAA,GAAAiD,SAAA;UAAA,IAEdA,SAAA,CAAAjD,EAAA,CAAMqD,aAAa;YAAAJ,SAAA,CAAA5L,IAAA;YAAA;UAAA;UAAA4L,SAAA,CAAA5L,IAAA;UAAA,OAEhB0L,QAAQ,CAACtF,SAAS,CAAAwF,SAAA,CAAAjD,EAAM,CAAC;QAAA;UAC/BzE,OAAO,CAAC4B,cAAc,EAAA8F,SAAA,CAAAjD,EAAO,CAAC;QAAC;QAAA;UAAA,OAAAiD,SAAA,CAAAnJ,IAAA;MAAA;IAAA,GAAAiI,QAAA;EAAA,CAGpC;EAAA,OAAAD,WAAA,CAAA1G,KAAA,OAAAD,SAAA;AAAA"}
1
+ {"version":3,"file":"initialize.js","names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","createBrowserHistory","createMemoryHistory","envConfig","publish","getConfig","mergeConfig","configure","configureLogging","getLoggingService","NewRelicLoggingService","logError","configureAnalytics","SegmentAnalyticsService","identifyAnonymousUser","identifyAuthenticatedUser","GoogleAnalyticsLoader","getAuthenticatedHttpClient","configureAuth","ensureAuthenticatedUser","fetchAuthenticatedUser","hydrateAuthenticatedUser","getAuthenticatedUser","AxiosJwtAuthService","configureI18n","APP_PUBSUB_INITIALIZED","APP_CONFIG_INITIALIZED","APP_AUTH_INITIALIZED","APP_I18N_INITIALIZED","APP_LOGGING_INITIALIZED","APP_ANALYTICS_INITIALIZED","APP_READY","APP_INIT_ERROR","configureCache","history","window","basename","PUBLIC_PATH","initError","_x","_initError","_callee2","_callee2$","_context2","auth","_x2","_x3","_auth","_callee3","requireUser","hydrateUser","_callee3$","_context3","global","location","href","jsFileConfig","_jsFileConfig","_callee4","config","_callee4$","_context4","runtimeConfig","_runtimeConfig","_callee5","_getConfig","MFE_CONFIG_API_URL","APP_ID","apiConfig","apiService","params","url","_yield$apiService$get","data","_callee5$","_context5","headers","accept","URLSearchParams","append","concat","toString","get","t0","console","message","loadExternalScripts","externalScripts","ExternalScript","script","loadScript","analytics","_analytics","_callee6","authenticatedUser","_callee6$","_context6","userId","applyOverrideHandlers","overrides","noOp","_ref","_callee","_callee$","_context","_objectSpread","pubSub","logging","i18n","ready","initialize","_x4","_initialize","_callee7","_ref2","_ref2$loggingService","loggingService","_ref2$analyticsServic","analyticsService","_ref2$authService","authService","_ref2$authMiddleware","authMiddleware","_ref2$externalScripts","_ref2$requireAuthenti","_ref2$hydrateAuthenti","messages","_ref2$handlers","overrideHandlers","handlers","loggingServiceImpl","analyticsServiceImpl","authServiceImpl","_callee7$","_context7","requireAuthenticatedUser","middleware","httpClient","isRedirecting"],"sources":["../src/initialize.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The initialization module provides a function for managing an application's initialization\n * lifecycle. It also provides constants and default handler implementations.\n *\n * ```\n * import {\n * initialize,\n * APP_INIT_ERROR,\n * APP_READY,\n * subscribe,\n * } from '@edx/frontend-platform';\n * import { AppProvider, ErrorPage, PageRoute } from '@edx/frontend-platform/react';\n * import React from 'react';\n * import ReactDOM from 'react-dom';\n * import { Switch } from 'react-router-dom';\n *\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider store={configureStore()}>\n * <Header />\n * <main>\n * <Switch>\n * <PageRoute exact path=\"/\" component={PaymentPage} />\n * </Switch>\n * </main>\n * <Footer />\n * </AppProvider>,\n * document.getElementById('root'),\n * );\n * });\n *\n * subscribe(APP_INIT_ERROR, (error) => {\n * ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));\n * });\n *\n * initialize({\n * messages: [appMessages],\n * requireAuthenticatedUser: true,\n * hydrateAuthenticatedUser: true,\n * });\n\n```\n * @module Initialization\n */\n\nimport { createBrowserHistory, createMemoryHistory } from 'history';\n/*\nThis 'env.config' package is a special 'magic' alias in our webpack configuration in frontend-build.\nIt points at an `env.config.js` file in the root of an MFE's repository if it exists and falls back\nto an empty object `{}` if the file doesn't exist. This acts like an 'optional' import, in a sense.\nNote that the env.config.js file in frontend-platform's root directory is NOT used by the actual\ninitialization code, it's just there for the test suite and example application.\n*/\nimport envConfig from 'env.config'; // eslint-disable-line import/no-unresolved\n\nimport {\n publish,\n} from './pubSub';\n// eslint-disable-next-line import/no-cycle\nimport {\n getConfig, mergeConfig,\n} from './config';\nimport {\n configure as configureLogging, getLoggingService, NewRelicLoggingService, logError,\n} from './logging';\nimport {\n configure as configureAnalytics, SegmentAnalyticsService, identifyAnonymousUser, identifyAuthenticatedUser,\n} from './analytics';\nimport { GoogleAnalyticsLoader } from './scripts';\nimport {\n getAuthenticatedHttpClient,\n configure as configureAuth,\n ensureAuthenticatedUser,\n fetchAuthenticatedUser,\n hydrateAuthenticatedUser,\n getAuthenticatedUser,\n AxiosJwtAuthService,\n} from './auth';\nimport { configure as configureI18n } from './i18n';\nimport {\n APP_PUBSUB_INITIALIZED,\n APP_CONFIG_INITIALIZED,\n APP_AUTH_INITIALIZED,\n APP_I18N_INITIALIZED,\n APP_LOGGING_INITIALIZED,\n APP_ANALYTICS_INITIALIZED,\n APP_READY, APP_INIT_ERROR,\n} from './constants';\nimport configureCache from './auth/LocalForageCache';\n\n/**\n * A browser history or memory history object created by the [history](https://github.com/ReactTraining/history)\n * package. Applications are encouraged to use this history object, rather than creating their own,\n * as behavior may be undefined when managing history via multiple mechanisms/instances. Note that\n * in environments where browser history may be inaccessible due to `window` being undefined, this\n * falls back to memory history.\n */\nexport const history = (typeof window !== 'undefined')\n ? createBrowserHistory({\n basename: getConfig().PUBLIC_PATH,\n }) : createMemoryHistory();\n\n/**\n * The default handler for the initialization lifecycle's `initError` phase. Logs the error to the\n * LoggingService using `logError`\n *\n * @see {@link module:frontend-platform/logging~logError}\n * @param {*} error\n */\nexport async function initError(error) {\n logError(error);\n}\n\n/**\n * The default handler for the initialization lifecycle's `auth` phase.\n *\n * The handler has several responsibilities:\n * - Determining the user's authentication state (authenticated or anonymous)\n * - Optionally redirecting to login if the application requires an authenticated user.\n * - Optionally loading additional user information via the application's user account data\n * endpoint.\n *\n * @param {boolean} requireUser Whether or not we should redirect to login if a user is not\n * authenticated.\n * @param {boolean} hydrateUser Whether or not we should fetch additional user account data.\n */\nexport async function auth(requireUser, hydrateUser) {\n if (requireUser) {\n await ensureAuthenticatedUser(global.location.href);\n } else {\n await fetchAuthenticatedUser();\n }\n\n if (hydrateUser && getAuthenticatedUser() !== null) {\n // We intentionally do not await the promise returned by hydrateAuthenticatedUser. All the\n // critical data is returned as part of fetch/ensureAuthenticatedUser above, and anything else\n // is a nice-to-have for application code.\n hydrateAuthenticatedUser();\n }\n}\n\n/**\n * Set or overrides configuration via an env.config.js file in the consuming application.\n * This env.config.js is loaded at runtime and must export one of two things:\n *\n * - An object which will be merged into the application config via `mergeConfig`.\n * - A function which returns an object which will be merged into the application config via\n * `mergeConfig`. This function can return a promise.\n */\nasync function jsFileConfig() {\n let config = {};\n if (typeof envConfig === 'function') {\n config = await envConfig();\n } else {\n config = envConfig;\n }\n\n mergeConfig(config);\n}\n\n/*\n * Set or overrides configuration through an API.\n * This method allows runtime configuration.\n * Set a basic configuration when an error happen and allow initError and display the ErrorPage.\n */\nasync function runtimeConfig() {\n try {\n const { MFE_CONFIG_API_URL, APP_ID } = getConfig();\n\n if (MFE_CONFIG_API_URL) {\n const apiConfig = { headers: { accept: 'application/json' } };\n const apiService = await configureCache();\n\n const params = new URLSearchParams();\n params.append('mfe', APP_ID);\n const url = `${MFE_CONFIG_API_URL}?${params.toString()}`;\n\n const { data } = await apiService.get(url, apiConfig);\n mergeConfig(data);\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error with config API', error.message);\n }\n}\n\nexport function loadExternalScripts(externalScripts, data) {\n externalScripts.forEach(ExternalScript => {\n const script = new ExternalScript(data);\n script.loadScript();\n });\n}\n\n/**\n * The default handler for the initialization lifecycle's `analytics` phase.\n *\n * The handler is responsible for identifying authenticated and anonymous users with the analytics\n * service. This is a pre-requisite for sending analytics events, thus, we do it during the\n * initialization sequence so that analytics is ready once the application's UI code starts to load.\n *\n */\nexport async function analytics() {\n const authenticatedUser = getAuthenticatedUser();\n if (authenticatedUser && authenticatedUser.userId) {\n identifyAuthenticatedUser(authenticatedUser.userId);\n } else {\n await identifyAnonymousUser();\n }\n}\n\nfunction applyOverrideHandlers(overrides) {\n const noOp = async () => { };\n return {\n pubSub: noOp,\n config: noOp,\n logging: noOp,\n auth,\n analytics,\n i18n: noOp,\n ready: noOp,\n initError,\n ...overrides, // This will override any same-keyed handlers from above.\n };\n}\n\n/**\n * Invokes the application initialization sequence.\n *\n * The sequence proceeds through a number of lifecycle phases, during which pertinent services are\n * configured.\n *\n * Using the `handlers` option, lifecycle phase handlers can be overridden to perform custom\n * functionality. Note that while these override handlers _do_ replace the default handler\n * functionality for analytics, auth, and initError (the other phases have no default\n * functionality), they do _not_ override the configuration of the actual services that those\n * handlers leverage.\n *\n * Some services can be overridden via the loggingService and analyticsService options. The other\n * services (auth and i18n) cannot currently be overridden.\n *\n * The following lifecycle phases exist:\n *\n * - pubSub: A no-op by default.\n * - config: A no-op by default.\n * - logging: A no-op by default.\n * - auth: Uses the 'auth' handler defined above.\n * - analytics: Uses the 'analytics' handler defined above.\n * - i18n: A no-op by default.\n * - ready: A no-op by default.\n * - initError: Uses the 'initError' handler defined above.\n *\n * @param {Object} [options]\n * @param {*} [options.loggingService=NewRelicLoggingService] The `LoggingService` implementation\n * to use.\n * @param {*} [options.analyticsService=SegmentAnalyticsService] The `AnalyticsService`\n * implementation to use.\n * @param {*} [options.authMiddleware=[]] An array of middleware to apply to http clients in the auth service.\n * @param {*} [options.externalScripts=[GoogleAnalyticsLoader]] An array of externalScripts.\n * By default added GoogleAnalyticsLoader.\n * @param {*} [options.requireAuthenticatedUser=false] If true, turns on automatic login\n * redirection for unauthenticated users. Defaults to false, meaning that by default the\n * application will allow anonymous/unauthenticated sessions.\n * @param {*} [options.hydrateAuthenticatedUser=false] If true, makes an API call to the user\n * account endpoint (`${App.config.LMS_BASE_URL}/api/user/v1/accounts/${username}`) to fetch\n * detailed account information for the authenticated user. This data is merged into the return\n * value of `getAuthenticatedUser`, overriding any duplicate keys that already exist. Defaults to\n * false, meaning that no additional account information will be loaded.\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {*} [options.handlers={}] An optional object of handlers which can be used to replace the\n * default behavior of any part of the startup sequence. It can also be used to add additional\n * initialization behavior before or after the rest of the sequence.\n */\nexport async function initialize({\n loggingService = NewRelicLoggingService,\n analyticsService = SegmentAnalyticsService,\n authService = AxiosJwtAuthService,\n authMiddleware = [],\n externalScripts = [GoogleAnalyticsLoader],\n requireAuthenticatedUser: requireUser = false,\n hydrateAuthenticatedUser: hydrateUser = false,\n messages,\n handlers: overrideHandlers = {},\n}) {\n const handlers = applyOverrideHandlers(overrideHandlers);\n try {\n // Pub/Sub\n await handlers.pubSub();\n publish(APP_PUBSUB_INITIALIZED);\n\n // Configuration\n await handlers.config();\n await jsFileConfig();\n await runtimeConfig();\n publish(APP_CONFIG_INITIALIZED);\n\n loadExternalScripts(externalScripts, {\n config: getConfig(),\n });\n\n // This allows us to replace the implementations of the logging, analytics, and auth services\n // based on keys in the ConfigDocument. The JavaScript File Configuration method is the only\n // one capable of supplying an alternate implementation since it can import other modules.\n // If a service wasn't supplied we fall back to the default parameters on the initialize\n // function signature.\n const loggingServiceImpl = getConfig().loggingService || loggingService;\n const analyticsServiceImpl = getConfig().analyticsService || analyticsService;\n const authServiceImpl = getConfig().authService || authService;\n\n // Logging\n configureLogging(loggingServiceImpl, {\n config: getConfig(),\n });\n await handlers.logging();\n publish(APP_LOGGING_INITIALIZED);\n\n // Authentication\n configureAuth(authServiceImpl, {\n loggingService: getLoggingService(),\n config: getConfig(),\n middleware: authMiddleware,\n });\n\n await handlers.auth(requireUser, hydrateUser);\n publish(APP_AUTH_INITIALIZED);\n\n // Analytics\n configureAnalytics(analyticsServiceImpl, {\n config: getConfig(),\n loggingService: getLoggingService(),\n httpClient: getAuthenticatedHttpClient(),\n });\n await handlers.analytics();\n publish(APP_ANALYTICS_INITIALIZED);\n\n // Internationalization\n configureI18n({\n messages,\n config: getConfig(),\n loggingService: getLoggingService(),\n });\n await handlers.i18n();\n publish(APP_I18N_INITIALIZED);\n\n // Application Ready\n await handlers.ready();\n publish(APP_READY);\n } catch (error) {\n if (!error.isRedirecting) {\n // Initialization Error\n await handlers.initError(error);\n publish(APP_INIT_ERROR, error);\n }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UAAU,EAAExH,0BAA0B,CAAC;UACzC,CAAC,CAAC;UAACqH,SAAA,CAAArM,IAAA;UAAA,OACGgM,QAAQ,CAACtC,SAAS,CAAC,CAAC;QAAA;UAC1BvF,OAAO,CAAC0B,yBAAyB,CAAC;;UAElC;UACAN,aAAa,CAAC;YACZsG,QAAQ,EAARA,QAAQ;YACRnE,MAAM,EAAEtD,SAAS,CAAC,CAAC;YACnB+G,cAAc,EAAE3G,iBAAiB,CAAC;UACpC,CAAC,CAAC;UAAC6H,SAAA,CAAArM,IAAA;UAAA,OACGgM,QAAQ,CAACrB,IAAI,CAAC,CAAC;QAAA;UACrBxG,OAAO,CAACwB,oBAAoB,CAAC;;UAE7B;UAAA0G,SAAA,CAAArM,IAAA;UAAA,OACMgM,QAAQ,CAACpB,KAAK,CAAC,CAAC;QAAA;UACtBzG,OAAO,CAAC2B,SAAS,CAAC;UAACuG,SAAA,CAAArM,IAAA;UAAA;QAAA;UAAAqM,SAAA,CAAA/J,IAAA;UAAA+J,SAAA,CAAAnD,EAAA,GAAAmD,SAAA;UAAA,IAEdA,SAAA,CAAAnD,EAAA,CAAMuD,aAAa;YAAAJ,SAAA,CAAArM,IAAA;YAAA;UAAA;UAAAqM,SAAA,CAAArM,IAAA;UAAA,OAEhBgM,QAAQ,CAAC3F,SAAS,CAAAgG,SAAA,CAAAnD,EAAM,CAAC;QAAA;UAC/B/E,OAAO,CAAC4B,cAAc,EAAAsG,SAAA,CAAAnD,EAAO,CAAC;QAAC;QAAA;UAAA,OAAAmD,SAAA,CAAA5J,IAAA;MAAA;IAAA,GAAAuI,QAAA;EAAA,CAGpC;EAAA,OAAAD,WAAA,CAAAhH,KAAA,OAAAD,SAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edx/frontend-platform",
3
- "version": "4.4.0",
3
+ "version": "4.5.1",
4
4
  "description": "Foundational application framework for Open edX micro-frontend applications.",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -34,7 +34,7 @@
34
34
  "devDependencies": {
35
35
  "@edx/brand": "npm:@edx/brand-openedx@1.2.0",
36
36
  "@edx/browserslist-config": "1.2.0",
37
- "@edx/frontend-build": "12.8.27",
37
+ "@edx/frontend-build": "12.8.38",
38
38
  "@edx/paragon": "^20.30.1",
39
39
  "@testing-library/react-hooks": "^8.0.1",
40
40
  "axios-mock-adapter": "^1.21.3",
@@ -53,7 +53,7 @@
53
53
  "regenerator-runtime": "0.13.11"
54
54
  },
55
55
  "dependencies": {
56
- "@cospired/i18n-iso-languages": "2.2.0",
56
+ "@cospired/i18n-iso-languages": "4.1.0",
57
57
  "@formatjs/intl-pluralrules": "4.3.3",
58
58
  "@formatjs/intl-relativetimeformat": "10.0.1",
59
59
  "axios": "0.27.2",
@@ -74,6 +74,7 @@
74
74
  "universal-cookie": "4.0.4"
75
75
  },
76
76
  "peerDependencies": {
77
+ "@edx/frontend-build": ">= 8.1.0",
77
78
  "@edx/paragon": ">= 10.0.0 < 21.0.0",
78
79
  "prop-types": "^15.7.2",
79
80
  "react": "^16.9.0 || ^17.0.0",