mitodl / edx-platform

The Open edX platform, the software that powers edX!
http://open.edx.org/
GNU Affero General Public License v3.0
6 stars 1 forks source link

Relative path routing support for library authoring MFE #295

Closed blarghmatey closed 2 years ago

blarghmatey commented 2 years ago

In order to support the Blockstore plugin functionality for edx-platform we will need to be able to deploy the library authoring MFE (https://github.com/openedx/frontend-app-library-authoring). That MFE does not currently support path-based routing, which forces us to use a dedicated subdomain to run it. We would like to update the code to include support for path-based routing in the same manner as frontend-app-learning, frontend-app-gradebook, etc.

pdpinch commented 2 years ago

@asadiqbal08 I think you did similar work on https://github.com/openedx/frontend-component-header

@blarghmatey just for an example, can you tell us what route you would want to use for this MFE?

blarghmatey commented 2 years ago

The route will be managed by the env variables during the build, but for sake of argument we'll likely put it at /authoring

asadiqbal08 commented 2 years ago

@blarghmatey for a quick refresh, Can you please reference the frontend-app-learning that working in the desired manner ? and in the authoring MFE what actually are you expecting to change ?

blarghmatey commented 2 years ago

So, this is the learning MFE that we use which has the relative path functionality available to it. For the authoring MFE we would like to be able to deploy it so that it will expect to load at a particular route on the domain where it's deployed. As it currently exists it expects that all interactions with it will happen at the root path (/) of an arbitrary domain. This boils down to a setting in the React router which should be handled in the frontend-platform repository, but I believe there's some wiring in the authoring MFE that needs to be included to take advantage of that.

asadiqbal08 commented 2 years ago

@pdpinch @blarghmatey After installing the library-authoring-mfe, Checking out its routing paths and after reading out some previous discussion over this thread. I think we might not need any specific change in this MFE and we just be able to use the public_path as we are doing for learning MFE.

I am able to run the MFE after getting pull of this repo and did this locally.

Now, I am able to load the pages on the following routes.

http://localhost:3001/authoring/library/lib:uetX:CSPROB

screencapture-localhost-3001-authoring-library-lib-uetX-CSPROB-2022-04-11-16_40_19

Let me know, If we are good with this approach ?