-
Notifications
You must be signed in to change notification settings - Fork 12
Add endpoint and button to download realm #3935
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
base: main
Are you sure you want to change the base?
Conversation
Preview deployments |
There’s a mysterious syntax error, this isn’t helping it seems but…?
13c79a8 to
099ce9f
Compare
|
|
||
| import RealmDropdown from '@cardstack/host/components/realm-dropdown'; | ||
|
|
||
| // These were inline but caused the template to have spurious Glint errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see the errors here. I tried for a while to come up with a better way, including splitting the template, moving the functions outside the class… this was the only way I found that worked.
|
@codex review this. in particular, I'm curious if the implementation in this PR requires the zip file for the full realm to be assembled in memory on the realm server. If so, could it be adjusted to stream instead? |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex Does the implementation in this PR mean that the entire zip file will be assembled in memory on the realm server? If so, could it be adjusted to stream as it adds/compresses instead? |
|
To use Codex here, create an environment for this repo. |
|
The answer to my question: The server-side implementation already streams the zip — it does not assemble it in memory. Here's the key mechanism in packages/realm-server/handlers/handle-download-realm.ts:
So archiver reads files from the filesystem, compresses them, and writes chunks directly to the HTTP However, the client side does buffer the entire response in memory. In let blob = await response.blob(); This collects the entire streamed response into a Blob in browser memory before triggering the download |
Uh oh!
There was an error while loading. Please reload this page.