-
Notifications
You must be signed in to change notification settings - Fork 0
Ideas to Share Components Across CMS And Portal And TUP
W. Bomar edited this page Mar 31, 2022
·
9 revisions
How can we consistently share a component on a Portal and a CMS and any other web UI?
Use Cases:
- System Monitor (on Frontera Home page)
- Ticket Listing
- Header Search Bar, Portal Navigation, CMS Navigation, Logo, and "Branding"
- Visqueue (to be used on new Frontera website)
- Allocations
Guidelines:
- Do not duplicate code (how header shared content during 2020).
- Do not load from CMS after page load via AJAX (how header shares "components" since early 2021).
- Do not maintain the same component with two technologies (unless there's a DRY way to do this).
Wishes:
- Use Typescript.
- Don't be locked into a build process.
Ways to Package:
- custom elements (web standard)
- Django CMS plugins
- Python apps (PIP, Poetry)
- React Components
- 🆕 : Build independently with shared resources
Ways to Share:
- To share markup with server-side template logic (Portal Navigation), share templates and data server-side.
- To share React Components to CMS, wrap React Component in a Custom Element.*
- To share Custom Elements to Portal, wrap Custom Element in React Component.
- To share (any) component to CMS, wrap each in a Django CMS plugin.
- To share (any) component to (any) site, wrap each as a Python app.
- 🆕 : To share CSS & reference markup to any project via Node package (https://github.com/tacc-wbomar/Core-Styles).
- 🆕 : Use React Components for Portal and TUP via Node package. CMS can load minimal React as necessary to load.
Footnotes
* The Custom Element must use React if it exists, or otherwise load it. That process itself could be encapsulated in a Custom Element.
TACC ACI WMA Core-Portal Project Documentation