Skip to content

Commit 75cc013

Browse files
author
Taylor Payne
committed
docs: update outdated info, reword, reformat
1 parent 467052e commit 75cc013

File tree

2 files changed

+16
-25
lines changed

2 files changed

+16
-25
lines changed

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,16 @@ In addition, frontend-platform provides an extensible application initialization
2626
## Getting started
2727

2828
### One-time setup if you have not upgraded node/npm
29-
IMPORTANT: There is now a new node/npm version being used by frontend-platform as of
30-
https://github.com/openedx/frontend-platform/pull/259
3129

3230
#### Install nvm
33-
This is highly recommended to be able to leverage different node/npm versions.
34-
For a some time, different repositories may be using different versions of node/npm.
35-
36-
Alternatively, please install node16 and npm8 for use with this repository.
31+
This is highly recommended to be able to leverage different node/npm versions. For some time, different repositories may be using different versions of node/npm.
3732

3833
#### Switch to node/npm version for this repo
39-
```nvm use```
40-
if you don't have the right node/npm versions, nvm will instruct you to install those
34+
In the project’s root directory, run `nvm use` to set your environment to the correct node version. If the required node or npm versions are not installed, nvm will prompt you to install them.
4135

4236
#### Clean out old node modules and reinstall
4337
This step is needed because node now uses a different package lock format, and it's important to reinstall
44-
dependencies based on this new package file. Delete node_modules, and issue an `npm ci`
45-
38+
dependencies based on this new package file. Delete `node_modules`, and run `npm ci`.
4639

4740
### Standard getting started steps
4841

@@ -98,7 +91,7 @@ initialize({
9891
});
9992
```
10093

101-
When using runtime configuration via `mergeConfig` noted above, `getConfig` must be called within a component's render lifecycle for the added keys and values to be returned in the configuration object. If `getConfig` is called outside of a component's render lifecycle, the custom configuration key/value pairs will not initially be part of the object returned by `getConfig`. For example:
94+
When using runtime configuration via `mergeConfig` as noted above, `getConfig` must be called within a component's render lifecycle for the added keys and values to be returned in the configuration object. If `getConfig` is called outside of a component's render lifecycle, the custom configuration key/value pairs will not initially be part of the object returned by `getConfig`. For example:
10295

10396
```jsx
10497
import { getConfig } from '@edx/frontend-platform/config';

src/config.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
*
4141
* ###### JavaScript File Configuration
4242
*
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+
* alternately, a promise which resolves to an Object.
4747
*
4848
* Using a function or async function allows the configuration to be resolved at runtime (because
4949
* the function will be executed at runtime). This is not common, and the capability is included
@@ -89,11 +89,9 @@
8989
*
9090
* Configuration variables can also be supplied using the "runtime configuration" method, taking
9191
* 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](https://github.com/openedx/edx-platform/blob/master/lms/djangoapps/mfe_config_api/docs/decisions/0001-mfe-config-api.rst).
9393
*
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
9795
* two configuration methods above.
9896
*
9997
* Runtime configuration is particularly useful if you need to supply different configurations to
@@ -103,9 +101,9 @@
103101
*
104102
* ##### Initialization Config Handler
105103
*
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.
109107
*
110108
* ```
111109
* initialize({
@@ -114,7 +112,7 @@
114112
* mergeConfig({
115113
* CUSTOM_VARIABLE: 'custom value',
116114
* LMS_BASE_URL: 'http://localhost:18001' // You can override variables, but this is uncommon.
117-
* }, 'App config override handler');
115+
* }, 'App config override handler');
118116
* },
119117
* },
120118
* });
@@ -223,7 +221,7 @@ let config = {
223221
* ```
224222
*
225223
* @returns {ConfigDocument}
226-
*/
224+
*/
227225
export function getConfig() {
228226
return config;
229227
}
@@ -341,7 +339,7 @@ export function getExternalLinkUrl(url) {
341339
* In its most basic form, the initialization process loads this document via `process.env`
342340
* variables. There are other ways to add configuration variables to the ConfigDocument as
343341
* documented above (JavaScript File Configuration, Runtime Configuration, and the Initialization
344-
* Config Handler)
342+
* Config Handler).
345343
*
346344
* ```
347345
* {

0 commit comments

Comments
 (0)