Skip to content

Commit

Permalink
fix: remove trailing slash from PUBLIC_PATH env var
Browse files Browse the repository at this point in the history
We previously generated the PUBLIC_PATH base for each MFE with a
trailing slash, e.g. "/authn/". But the actual links that point to
these from the LMS and Studio don't have a trailing slash in them,
e.g. "/authn". This commit removes the trailing slash to be consistent.
Removing that trailing slash in configuration also means that we don't
have to strip it out on the JavaScript side of things, which would have
been necessary after the React Router 6 upgrade (we send it as the
router's basename).
  • Loading branch information
ormsbee committed Oct 3, 2023
1 parent f0aa8a5 commit 2dce48d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions changelog.d/20231003_133500_dave_remove_trailing_slash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<!--
Create a changelog entry for every new user-facing change. Please respect the following instructions:
- Indicate breaking changes by prepending an explosion 💥 character.
- Prefix your changes with either [Bugfix], [Improvement], [Feature], [Security], [Deprecation].
- You may optionally append "(by @<author>)" at the end of the line, where "<author>" is either one (just one)
of your GitHub username, real name or affiliated organization. These affiliations will be displayed in
the release notes for every release.
-->

- [Bugfix] Remove the trailing slash from auto-generated PUBLIC_PATH env vars for MFEs in order to be consistent with LMS/Studio config, and so that we don't have to strip it off on the JavaScript side after the React Router 6 upgrade. (by @ormsbee)
2 changes: 1 addition & 1 deletion tutormfe/templates/mfe/build/mfe/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ EXPOSE {{ app['port'] }}

# Configuration needed at build time
ENV APP_ID={{ app_name }}
ENV PUBLIC_PATH='/{{ app_name }}/'
ENV PUBLIC_PATH='/{{ app_name }}'
# We could in theory point the mfe_config API directly to the LMS. But for that we would
# have to code the LMS url into the mfe image, and this configuration is user-dependent.
# So we point to a relative url that will be a proxy for the LMS.
Expand Down

0 comments on commit 2dce48d

Please sign in to comment.