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

Optimizations for "multi-site" use case #199

Open
aryascripts opened this issue Mar 17, 2023 · 2 comments
Open

Optimizations for "multi-site" use case #199

aryascripts opened this issue Mar 17, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@aryascripts
Copy link

Describe the problem

The Problem

Currently, there seems to be no way to differentiate between "static" content, and "_app" content. This means that the svelte app / JS portions are generated statically, and we have to generate both, any time either one changes. This may be okay for single site use cases, but if this library is used for multiple sites, then this can really take a toll on the static site-building and cost money to run in CI.

Example

If today, we start with the sidebar / external links of:

  • Site 1
  • Site 2
  • Site 3

And now, we want to add:

  • Site 4

Then:
All 4 sites (the new one, and 3 older ones) need to be rebuilt. Even though the only change needed for Site 1, 2, and 3 is to update "External Links".

Describe the proposed solution

Have a process where the following elements can be generated and replaced without having to rebuild all sites:

  • sidebar external links
  • logo / site names (maybe?)

Importance

Nice to have

@aryascripts aryascripts added the enhancement New feature or request label Mar 17, 2023
@pelletier197
Copy link
Collaborator

Hi @amanb014. Thanks for raising that issue. I can see the problem you have, and I understand why it's frustrating. However, I don't quite see a way to achieve what you're asking for.

Under the hood, the template used to generate the website is a Svelte Kit application to which Magidoc passes different parameters to build. The output of this build is a statically generated website, and each page contains the full layout HTML, which includes the nav links.

What you're proposing would require Magidoc to edit this HTML directly rather than going through Svelte-Kit to generate the website. This would be very complex and flaky.

Do you see a different way to make this happen ?

@aryascripts
Copy link
Author

Yeah that totally makes sense. I don't really see another way around this except for building sidebar separately and somehow connecting the two together. Though the performance of generating sites is not huge, unless the graphql schema has 100s of queries/mutations to generate. Most sites generate in under 1 minute so it might not be totally out of the ordinary to just generate all of them again.

For now, for my use case I will probably go with generating sites individually without any external links. And the "linking" between sites will happen outside of Magidoc completely and not hooked in with the site generation. That may be a better outcome for me anyways. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants