From 2dce48d067a29a0125a0d36241f7d8e946674892 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Mon, 2 Oct 2023 22:49:15 -0400 Subject: [PATCH] fix: remove trailing slash from PUBLIC_PATH env var 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). --- .../20231003_133500_dave_remove_trailing_slash.md | 11 +++++++++++ tutormfe/templates/mfe/build/mfe/Dockerfile | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 changelog.d/20231003_133500_dave_remove_trailing_slash.md diff --git a/changelog.d/20231003_133500_dave_remove_trailing_slash.md b/changelog.d/20231003_133500_dave_remove_trailing_slash.md new file mode 100644 index 00000000..36416779 --- /dev/null +++ b/changelog.d/20231003_133500_dave_remove_trailing_slash.md @@ -0,0 +1,11 @@ + + + +- [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) diff --git a/tutormfe/templates/mfe/build/mfe/Dockerfile b/tutormfe/templates/mfe/build/mfe/Dockerfile index f0d74c26..f0050fda 100644 --- a/tutormfe/templates/mfe/build/mfe/Dockerfile +++ b/tutormfe/templates/mfe/build/mfe/Dockerfile @@ -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.