openedx / frontend-app-discussions

A React-based micro frontend for the Open edX discussion forums.
GNU Affero General Public License v3.0
6 stars 62 forks source link

feat: Add support for loading themes at runtime #558

Closed xitij2000 closed 10 months ago

xitij2000 commented 1 year ago

Description

This PR updates this repo to use the version of Paragon with design tokens, and runtime theming.

How Has This Been Tested?

To test the changes in this PR you need to set things up as follows:

  1. Run npm install --legacy-peer-deps to install the packages. This is installing current WIP versions so this allows installation despite conflicts.
  2. Create module.config.js file with the following contents:
    module.exports = {
    localModules: [
    { moduleName: '@edx/frontend-platform', dir: '../frontend-platform', dist: 'src' },
    ],
    };

    Note that the 'dir' key above should point to where you've checked out frontend-platform to the correct version. i.e the version in pacakge.json

  3. If using tutor, shut down the discussion MFE and add the following content to .env.private:
    BASE_URL='http://apps.local.overhang.io:2002'
    CREDENTIALS_BASE_URL='http://localhost:18150'
    ECOMMERCE_BASE_URL='http://localhost:18130'
    LMS_BASE_URL='http://local.overhang.io:8000'
    LEARNING_BASE_URL='http://apps.local.overhang.io:2000'
    LOGIN_URL='http://local.overhang.io:8000/login'
    LOGOUT_URL='http://local.overhang.io:8000/logout'
    MARKETING_SITE_BASE_URL='http://local.overhang.io:8000'
    ORDER_HISTORY_URL='http://localhost:1996/orders'
    REFRESH_ACCESS_TOKEN_ENDPOINT='http://local.overhang.io:8000/login_refresh'
    APP_ID='discussions'
    MFE_CONFIG_API_URL='http://local.overhang.io:8000/api/mfe_config/v1'

    And add the following to webpack.dev.config.js:

    const { createConfig } = require('@edx/frontend-build');
    const config = createConfig('webpack-dev');
    config.devServer.allowedHosts = ['apps.local.overhang.io'];
    module.exports = config;

    This will allow loading the MFE from apps.local.overhang.io:2002.

Screenshots/sandbox (optional):

Include a link to the sandbox for design changes or screenshot for before and after. Remove this section if it's not applicable.

Before After

Merge Checklist

Post-merge Checklist

openedx-webhooks commented 1 year ago

Thanks for the pull request, @xitij2000! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

This is currently a draft pull request. When it is ready for our review and all tests are green, click "Ready for Review", or remove "WIP" from the title, as appropriate.

itsjeyd commented 11 months ago

Hey @xitij2000, just to confirm, you're planning to come back to this PR at some point, right?

awais-ansari commented 10 months ago

Hey @xitij2000, Just to confirm. Do you still need this PR? We are planning to clean up all open PRs.

awais-ansari commented 10 months ago

@xitij2000 closing this PR. Please reopen it whenever you start working on it. Thanks.

openedx-webhooks commented 10 months ago

@xitij2000 Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

openedx-webhooks commented 10 months ago

@xitij2000 Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.