|
40 | 40 | *
|
41 | 41 | * ###### JavaScript File Configuration
|
42 | 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. |
| 43 | + * Configuration variables can be supplied in an optional file named env.config.js (it can also be |
| 44 | + * a `.jsx`, `.ts`, or `.tsx` file). This file must export either an Object containing configuration |
| 45 | + * variables or a function. The function must return an Object containing configuration variables or, |
| 46 | + * alternatively, a promise which resolves to an Object. |
47 | 47 | *
|
48 | 48 | * Using a function or async function allows the configuration to be resolved at runtime (because
|
49 | 49 | * the function will be executed at runtime). This is not common, and the capability is included
|
|
89 | 89 | *
|
90 | 90 | * Configuration variables can also be supplied using the "runtime configuration" method, taking
|
91 | 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: |
| 92 | + * found in [the ADR which introduced it][1]. |
93 | 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 |
| 94 | + * The runtime configuration method can be enabled by supplying a `MFE_CONFIG_API_URL` via one of the other |
97 | 95 | * two configuration methods above.
|
98 | 96 | *
|
99 | 97 | * Runtime configuration is particularly useful if you need to supply different configurations to
|
|
103 | 101 | *
|
104 | 102 | * ##### Initialization Config Handler
|
105 | 103 | *
|
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. |
| 104 | + * The configuration document can be extended by applications at run-time using a `config` |
| 105 | + * initialization handler. Please see the Initialization documentation for more information on |
| 106 | + * handlers and initialization phases. |
109 | 107 | *
|
110 | 108 | * ```
|
111 | 109 | * initialize({
|
|
114 | 112 | * mergeConfig({
|
115 | 113 | * CUSTOM_VARIABLE: 'custom value',
|
116 | 114 | * LMS_BASE_URL: 'http://localhost:18001' // You can override variables, but this is uncommon.
|
117 |
| - * }, 'App config override handler'); |
| 115 | + * }, 'App config override handler'); |
118 | 116 | * },
|
119 | 117 | * },
|
120 | 118 | * });
|
121 | 119 | * ```
|
122 | 120 | *
|
123 | 121 | * @module Config
|
| 122 | + * |
| 123 | + * [1]: https://github.com/openedx/edx-platform/blob/master/lms/djangoapps/mfe_config_api/docs/decisions/0001-mfe-config-api.rst |
124 | 124 | */
|
125 | 125 |
|
126 | 126 | import { APP_CONFIG_INITIALIZED, CONFIG_CHANGED } from './constants';
|
@@ -223,7 +223,7 @@ let config = {
|
223 | 223 | * ```
|
224 | 224 | *
|
225 | 225 | * @returns {ConfigDocument}
|
226 |
| - */ |
| 226 | + */ |
227 | 227 | export function getConfig() {
|
228 | 228 | return config;
|
229 | 229 | }
|
@@ -313,7 +313,7 @@ export function ensureConfig(keys, requester = 'unspecified application code') {
|
313 | 313 | * In its most basic form, the initialization process loads this document via `process.env`
|
314 | 314 | * variables. There are other ways to add configuration variables to the ConfigDocument as
|
315 | 315 | * documented above (JavaScript File Configuration, Runtime Configuration, and the Initialization
|
316 |
| - * Config Handler) |
| 316 | + * Config Handler). |
317 | 317 | *
|
318 | 318 | * ```
|
319 | 319 | * {
|
|
0 commit comments