Skip to content

refactor: migrate to frontend-base #906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .dockerignore

This file was deleted.

22 changes: 0 additions & 22 deletions .env

This file was deleted.

23 changes: 0 additions & 23 deletions .env.development

This file was deleted.

21 changes: 0 additions & 21 deletions .env.test

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions .eslintrc.js

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
run: npm run lint
- name: Test
run: npm run test
- name: Build
run: npm run build
- name: i18n_extract
run: npm run i18n_extract
- name: Coverage
Expand Down
14 changes: 5 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
.DS_Store
.eslintcache
.idea
node_modules
npm-debug.log
coverage
module.config.js

dist/
src/i18n/transifex_input.json
temp/babel-plugin-react-intl
/*.tgz

### pyenv ###
.python-version
### i18n ###
src/i18n/transifex_input.json

### Emacs ###
### Editors ###
.DS_Store
*~
/temp
/.vscode
16 changes: 5 additions & 11 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
.eslintignore
.eslintrc.json
.gitignore
.travis.yml
docker-compose.yml
Dockerfile
Makefile
npm-debug.log

coverage
__mocks__
node_modules
public
*.test.js
*.test.jsx
*.test.ts
*.test.tsx
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ pull_translations:
mkdir src/i18n/messages
cd src/i18n/messages \
&& atlas pull $(ATLAS_OPTIONS) \
translations/frontend-platform/src/i18n/messages:frontend-platform \
translations/frontend-base/src/i18n/messages:frontend-base \
translations/paragon/src/i18n/messages:paragon \
translations/frontend-component-footer/src/i18n/messages:frontend-component-footer \
translations/frontend-component-header/src/i18n/messages:frontend-component-header \
translations/frontend-template-application/src/i18n/messages:frontend-template-application

$(intl_imports) frontend-platform paragon frontend-component-header frontend-component-footer frontend-template-application
$(intl_imports) frontend-base paragon frontend-component-header frontend-component-footer frontend-template-application

120 changes: 27 additions & 93 deletions README-template-frontend-app.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,101 +31,34 @@ Purpose

[TODO]

What is this MFE? Add a 2-3 sentence description of what it is and what it
does.
What does this frontend app do? Add a 2-3 sentence description of what it
is and what it does.

This is the Awesome MFE. It was built to provide an unmatched learning
experience, with improved tools for both randomized goodness and the ability to
directly reference amaze-blocks in existing courses. This experience is powered
by the new Fantastico storage engine.
This is the Awesome Frontend App. It was built to provide an unmatched
learning experience, with improved tools for both randomized goodness and the
ability to directly reference amaze-blocks in existing courses. This experience
is powered by the new Fantastico storage engine.

Getting Started
===============

Devstack Installation
Developing with Tutor
---------------------

.. note::

[TODO]

Describe in detail how this MFE can be installed and set up for development
in a devstack. Include as many screenshots as you can to make your guide
easier to follow! Use the following steps as an example:
If there are steps that deviate from the default Tutor setup, describe them
here.

Follow these steps to provision, run, and enable an instance of the
[PLACEHOLDER] MFE for local development via the `devstack`_.
`Tutor`_ is recommended as the development environment for this frontend app.
You can refer to the `relevant tutor-mfe documentation`_ to get started using
it.

.. _devstack: https://github.com/openedx/devstack#getting-started
.. _Tutor: https://github.com/overhangio/tutor

#. To start, clone the devstack repository as a child of an arbitrary ``~/workspace/`` directory.

.. code-block::

mkdir -p ~/workspace/
cd ~/workspace/
git clone https://github.com/openedx/devstack.git

#. Configure default services and setup devstack

Create a ``devstack/options.local.mk`` file with only the services required.
Commonly, this will just be the LMS:

.. code-block::

DEFAULT_SERVICES ?= \
lms

#. Start the devstack with:

.. code-block::

cd devstack
make dev.pull
make dev.provision
make dev.up

#. In an LMS shell, enable the ``ENABLE_[PLACEHOLDER]_MICROFRONTEND`` feature flag:

.. code-block::

make lms-shell
vim /edx/etc/lms.yml
---
FEATURES:
ENABLE_[PLACEHOLDER]_MICROFRONTEND: true

Exit the shell and restart the LMS so changes take effect:

.. code-block::

make lms-restart

#. Create and enable the waffle flag required to redirect users to the MFE,
enabling it for everyone:

.. code-block::

make lms-shell
./manage.py lms waffle_flag --create --everyone [PLACEHOLDER].redirect_to_microfrontend

#. Start this MFE with:

.. code-block::

cd frontend-app-[PLACEHOLDER]
nvm use
npm ci
npm start

#. Finally, open the MFE in a browser

Navigate to `http://localhost:8080 <http://localhost:8080>`_ to open the
MFE. This is what it should look like if everything worked:

.. figure:: ./docs/images/template.jpg

"Polycon marking template" by mangtronix is licensed under CC BY-SA 2.0.
.. _relevant tutor-mfe documentation: https://github.com/overhangio/tutor-mfe#mfe-development

Configuration
-------------
Expand All @@ -134,24 +67,25 @@ Configuration

[TODO]

Explicitly list anything that this MFE requires to function correctly. This includes:
Explicitly list anything that this app requires to function correctly. This includes:

* A list of both required and optional .env variables, and how they each
affect the functioning of the MFE
* A list of both required and optional configuration variables, and how they
each affect the functioning of the app

* A list of edx-platform `feature and waffle flags`_ that are either required
to enable use of this MFE, or affect the behavior of the MFE in some other
way
* A list of edx-platform `feature and waffle flags`_ that are either
required to enable use of this app, or affect the behavior of the app in
some other way

* A list of IDAs or other MFEs that this MFE depends on to function correctly
* A list of IDAs or other frontend apps that this app depends on to function
correctly

.. _feature and waffle flags: https://docs.openedx.org/projects/openedx-proposals/en/latest/best-practices/oep-0017-bp-feature-toggles.html

Plugins
=======
This MFE can be customized using `Frontend Plugin Framework <https://github.com/openedx/frontend-plugin-framework>`_.
Customization
=============

The parts of this MFE that can be customized in that manner are documented `here </src/plugin-slots>`_.
This frontend app can be customized using UI "slots". The parts of this MFE
that can be customized in that manner are documented `here </src/slots>`_.

[PLACEHOLDER: Other Relevant Sections]
======================================
Expand Down Expand Up @@ -193,7 +127,7 @@ Getting Help
[TODO]

Use the following as a template, but feel free to add specific places where
this MFE is commonly discussed.
this app is commonly discussed.

If you're having trouble, we have discussion forums at
https://discuss.openedx.org where you can connect with others in the community.
Expand Down
Loading