Skip to content

Conversation

@arbrandes
Copy link
Contributor

@arbrandes arbrandes commented Jun 15, 2025

@arbrandes arbrandes force-pushed the config-refactor branch 2 times, most recently from 7bf9999 to f4c1dca Compare June 16, 2025 02:15
There is no need for a distinct ProjectSiteConfig; it is actually less
confusing to accept that some config properties are indeed optional, and
write code accordingly.

The concept of "Project" is also a bit confusing, since the
configuration is typed as "SiteConfig".  So we're abandoning "Project"
in favor of "Site".  This renames most things accordingly.

Continuing, rename SiteConfig's top-level `appId` to a more fitting
`siteId`, leaving `appId` exclusively for the `App` type.

In yet another rename, move the `custom` app config to what it's
actually for: `standalone` mode.  (Plus, "dev.legacy" is better
described as "dev.standalone".)

Also move test.site.config.tsx into the normal site.config.*.tsx
pattern.  There is no longer any reason for the distinction, as all
site.config files are ok to be committed.

Finally, adjust other webpack and site.config file names to a more
conformant pattern.
First, rename the existing AppProvider to SiteProvider, in keeping with
what the provided data refers to (SiteConfig).

Second, add a new AppProvider that allows apps to use their AppConfigs
from within an AppContext.  In practice, this means they can
useAppConfig() without having to refer to their own appId every time -
which is the case with getAppConfig(appId).
Continuing with the theme of this refactor, rename APP_* to SITE_*.

Also remove the unused APPS_CHANGED topic.
This does a few things:

* Renames APP_* events
* Renames getConfig & company into getSiteConfig
* Removes standalone mode: we don't foresee an intermediate step in MFE
  migration, anymore
* This means the `appConfig` structure is not needed anymore, so remove
  it
* ... which necessitated a refactor of the `App` type and associated
  functions
@arbrandes arbrandes changed the title refactor: configuration types and file names refactor: config and API Jun 16, 2025
@arbrandes arbrandes enabled auto-merge (rebase) June 16, 2025 13:56
@arbrandes arbrandes merged commit d18bf0e into openedx:main Jun 16, 2025
5 checks passed
@arbrandes arbrandes deleted the config-refactor branch June 16, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant