Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
965c8e5
fix(deps): bumping to latest module-federation versions
davidjoy Oct 24, 2024
4fec670
fix(deps): bump jest monorepo versions
davidjoy Oct 24, 2024
059efc1
fix(deps): eslint, autoprefixer, postcss version bumps
davidjoy Oct 24, 2024
273ed06
fix(deps): bumping webpack and style/scss related build dependencies
davidjoy Oct 24, 2024
d9d6f4a
fix(deps): upgrading eslint-config-airbnb and @typescript-eslint depe…
davidjoy Oct 24, 2024
c2279fc
docs: noting that @import needs to be converted to @use in MFEs
davidjoy Oct 24, 2024
f1d001d
fix(deps): running npm audit fix
davidjoy Oct 24, 2024
f0c0d0d
feat: Upgrade to ESLint 9
davidjoy Oct 25, 2024
944a944
fix(style): using single quotes everywhere
davidjoy Oct 25, 2024
8708c07
fix: adding a few missing files and changes from the ESLint 9 upgrade
davidjoy Oct 25, 2024
4b11325
fix(style): removing and fixing eslint and typescript comments
davidjoy Oct 25, 2024
0c924d8
fix(style): organizing imports
davidjoy Oct 25, 2024
17e7d44
fix(style): missing semi-colons, commas, and whitespace fixes
davidjoy Oct 25, 2024
b1821f8
fix(style): Use optional chaining operator
davidjoy Oct 25, 2024
27e8da8
fix(style): One statement per line
davidjoy Oct 25, 2024
62f3a23
fix(style): use includes instead of indexOf
davidjoy Oct 25, 2024
0c1ddf0
fix(style): Using ‘for of’ loops where appropriate
davidjoy Oct 25, 2024
4c5c60d
fix(style): Using nullish coalescing operator
davidjoy Oct 25, 2024
8fd5236
fix(style): using ‘const’ instead of ‘let’
davidjoy Oct 25, 2024
cb7ba4c
fix(style): whitespace
davidjoy Oct 25, 2024
2f07c5c
fix: adding ‘key’ props to react elements in lists
davidjoy Oct 25, 2024
5e8ac9d
fix(style): Using “Record” typescript type
davidjoy Oct 25, 2024
df8fd18
fix(style): Using [] instead of Array to identify array types
davidjoy Oct 25, 2024
471225e
fix(style): using html entities for apostrophe and quotes
davidjoy Oct 25, 2024
43473b3
fix(style): removing variable declaration in switch statement
davidjoy Oct 25, 2024
51130de
fix(style): final typescript related style fixes
davidjoy Oct 25, 2024
ca75e7c
feat: new createLintConfig helper for ESLint
davidjoy Oct 25, 2024
26e407c
docs: adding information about how to add eslint ignores to the new c…
davidjoy Oct 25, 2024
cba504a
fix: removing unneeded Intl polyfills
davidjoy Oct 31, 2024
e6c32ed
fix: removing country and language list functions
davidjoy Oct 31, 2024
fc986c9
fix: replacing pubsub-js with simple eventing system
davidjoy Oct 31, 2024
c1c32eb
fix(style): organizing imports
davidjoy Oct 31, 2024
cab91f1
feat: adding getLocalizedLanguageName and getSupportedLanguageList fu…
davidjoy Oct 31, 2024
1b8e4ab
feat: adding an updateLocale function to refresh the current locale
davidjoy Oct 31, 2024
a7c8b5b
docs: adding migration documentation about getSupportedLanguageList
davidjoy Oct 31, 2024
fb9b9ee
fix: modernizing i18n configuration
davidjoy Oct 31, 2024
beb7f8e
feat: expanding list of RTL languages
davidjoy Oct 31, 2024
c1d1eea
feat: adding a new footer to replace frontend-component-footer
davidjoy Nov 1, 2024
9bfc487
fix: removing old footers
davidjoy Nov 1, 2024
3724e07
refactor: moving ‘new-footer’ to ‘footer’, menu helpers to ‘menus’
davidjoy Nov 1, 2024
2a6526d
refactor: de-duplicating AnonymousMenuItem and NavLinksItem
davidjoy Nov 1, 2024
84145ae
fix: adjusting shell dev project child path
davidjoy Nov 1, 2024
85196ce
refactor: simplifying and DRYing up menu item components
davidjoy Nov 1, 2024
d692acf
fix(style): adjusting header padding in mobile/desktop layouts
davidjoy Nov 1, 2024
54d7a60
refactor: renaming and organizing header/footer menu components and t…
davidjoy Nov 1, 2024
28e07dd
refactor: MenuDropdown -> DropdownMenuItem, LinkItem -> LinkMenuItem
davidjoy Nov 1, 2024
7e69e6d
fix: organizing types and adding some comments
davidjoy Nov 1, 2024
1685143
feat: merge internal and federated messages into i18n
davidjoy Nov 5, 2024
4e40e35
feat: menu creation helpers and proper component keys
davidjoy Nov 5, 2024
63f991d
feat: adding app config creation helpers
davidjoy Nov 5, 2024
3408d7d
refactor: ‘apps’ in site config is now an array
davidjoy Nov 5, 2024
66a7bea
fix: only ignore the top-level ‘config’ folder
davidjoy Nov 6, 2024
74796c1
refactor: moving menu config helpers to runtime from shell.
davidjoy Nov 6, 2024
d7dcfd9
test: testing i18n message merging for federated modules in test-project
davidjoy Nov 6, 2024
622b920
feat: adding a “learning context” containing course info
davidjoy Nov 7, 2024
cf85269
fix: adding a type for LocalizedMessages
davidjoy Nov 8, 2024
9d7abc7
refactor: organizing site.config.dev.shell.tsx a bit
davidjoy Nov 8, 2024
d262575
refactor: changing extensions on plugins files to ts/tsx
davidjoy Nov 15, 2024
6bc8920
fix(style): removing ‘non-nullable-type-assertion-style’ rule
davidjoy Nov 15, 2024
3dac75b
refactor: renaming PluginOperations to PluginOperationTypes
davidjoy Nov 15, 2024
6bb46e6
test: informing typescript that our mocked functions are jest.Mocks
davidjoy Nov 15, 2024
5635695
fix(style): some whitespace fixes
davidjoy Nov 15, 2024
626f083
fix: converting test-project plugins into TypeScript
davidjoy Nov 19, 2024
329afe4
refactor: using .ts extension for runtime/plugins/data/utils.tsx
davidjoy Nov 19, 2024
f5983cb
fix: finish converting plugins to Typescript
davidjoy Nov 19, 2024
6ac4106
build: temporarily passing test:shell with no tests
davidjoy Nov 19, 2024
b648c9e
refactor: converting index files to TS
davidjoy Nov 21, 2024
c9dd2f0
refactor: converting GA loader to TS
davidjoy Nov 21, 2024
18ff186
refactor: converting testing helpers to TS
davidjoy Nov 21, 2024
3716f2e
feat: Apps, routes, and slots (#2)
davidjoy Dec 10, 2024
dc5a938
fix(docs): Incorrect section heading in site config
davidjoy Dec 10, 2024
11920e7
refactor: shell/index becomes shell/app, index.scss becomes app.scss
davidjoy Dec 10, 2024
f78b1b9
fix: mergeConfig should allow any config option
davidjoy Dec 10, 2024
08007bf
fix: exporting many more members from the shell and types
davidjoy Dec 10, 2024
cec027a
test: updating test-project to the new format
davidjoy Dec 10, 2024
91722ac
fix: only add new Apps once when patching routes
davidjoy Dec 10, 2024
7d6297d
fix: removing unnecessary comments and bumping package lock in test-p…
davidjoy Dec 10, 2024
195fbf3
fix: Provide NavDropdown menu slot helper component
davidjoy Dec 13, 2024
3bb2827
fix: renaming config to app in loadApp
davidjoy Dec 13, 2024
c8d36ac
fix: export ordering
davidjoy Dec 13, 2024
fb1bc5f
feat: preload federated apps without hints
davidjoy Dec 13, 2024
9a18e11
fix: removing unneeded/incorrect links in dev-project footer
davidjoy Dec 13, 2024
867127d
refactor: moving dev-project header/footer configs into their own fol…
davidjoy Dec 13, 2024
d58c057
refactor: renaming authenticated page moduleId to “authenticated-page”
davidjoy Dec 13, 2024
dc0ae05
fix: throw an error if remote IDs are not valid variable names
davidjoy Dec 13, 2024
c2f4c81
fix: renaming patchMessages to mergeMessages
davidjoy Dec 13, 2024
7112341
docs: removing references to “ConfigDocument” - it’s SiteConfig now.
davidjoy Dec 13, 2024
2955afd
fix: patchApp should publish a CONFIG_CHANGED event
davidjoy Dec 13, 2024
c9eb42e
fix: adding a helper to merge a list of remotes into SiteConfig
davidjoy Dec 13, 2024
69016d2
fix: organizing some imports
davidjoy Dec 13, 2024
ac00feb
fix: adding addAppMessages helper
davidjoy Dec 13, 2024
a99d6cf
refactor: putting slot helpers/hooks into a data folder
davidjoy Dec 13, 2024
a679f7f
refactor: organizing imports
davidjoy Dec 13, 2024
67ea92c
fix: exporting isValidVariableName from runtime
davidjoy Dec 13, 2024
dd5253d
fix: splitting up SlotOperationTypes into two separate enums
davidjoy Dec 13, 2024
b349d14
fix: broken paths to slot hooks.
davidjoy Dec 13, 2024
4a97570
feat: improving remote initialization
davidjoy Dec 13, 2024
7345211
fix: importing mergeMessages properly
davidjoy Dec 13, 2024
17c954e
fix: renaming ‘patch’ parameter to ‘patchRoutes’
davidjoy Dec 13, 2024
aa1d95d
fix: removing patchAppIdIntoRouteHandle
davidjoy Dec 13, 2024
aa807d9
refactor: renaming createInternalRoutes to getAppRoutes
davidjoy Dec 13, 2024
fc8a60e
refactor: organizes federation code a bit more
davidjoy Dec 13, 2024
43232c3
feat: preloading federated apps without hints
davidjoy Dec 13, 2024
cb4a09f
test: adding tests for federation functions
davidjoy Dec 13, 2024
ab87865
test: adding tests for the other federation functions
davidjoy Dec 13, 2024
82601a6
test: adding tests for the Logo component
davidjoy Dec 13, 2024
e7f8f4c
refactor: merging Logo components
davidjoy Dec 13, 2024
6944a0c
test: adding getAppRoutes test
davidjoy Dec 13, 2024
1a15057
test: adding patchRoutesOnNavigation tests
davidjoy Dec 13, 2024
5cd146e
test: adding tests for createRouter
davidjoy Dec 13, 2024
04dc776
docs: Adding some more detail about SASS changes to migration guide
davidjoy Dec 18, 2024
522f718
feat: adding FederatedWidgets
davidjoy Dec 18, 2024
c876218
fix: primary header links vertical alignment was off
davidjoy Dec 18, 2024
33d5af3
fix: removing unused ACCOUNT_PROFILE_URL
davidjoy Dec 18, 2024
2f70f6e
fix: removing unused ACCOUNT_SETTINGS_URL
davidjoy Dec 18, 2024
a9a7f81
fix: removing unused LEARNING_BASE_URL
davidjoy Dec 18, 2024
5a2995e
fix: removing unused ORDER_HISTORY_URL
davidjoy Dec 18, 2024
7f3812c
fix: removing unused MARKETING_SITE_BASE_URL
davidjoy Dec 18, 2024
b0ffc35
fix: removing unused LEARNER_DASHBOARD_URL
davidjoy Dec 18, 2024
f578aee
fix: removing unused STUDIO_BASE_URL
davidjoy Dec 18, 2024
03c7780
fix: remove unused DISCOVERY_API_BASE_URL
davidjoy Dec 18, 2024
8f8d674
fix: remove unused ECOMMERCE_BASE_URL
davidjoy Dec 18, 2024
8d7806b
fix: removing unused CREDENTIALS_BASE_URL
davidjoy Dec 18, 2024
f8e2e2d
fix: remove unused PUBLISHER_BASE_URL
davidjoy Dec 18, 2024
62a40de
fix: removing unused ACCESSIBILITY_URL
davidjoy Dec 18, 2024
f9167b7
fix: remove unused PRIVACY_POLICY_URL
davidjoy Dec 18, 2024
e77f246
fix: remove unused TERMS_OF_SERVICE_URL
davidjoy Dec 18, 2024
077b0dd
fix: remove unused SUPPORT_EMAIL
davidjoy Dec 18, 2024
bc05001
fix: removing unused SUPPORT_URL
davidjoy Dec 19, 2024
306ae45
docs: note env vars that have been removed
davidjoy Dec 19, 2024
79d5551
refactor: camelCasing config
davidjoy Dec 19, 2024
a358b43
fix: update slot operations on authenticated user change
davidjoy Dec 20, 2024
22980f6
feat: adding widget operations
davidjoy Dec 20, 2024
0f49808
test: adds some test cases for a few new slot operations
davidjoy Dec 20, 2024
b3abc73
refactor: putting types with their associated code
davidjoy Dec 20, 2024
bef4d1b
refactor: removing unnecessary authenticated-menu folder
davidjoy Dec 20, 2024
b76099f
fix: removing unused NavLinks component
davidjoy Dec 20, 2024
1604679
docs: remove unneeded TODO
davidjoy Dec 30, 2024
8a508bc
refactor: renaming ‘widget’ slots to ‘ui’ slots
davidjoy Dec 30, 2024
381800f
refactor: adjusting names of UI slot functions/types
davidjoy Dec 30, 2024
3754dd5
refactor: renaming isFederationOperation to isFederatedOperation
davidjoy Dec 30, 2024
b5ab559
feat: adding iframe widgets to the slot system
davidjoy Dec 30, 2024
9e537a7
fix: Layout options operation should not have optional “options”
davidjoy Dec 30, 2024
a11e819
fix: removing old tsconfig ‘excludes’
davidjoy Jan 2, 2025
90921f3
refactor: reorder useSlotLayout
davidjoy Jan 2, 2025
f474d75
feat: merging FPF with ‘slot’ system, cleaning up types
davidjoy Jan 2, 2025
61feb6c
fix: removing stray comman in package.json
davidjoy Jan 2, 2025
c943d14
fix: removing ‘custom’ key from SiteConfig
davidjoy Jan 2, 2025
ac563b4
test: proving that insert before/after work even if the operation is …
davidjoy Jan 2, 2025
cb78be3
refactor: organizing ‘slots’ folder
davidjoy Jan 2, 2025
d6bc254
fix: getting rid of a ‘key’ warning with in-lined JSX.
davidjoy Jan 2, 2025
ab4b41e
fix: fixing a warning about lists inside paragraph tags
davidjoy Jan 2, 2025
f56f3da
fix: removing some unnecessary code
davidjoy Jan 2, 2025
a1891c9
feat: allow layouts to be specified via component or element
davidjoy Jan 2, 2025
aa3d5d2
test: adding tests for slots/ui/layout folder
davidjoy Jan 3, 2025
97f0b53
refactor: making the layout replace operation’s naming consistent wit…
davidjoy Jan 3, 2025
4b880ee
refactor: disambiguating WidgetOperationTypes values
davidjoy Jan 3, 2025
426e55e
test: Adding tests for FederatedWidget
davidjoy Jan 3, 2025
b5ae0ad
test: Adding tests for the Slot component
davidjoy Jan 3, 2025
804d2d2
test: Adding tests for the slots/utils getSlotOperations function
davidjoy Jan 3, 2025
dd4e509
fix: environment is optional in ProjectSiteConfig.
davidjoy Jan 9, 2025
4605a5b
fix: add an optional “role” to the RouteObject handle
davidjoy Jan 9, 2025
f784c65
refactor: converting ‘configure’ functions to more specific names
davidjoy Jan 9, 2025
9deedba
docs: adding the declarations to suggested app.d.ts file
davidjoy Jan 9, 2025
52e80a7
refactor: exporting everything from config and constants in runtime
davidjoy Jan 9, 2025
1ad1e03
feat: improvements to ‘runtime/routing’ folder
davidjoy Jan 9, 2025
58cc1c8
fix: IframePlugin using wrong wrapper class
davidjoy Jan 9, 2025
3bc7508
fix(style): adjusting AppProvider formatting
davidjoy Jan 9, 2025
034b786
fix: Records for options should have ‘unknown’ values, not ‘any’
davidjoy Jan 9, 2025
07e2204
feat: role-based UI Operation conditions
davidjoy Jan 9, 2025
f1fa097
test: adjusting names of test-project exports
davidjoy Jan 9, 2025
d11e514
fix: aligning variable name with type
davidjoy Jan 9, 2025
2855ae0
feat: adding widget identity operation helpers
davidjoy Jan 9, 2025
d1db2ad
fix: Slot layout type should be ReactNode
davidjoy Jan 9, 2025
81e321a
fix: useOperations should set ops immediately and not listen to AUTHE…
davidjoy Jan 9, 2025
37657d7
feat: allowing Apps to supply custom AppConfig for themselves
davidjoy Jan 9, 2025
01836df
docs: documenting usage of SiteConfig and custom AppConfig
davidjoy Jan 9, 2025
9cee242
test: adding commented out federation config for authn
davidjoy Jan 10, 2025
17c2f63
fix: missed some imports of the iframe widget config
davidjoy Jan 10, 2025
e46c0c7
fix: moving hooks to Shell from AppProvider
davidjoy Jan 10, 2025
c40c922
docs: update migrate-frontend-app notes
davidjoy Jan 15, 2025
d25083d
fix: site.config declaration wasn’t formed correctly
davidjoy Jan 15, 2025
afc27c1
fix: pin react types to avoid conflict
arbrandes Apr 18, 2025
212f54f
refactor: explicitly re-export functions from runtime/config/index.ts
arbrandes Apr 18, 2025
a09c97b
fix: Add missing site.config declaration
arbrandes Apr 23, 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