Skip to content
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

Per Repo server-react-render and main.js #37

Open
ddfridley opened this issue May 3, 2023 · 0 comments
Open

Per Repo server-react-render and main.js #37

ddfridley opened this issue May 3, 2023 · 0 comments

Comments

@ddfridley
Copy link
Contributor

If a repo like undebate-ssp is including the undebate and the civil-server, pages that get rendered by the complete build import one main.js file that has all the logic for everything. But if a user visits a page that's just part of undebate then the main.js contains more than is necessary.

For example if one goes to cc.enciv.org/undebates they get the top level page for undebate-ssp. But if one visits https://cc.enciv.org/san-francisco-district-attorney they get a page from the undebate repo - but it's rendered by App from undebate-ssp and both have a common main.js

When a projects server starts - in app/start.js there is the code

import App from './components/app'
   ...
   server.App=App

This is where the App from the repo of the top level project is being set.

In addition, all pages of the different repos/projects are rendered with on common app/components/app.js wrapper and use the same
app/server/routes/server-react-render - though maybe this is okay and we need to just factor our what needs to be project/repo specific, it's possible that this should be per project rather than the same for all cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant