Sitecore / jss

Software development kit for JavaScript developers building web applications with Sitecore Experience Platform
https://jss.sitecore.com
Apache License 2.0
262 stars 272 forks source link

[NextJS] Add site and theme specific components. #1236

Closed mjarosch closed 1 year ago

mjarosch commented 1 year ago

Is your feature request related to a problem? Please describe.

When developing enterprise websites, it is a requirement to share components across sites while allowing some components to implement unique styling on a brand theme or specific site basis.

Describe the solution you'd like

Add the ability for components to have a site or theme specific implementation. This allows for a single codebase to be deployed multiple times supporting multiple sites, while connecting to a single Sitecore CMS instance.

Describe alternatives you've considered

Use a monorepo approach with multiple NextJS apps and a shared component library. This solves the problem, but creates other problems. Using NPM workspaces to access the shared component library breaks running the NextJS apps in docker, because the symlink isn't supported.

Additional information

art-alexeyenko commented 1 year ago

This one and issues https://github.com/Sitecore/jss/issues/1240 , https://github.com/Sitecore/jss/issues/1243 actually overlap with some new features we are looking into implementing some time soon-ish. So thank you for raising these (and especially for the POC), we'll revisit them later to see how it all fits together.

mjarosch commented 1 year ago

@art-alexeyenko Sounds great! Is there anything I can do to make my POCs and PRs more useful? Are there other things, areas, features, etc that I can work on?