Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
d522e4e
fix(deps): bumping to latest module-federation versions
davidjoy Oct 24, 2024
0c1f033
fix(deps): bump jest monorepo versions
davidjoy Oct 24, 2024
80a9b04
fix(deps): eslint, autoprefixer, postcss version bumps
davidjoy Oct 24, 2024
8efa4e7
fix(deps): bumping webpack and style/scss related build dependencies
davidjoy Oct 24, 2024
6f0845e
fix(deps): upgrading eslint-config-airbnb and @typescript-eslint depe…
davidjoy Oct 24, 2024
1c086ab
docs: noting that @import needs to be converted to @use in MFEs
davidjoy Oct 24, 2024
5234fc5
fix(deps): running npm audit fix
davidjoy Oct 24, 2024
e2012b9
feat: Upgrade to ESLint 9
davidjoy Oct 25, 2024
7417c1b
fix(style): using single quotes everywhere
davidjoy Oct 25, 2024
faa202e
fix: adding a few missing files and changes from the ESLint 9 upgrade
davidjoy Oct 25, 2024
ba8808b
fix(style): removing and fixing eslint and typescript comments
davidjoy Oct 25, 2024
bd9e3e4
fix(style): organizing imports
davidjoy Oct 25, 2024
c87b08e
fix(style): missing semi-colons, commas, and whitespace fixes
davidjoy Oct 25, 2024
63a10d4
fix(style): Use optional chaining operator
davidjoy Oct 25, 2024
dd41180
fix(style): One statement per line
davidjoy Oct 25, 2024
7a3126b
fix(style): use includes instead of indexOf
davidjoy Oct 25, 2024
1df0b2b
fix(style): Using ‘for of’ loops where appropriate
davidjoy Oct 25, 2024
3516191
fix(style): Using nullish coalescing operator
davidjoy Oct 25, 2024
bbc5280
fix(style): using ‘const’ instead of ‘let’
davidjoy Oct 25, 2024
7d3d47e
fix(style): whitespace
davidjoy Oct 25, 2024
273267c
fix: adding ‘key’ props to react elements in lists
davidjoy Oct 25, 2024
7176ac6
fix(style): Using “Record” typescript type
davidjoy Oct 25, 2024
05647b1
fix(style): Using [] instead of Array to identify array types
davidjoy Oct 25, 2024
e4c6272
fix(style): using html entities for apostrophe and quotes
davidjoy Oct 25, 2024
be95b38
fix(style): removing variable declaration in switch statement
davidjoy Oct 25, 2024
189a301
fix(style): final typescript related style fixes
davidjoy Oct 25, 2024
6985e8a
feat: new createLintConfig helper for ESLint
davidjoy Oct 25, 2024
aa0b043
docs: adding information about how to add eslint ignores to the new c…
davidjoy Oct 25, 2024
03cc833
fix: removing unneeded Intl polyfills
davidjoy Oct 31, 2024
75dcf4b
fix: removing country and language list functions
davidjoy Oct 31, 2024
a777081
fix: replacing pubsub-js with simple eventing system
davidjoy Oct 31, 2024
e5e8cf1
fix(style): organizing imports
davidjoy Oct 31, 2024
10acb21
feat: adding getLocalizedLanguageName and getSupportedLanguageList fu…
davidjoy Oct 31, 2024
343823f
feat: adding an updateLocale function to refresh the current locale
davidjoy Oct 31, 2024
627c860
docs: adding migration documentation about getSupportedLanguageList
davidjoy Oct 31, 2024
1e978fc
fix: modernizing i18n configuration
davidjoy Oct 31, 2024
0f84bed
feat: expanding list of RTL languages
davidjoy Oct 31, 2024
48bfd9a
feat: adding a new footer to replace frontend-component-footer
davidjoy Nov 1, 2024
b663b1a
fix: removing old footers
davidjoy Nov 1, 2024
f3280cd
refactor: moving ‘new-footer’ to ‘footer’, menu helpers to ‘menus’
davidjoy Nov 1, 2024
36fb90b
refactor: de-duplicating AnonymousMenuItem and NavLinksItem
davidjoy Nov 1, 2024
865f24a
fix: adjusting shell dev project child path
davidjoy Nov 1, 2024
17f4f2f
refactor: simplifying and DRYing up menu item components
davidjoy Nov 1, 2024
6aa26d1
fix(style): adjusting header padding in mobile/desktop layouts
davidjoy Nov 1, 2024
39d8078
refactor: renaming and organizing header/footer menu components and t…
davidjoy Nov 1, 2024
2c236b2
refactor: MenuDropdown -> DropdownMenuItem, LinkItem -> LinkMenuItem
davidjoy Nov 1, 2024
d821c42
fix: organizing types and adding some comments
davidjoy Nov 1, 2024
ad5bbe4
feat: merge internal and federated messages into i18n
davidjoy Nov 5, 2024
c5bc2b7
feat: menu creation helpers and proper component keys
davidjoy Nov 5, 2024
3972477
feat: adding app config creation helpers
davidjoy Nov 5, 2024
a6d55b8
refactor: ‘apps’ in site config is now an array
davidjoy Nov 5, 2024
a8eb7e3
fix: only ignore the top-level ‘config’ folder
davidjoy Nov 6, 2024
83be33f
refactor: moving menu config helpers to runtime from shell.
davidjoy Nov 6, 2024
c133af7
test: testing i18n message merging for federated modules in test-project
davidjoy Nov 6, 2024
52f3ec6
feat: adding a “learning context” containing course info
davidjoy Nov 7, 2024
9dfcac1
fix: adding a type for LocalizedMessages
davidjoy Nov 8, 2024
c5d903b
refactor: organizing site.config.dev.shell.tsx a bit
davidjoy Nov 8, 2024
f7038cf
refactor: changing extensions on plugins files to ts/tsx
davidjoy Nov 15, 2024
8f39a2b
fix(style): removing ‘non-nullable-type-assertion-style’ rule
davidjoy Nov 15, 2024
3014352
refactor: renaming PluginOperations to PluginOperationTypes
davidjoy Nov 15, 2024
ae4cf31
test: informing typescript that our mocked functions are jest.Mocks
davidjoy Nov 15, 2024
a6c1cc4
fix(style): some whitespace fixes
davidjoy Nov 15, 2024
daf8aee
fix: converting test-project plugins into TypeScript
davidjoy Nov 19, 2024
4ba2e07
refactor: using .ts extension for runtime/plugins/data/utils.tsx
davidjoy Nov 19, 2024
cfefdd5
fix: finish converting plugins to Typescript
davidjoy Nov 19, 2024
a0f011e
build: temporarily passing test:shell with no tests
davidjoy Nov 19, 2024
2eb32ed
refactor: converting index files to TS
davidjoy Nov 21, 2024
07e9804
refactor: converting GA loader to TS
davidjoy Nov 21, 2024
7fb3cc7
refactor: converting testing helpers to TS
davidjoy Nov 21, 2024
aa185b7
feat: Apps, routes, and slots (#2)
davidjoy Dec 10, 2024
7d1ccd0
fix(docs): Incorrect section heading in site config
davidjoy Dec 10, 2024
d2412b4
refactor: shell/index becomes shell/app, index.scss becomes app.scss
davidjoy Dec 10, 2024
bfa4653
fix: mergeConfig should allow any config option
davidjoy Dec 10, 2024
509d5bd
fix: exporting many more members from the shell and types
davidjoy Dec 10, 2024
aa3b329
test: updating test-project to the new format
davidjoy Dec 10, 2024
af388f6
fix: only add new Apps once when patching routes
davidjoy Dec 10, 2024
306362a
fix: removing unnecessary comments and bumping package lock in test-p…
davidjoy Dec 10, 2024
3803b3e
fix: Provide NavDropdown menu slot helper component
davidjoy Dec 13, 2024
81b3e77
fix: renaming config to app in loadApp
davidjoy Dec 13, 2024
ebb7e0f
fix: export ordering
davidjoy Dec 13, 2024
855c69d
feat: preload federated apps without hints
davidjoy Dec 13, 2024
9c7a188
fix: removing unneeded/incorrect links in dev-project footer
davidjoy Dec 13, 2024
b23d71f
refactor: moving dev-project header/footer configs into their own fol…
davidjoy Dec 13, 2024
7727445
refactor: renaming authenticated page moduleId to “authenticated-page”
davidjoy Dec 13, 2024
d1dc7d2
fix: throw an error if remote IDs are not valid variable names
davidjoy Dec 13, 2024
664a372
fix: renaming patchMessages to mergeMessages
davidjoy Dec 13, 2024
08a1303
docs: removing references to “ConfigDocument” - it’s SiteConfig now.
davidjoy Dec 13, 2024
456a9ca
fix: patchApp should publish a CONFIG_CHANGED event
davidjoy Dec 13, 2024
cd54c6f
fix: adding a helper to merge a list of remotes into SiteConfig
davidjoy Dec 13, 2024
00d4abf
fix: organizing some imports
davidjoy Dec 13, 2024
de81c6d
fix: adding addAppMessages helper
davidjoy Dec 13, 2024
47eaf42
refactor: putting slot helpers/hooks into a data folder
davidjoy Dec 13, 2024
ce0450c
refactor: organizing imports
davidjoy Dec 13, 2024
8bbdfb9
fix: exporting isValidVariableName from runtime
davidjoy Dec 13, 2024
34506ff
fix: splitting up SlotOperationTypes into two separate enums
davidjoy Dec 13, 2024
99ecbd5
fix: broken paths to slot hooks.
davidjoy Dec 13, 2024
b126bb9
feat: improving remote initialization
davidjoy Dec 13, 2024
41e90c6
fix: importing mergeMessages properly
davidjoy Dec 13, 2024
c4b2568
fix: renaming ‘patch’ parameter to ‘patchRoutes’
davidjoy Dec 13, 2024
e3ecef1
fix: removing patchAppIdIntoRouteHandle
davidjoy Dec 13, 2024
f09ac87
refactor: renaming createInternalRoutes to getAppRoutes
davidjoy Dec 13, 2024
6d565ac
refactor: organizes federation code a bit more
davidjoy Dec 13, 2024
72f34c6
feat: preloading federated apps without hints
davidjoy Dec 13, 2024
3e66323
test: adding tests for federation functions
davidjoy Dec 13, 2024
1e1c35f
test: adding tests for the other federation functions
davidjoy Dec 13, 2024
8167dc6
test: adding tests for the Logo component
davidjoy Dec 13, 2024
8a54711
refactor: merging Logo components
davidjoy Dec 13, 2024
237fde2
test: adding getAppRoutes test
davidjoy Dec 13, 2024
fd0e768
test: adding patchRoutesOnNavigation tests
davidjoy Dec 13, 2024
e4fa709
test: adding tests for createRouter
davidjoy Dec 13, 2024
842fc41
docs: Adding some more detail about SASS changes to migration guide
davidjoy Dec 18, 2024
173d910
feat: adding FederatedWidgets
davidjoy Dec 18, 2024
46e6be1
fix: primary header links vertical alignment was off
davidjoy Dec 18, 2024
d2093b5
fix: removing unused ACCOUNT_PROFILE_URL
davidjoy Dec 18, 2024
5351b59
fix: removing unused ACCOUNT_SETTINGS_URL
davidjoy Dec 18, 2024
3f3671c
fix: removing unused LEARNING_BASE_URL
davidjoy Dec 18, 2024
8a91d85
fix: removing unused ORDER_HISTORY_URL
davidjoy Dec 18, 2024
e6f0a9f
fix: removing unused MARKETING_SITE_BASE_URL
davidjoy Dec 18, 2024
df7b158
fix: removing unused LEARNER_DASHBOARD_URL
davidjoy Dec 18, 2024
d6ed439
fix: removing unused STUDIO_BASE_URL
davidjoy Dec 18, 2024
5b8392f
fix: remove unused DISCOVERY_API_BASE_URL
davidjoy Dec 18, 2024
2d108ff
fix: remove unused ECOMMERCE_BASE_URL
davidjoy Dec 18, 2024
14b2d44
fix: removing unused CREDENTIALS_BASE_URL
davidjoy Dec 18, 2024
5e0a300
fix: remove unused PUBLISHER_BASE_URL
davidjoy Dec 18, 2024
4aa0e57
fix: removing unused ACCESSIBILITY_URL
davidjoy Dec 18, 2024
1842a7c
fix: remove unused PRIVACY_POLICY_URL
davidjoy Dec 18, 2024
575d43b
fix: remove unused TERMS_OF_SERVICE_URL
davidjoy Dec 18, 2024
2bfb5ad
fix: remove unused SUPPORT_EMAIL
davidjoy Dec 18, 2024
2a32acc
fix: removing unused SUPPORT_URL
davidjoy Dec 19, 2024
0d406e8
docs: note env vars that have been removed
davidjoy Dec 19, 2024
74a80bd
refactor: camelCasing config
davidjoy Dec 19, 2024
fbf1420
fix: update slot operations on authenticated user change
davidjoy Dec 20, 2024
4f31027
feat: adding widget operations
davidjoy Dec 20, 2024
46d0987
test: adds some test cases for a few new slot operations
davidjoy Dec 20, 2024
7c68905
refactor: putting types with their associated code
davidjoy Dec 20, 2024
9d49eba
refactor: removing unnecessary authenticated-menu folder
davidjoy Dec 20, 2024
2d88f5a
fix: removing unused NavLinks component
davidjoy Dec 20, 2024
3143a88
docs: remove unneeded TODO
davidjoy Dec 30, 2024
03860c1
refactor: renaming ‘widget’ slots to ‘ui’ slots
davidjoy Dec 30, 2024
958af8a
refactor: adjusting names of UI slot functions/types
davidjoy Dec 30, 2024
4f4e303
refactor: renaming isFederationOperation to isFederatedOperation
davidjoy Dec 30, 2024
3f6acc9
feat: adding iframe widgets to the slot system
davidjoy Dec 30, 2024
278e95d
fix: Layout options operation should not have optional “options”
davidjoy Dec 30, 2024
3301a8c
fix: removing old tsconfig ‘excludes’
davidjoy Jan 2, 2025
37e1c33
refactor: reorder useSlotLayout
davidjoy Jan 2, 2025
d075ef0
feat: merging FPF with ‘slot’ system, cleaning up types
davidjoy Jan 2, 2025
0b3d10b
fix: removing stray comman in package.json
davidjoy Jan 2, 2025
1dc59f0
fix: removing ‘custom’ key from SiteConfig
davidjoy Jan 2, 2025
1551be3
test: proving that insert before/after work even if the operation is …
davidjoy Jan 2, 2025
c3dcdf3
refactor: organizing ‘slots’ folder
davidjoy Jan 2, 2025
66bc1bf
fix: getting rid of a ‘key’ warning with in-lined JSX.
davidjoy Jan 2, 2025
5b45702
fix: fixing a warning about lists inside paragraph tags
davidjoy Jan 2, 2025
1330cbd
fix: removing some unnecessary code
davidjoy Jan 2, 2025
f57eff4
feat: allow layouts to be specified via component or element
davidjoy Jan 2, 2025
662dfcc
test: adding tests for slots/ui/layout folder
davidjoy Jan 3, 2025
fa7b96b
refactor: making the layout replace operation’s naming consistent wit…
davidjoy Jan 3, 2025
26d1b22
refactor: disambiguating WidgetOperationTypes values
davidjoy Jan 3, 2025
3e37279
test: Adding tests for FederatedWidget
davidjoy Jan 3, 2025
0cd9ee6
test: Adding tests for the Slot component
davidjoy Jan 3, 2025
a85fc38
test: Adding tests for the slots/utils getSlotOperations function
davidjoy Jan 3, 2025
3cd99b2
fix: environment is optional in ProjectSiteConfig.
davidjoy Jan 9, 2025
7a3f8b9
fix: add an optional “role” to the RouteObject handle
davidjoy Jan 9, 2025
9dcec13
refactor: converting ‘configure’ functions to more specific names
davidjoy Jan 9, 2025
c262978
docs: adding the declarations to suggested app.d.ts file
davidjoy Jan 9, 2025
9fa179d
refactor: exporting everything from config and constants in runtime
davidjoy Jan 9, 2025
172a093
feat: improvements to ‘runtime/routing’ folder
davidjoy Jan 9, 2025
0b7cd64
fix: IframePlugin using wrong wrapper class
davidjoy Jan 9, 2025
c037c52
fix(style): adjusting AppProvider formatting
davidjoy Jan 9, 2025
304b9bd
fix: Records for options should have ‘unknown’ values, not ‘any’
davidjoy Jan 9, 2025
3f8aea1
feat: role-based UI Operation conditions
davidjoy Jan 9, 2025
9544ff6
test: adjusting names of test-project exports
davidjoy Jan 9, 2025
c012645
fix: aligning variable name with type
davidjoy Jan 9, 2025
bc42f0e
feat: adding widget identity operation helpers
davidjoy Jan 9, 2025
9425902
fix: Slot layout type should be ReactNode
davidjoy Jan 9, 2025
95d50e2
fix: useOperations should set ops immediately and not listen to AUTHE…
davidjoy Jan 9, 2025
8be1a2b
feat: allowing Apps to supply custom AppConfig for themselves
davidjoy Jan 9, 2025
dd43d66
docs: documenting usage of SiteConfig and custom AppConfig
davidjoy Jan 9, 2025
1f2f199
test: adding commented out federation config for authn
davidjoy Jan 10, 2025
1cff8bd
fix: missed some imports of the iframe widget config
davidjoy Jan 10, 2025
5ad7b2f
fix: moving hooks to Shell from AppProvider
davidjoy Jan 10, 2025
ef04410
docs: update migrate-frontend-app notes
davidjoy Jan 15, 2025
ce3ab5f
fix: site.config declaration wasn’t formed correctly
davidjoy Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

26 changes: 0 additions & 26 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.vscode
coverage
dist
config
/config
scss
node_modules
npm-debug.log
Expand Down
3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
__mocks__
.eslintignore
./.eslintrc.js
./eslint.config.js
.github
.gitignore
*.test.js
Expand Down
35 changes: 26 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,39 @@ Then move the files out of the way (move src to some other sub-dir, mostly) to m

- Cease using `AUTHN_MINIMAL_HEADER`, replace it with an actual minimal header.
- No more using `process.env` in runtime code.
- `SUPPORT_URL` is now optional and the support link in the header is hidden if it's not present.
- Removed dotenv. Use site.config.tsx.
- Removed Purge CSS. We do not believe that Purge CSS works properly with Paragon in general, and it is also fundamentally incompatible with module federation as an architecture.
- Removed `ensureConfig` function. This sort of type safety should happen with TypeScript types in the site config file.
- Removed `ensureDefinedConfig` function. Similar to ensureConfig, this sort of type safety should be handled by TypeScript.
- A number of site config variables now have sensible defaults:
- ACCESS_TOKEN_COOKIE_NAME: 'edx-jwt-cookie-header-payload',
- CSRF_TOKEN_API_PATH: '/csrf/api/v1/token',
- LANGUAGE_PREFERENCE_COOKIE_NAME: 'openedx-language-preference',
- USER_INFO_COOKIE_NAME: 'edx-user-info',
- PUBLIC_PATH: '/',
- ENVIRONMENT: 'production',
- accessTokenCookieName: 'edx-jwt-cookie-header-payload',
- csrfTokenApiPath: '/csrf/api/v1/token',
- languagePreferenceCookieName: 'openedx-language-preference',
- userInfoCookieName: 'edx-user-info',
- publicPath: '/',
- environment: 'production',
- the `basename` and `history` exports have been replaced by function getters: `getBasename` and `getHistory`. This is because it may not be possible to determine the values of the original constants at code initialization time, since our config may arrive asynchronously. This ensures that anyone trying to get these values gets a current value.
- When using MockAuthService, set the authenticated user by calling setAuthenticatedUser after instantiating the service. It's not okay for us to add arbitrary config values to the site config.
- `REFRESH_ACCESS_TOKEN_ENDPOINT` has been replaced with `REFRESH_ACCESS_TOKEN_API_PATH`. It is now a path that defaults to '/login_refresh'. The Auth service assumes it is an endpoint on the LMS, and joins the path with `LMS_BASE_URL`. This change creates more parity with other paths such as `CSRF_TOKEN_API_PATH`.
- `ENABLE_ACCESSIBILITY_PAGE` has been renamed `ACCESSIBILITY_URL` and is now the URL to an accessibility page.
- `REFRESH_ACCESS_TOKEN_ENDPOINT` has been replaced with `refreshAccessTokenApiPath`. It is now a path that defaults to '/login_refresh'. The Auth service assumes it is an endpoint on the LMS, and joins the path with `lmsBaseUrl`. This change creates more parity with other paths such as `csrfTokenApiPath`.

The following config variables have been removed, in favor of defining roles for specific modules, `externalRoutes`, or app-specific custom config as necessary:

- ACCOUNT_PROFILE_URL
- ACCOUNT_SETTINGS_URL
- LEARNING_BASE_URL
- ORDER_HISTORY_URL
- MARKETING_SITE_BASE_URL
- LEARNER_DASHBOARD_URL
- STUDIO_BASE_URL
- ACCESSIBILITY_URL
- PRIVACY_POLICY_URL
- TERMS_OF_SERVICE_URL
- SUPPORT_URL
- SUPPORT_EMAIL
- ECOMMERCE_BASE_URL
- DISCOVERY_API_BASE_URL
- CREDENTIALS_BASE_URL
- PUBLISHER_BASE_URL

# Working with Tutor

Expand Down
4 changes: 2 additions & 2 deletions docs/decisions/0006-middleware-support-for-http-clients.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Consumers will install the middleware they want to use and provide it to ``initi
authMiddleware: [axiosCaseConverter, (client) => axiosRetry(client, { retries: 3 })],
});

