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

feat: experimental bundled storage #160

Merged
merged 6 commits into from
May 2, 2022
Merged

feat: experimental bundled storage #160

merged 6 commits into from
May 2, 2022

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Apr 27, 2022

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR introduces a new (experimental) bundledStorage option. It will take a snapshot of storage before starting the build (after prerendering) and makes it available at runtime by copying to output bundle. Mostly useful to snapshot cache for faster initial response.

Leftovers:

Future enhancements:

  • Use a virtual object to avoid creating a temporary .nitro/snapshot directory and directly bundle server assets from memory

Other fixes:

  • Set the correct preset value to nitro.options.preset
  • Avoid copying server assets for prerendering step
  • Added a new devStorage option, for build-time (dev, prerender and build) available storage
  • Partially refactor storage logic to src/storage.ts from rollup plugin

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@pi0 pi0 changed the title feat: bundled server assets feat: bundled storage Apr 27, 2022
@pi0 pi0 marked this pull request as draft April 27, 2022 19:27
@pi0 pi0 marked this pull request as ready for review May 2, 2022 14:31
@pi0 pi0 changed the title feat: bundled storage feat: experimental bundled storage May 2, 2022
@pi0 pi0 merged commit 308e7c7 into main May 2, 2022
@pi0 pi0 deleted the feat/bundled-storage branch May 2, 2022 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant