You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe what this pull request changes, and why. Include implications for people using this change.
4
+
5
+
**Merge checklist:**
6
+
7
+
-[ ] Consider running your code modifications in the included example app within `frontend-platform`. This can be done by running `npm start` and opening http://localhost:8080.
8
+
-[ ] Consider testing your code modifications in another local micro-frontend using local aliases configured via [the `module.config.js` file in `frontend-build`](https://github.com/edx/frontend-build#local-module-configuration-for-webpack).
9
+
-[ ] Verify your commit title/body conforms to the conventional commits format (e.g., `fix`, `feat`) and is appropriate for your code change. Consider whether your code is a breaking change, and modify your commit accordingly.
10
+
11
+
**Post merge:**
12
+
13
+
-[ ] After the build finishes for the merged commit, verify the new release has been pushed to [NPM](https://www.npmjs.com/package/@edx/frontend-platform).
Copy file name to clipboardExpand all lines: README.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,12 @@ frontend-platform is a modest application framework for Open edX micro-frontend
21
21
22
22
In addition, frontend-platform provides an extensible application initialization lifecycle to help manage the configuration of the above services, freeing application developers to focus on feature development.
23
23
24
+
## Getting started
25
+
26
+
1.`npm install`
27
+
2.`npm start`
28
+
3. Open http://localhost:8080 to view the example app.
29
+
24
30
## Architecture
25
31
26
32
The four foundational services listed above (analytics, auth, i18n, and logging) are provided as imports to applications via frontend-platform's API layer. The initialization sequence creates an instance of each service and exposes its methods as functional exports, creating a layer of abstraction between service implementations and their usage in application code.
@@ -33,7 +39,7 @@ Internally, service implementations are strictly isolated from the rest of the p
33
39
34
40
Likewise, platform code should not make use of service methods that are not part of the documented interface for the same reasons.
35
41
36
-
### Application Initialization
42
+
### Application initialization
37
43
38
44
frontend-platform provides an `initialize()` function which bootstraps and configures an application. The `initialize()` function uses a set of [sensible defaults](https://en.wikipedia.org/wiki/Convention_over_configuration) unless otherwise specified, bootstrapping the application with services reflecting Open edX's best practices around analytics, authentication, internationalization, and logging.
39
45
@@ -50,7 +56,7 @@ The initialization process proceeds in a series of phases, giving the initializi
50
56
51
57
Most applications won't need to do anything special at all.
52
58
53
-
### Application Configuration
59
+
### Application configuration
54
60
55
61
When the application loads, a list of known environment variables is loaded from `process.env` into an object which it exposes via `getConfig` - the point here is primarily to isolate our code from usages of `process.env` which may not always be the way we choose to configure our apps. The application initialization lifecycle supports runtime configuration as well via the `config` handler, documented in the [initialize function](https://edx.github.io/frontend-platform/module-Initialization.html#~initialize). If you want to get a variable into the config that it’s not expecting, you can use [`mergeConfig`](https://edx.github.io/frontend-platform/module-Config.html#~mergeConfig) during initialization to add it in from `process.env`.
56
62
@@ -88,7 +94,9 @@ The included service implementations are:
88
94
89
95
NOTE: As of this writing, i18n is _not_ configurable. The `initialize()` function does not allow applications to supply an alternate i18n implementation; this is because the interface and implementation for i18n has not yet been separated and modularized.
90
96
91
-
# Testing Locally
97
+
# Local development & testing locally
98
+
99
+
When making changes to frontend-platform, be sure to manually run the included example app located in `./example`. The example app includes 2 routes to test for both unauthenticated and authenticated users. To start the example app, run `npm start` from the root directory.
92
100
93
101
If you want to test changes to frontend-platform against a micro-frontend locally, follow the directions here: https://github.com/edx/frontend-build#local-module-configuration-for-webpack
0 commit comments