If a consumer chooses not to use ``initialize`` and instead the ``configure`` function, the middleware can be passed in the options param::
If a consumer chooses not to use ``initialize`` and instead the ``configureAuth`` function, the middleware can be passed in the options param::

configure({
configureAuth({
loggingService: getLoggingService(),
config: getConfig(),
options: {
Expand Down
6 changes: 3 additions & 3 deletions docs/decisions/0007-javascript-file-configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ The implementation of this uses templatization and string interpolation to
replace any instance of ``process.env.XXXX`` with the value of the environment
variable named ``XXXX``. As an example, in our source code we may write::

const LMS_BASE_URL = process.env.LMS_BASE_URL;
const lmsBaseUrl = process.env.lmsBaseUrl;

After the build process runs, the compiled source code will instead read::

const LMS_BASE_URL = 'http://localhost:18000';
const lmsBaseUrl = 'http://localhost:18000';

Put another way, `process.env` is not actually an object available at runtime,
it's a templatization token that helps the build replace it with a string
Expand Down Expand Up @@ -76,7 +76,7 @@ This method makes use of an ``site.config.tsx`` file to supply configuration
variables to an application::

const config = {
LMS_BASE_URL: 'http://localhost:18000',
lmsBaseUrl: 'http://localhost:18000',
BOOLEAN_VAR: false,
NULL_VAR: null,
NUMBER_VAR: 123
Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/0008-stylesheet-import-in-site-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ As a best practice, a project should have a top-level SCSS file as a peer to the
The `project.scss` file should import the stylesheet from the shell:

```diff
+ @import '@openedx/frontend-base/shell/index.scss';
+ @import '@openedx/frontend-base/shell/app.scss';

// other styles
```
Expand Down
6 changes: 3 additions & 3 deletions docs/how_tos/automatic-case-conversion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ How to: Convert SnakeCase to CamelCase automatically for API Requests
Introduction
************

When using the HTTP client from ``@edx/frontend-platform``, you are making an API request to an
When using the HTTP client from ``@openedx/frontend-base``, you are making an API request to an
Open edX service which requires you to handle snake-cased <-> camelCase conversions manually. The manual conversion quickly gets
tedious, and is error prone if you forget to do it.

Expand All @@ -26,11 +26,11 @@ as a middleware when calling ``initialize`` in the consumer::
authMiddleware: [axiosCaseConverter],
});

Or, if you choose to use ``configure`` instead::
Or, if you choose to use ``configureAuth`` instead::

import axiosCaseConverter from 'axios-case-converter';

configure({
configureAuth({
loggingService: getLoggingService(),
config: getConfig(),
options: {
Expand Down
12 changes: 6 additions & 6 deletions docs/how_tos/i18n.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,24 +96,24 @@ Load up your translation files

#. In ``App.jsx``, make the following changes::

import { IntlProvider, getMessages, configure } from '@edx/frontend-platform/i18n';
import { IntlProvider, getMessages, configureI18n } from '@edx/frontend-base';
import messages from './i18n/index'; // A map of all messages by locale

configure({
configureI18n({
messages,
config: getConfig(), // ENVIRONMENT and LANGUAGE_PREFERENCE_COOKIE_NAME are required
config: getConfig(), // environment and languagePreferenceCookieName are required
loggingService: getLoggingService(), // An object with logError and logInfo methods
});

// ...inside ReactDOM.render...
<IntlProvider locale={this.props.locale} messages={}>

#. As of this writing, ``frontend-platform/i18n`` reads the locale from the user language preference cookie, or, if none is found, from the browser's language setting. You can verify everything is working by changing your language preference in your account settings. If you are not logged in, you can change your browser language to one of the languages you have translations for.
#. As of this writing, ``frontend-base`` reads the locale from the user language preference cookie, or, if none is found, from the browser's language setting. You can verify everything is working by changing your language preference in your account settings. If you are not logged in, you can change your browser language to one of the languages you have translations for.


********************
*************************
Migrating to react-intl@5
********************
*************************

Initially ``frontend-platform`` used ``react-intl@2`` but as a part of its ``2.0.0`` release the version has been upgraded to ``react-intl@5``. If your application
used ``frontend-platform`` < ``2.0.0`` and you decided to upgrade, here's a list of breaking changes that you will need to consider during the upgrade:
Expand Down
Loading
Loading