research-software-directory / RSD-as-a-service

This repo contains the new RSD-as-a-service implementation
https://research.software
23 stars 15 forks source link

Agnostic code base (only RSD) #530

Open ctwhome opened 1 year ago

ctwhome commented 1 year ago

With #359 we introduced a way to choose between two landing pages (https://github.com/research-software-directory/RSD-as-a-service/tree/main/frontend/components/home) with the inconvenience of mixing Helmholtz and RSD code in the same code base.

This can be a problem in the future if other organizations want to create their own themes/variations.

We need to, somehow, be able to have components and pages that can be from an override folder. In this case, forked repositories of the base code could add their changes, such as a complete index page, or a component like AppFooter without creating conflicts.

image
ctwhome commented 1 year ago

References:

https://github.com/vercel/next.js/discussions/13409

Only string literals can be used in imports, so it is not possible to use conditionals based on environment variables AFIK. This won't work:

const path= '~/components/home'
const Component =  dynamic(() => import(path))

enter image description here