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: Add store option for linked mode builds #40

Merged
merged 6 commits into from
Jan 5, 2023
Merged

feat: Add store option for linked mode builds #40

merged 6 commits into from
Jan 5, 2023

Conversation

rturnq
Copy link
Contributor

@rturnq rturnq commented Jan 5, 2023

Description

Adds store option which allow specifying a method to preserve data between SSR and client builds. Provides two implementations: file system (default) and in memory.

Motivation and Context

Various data is produced during the SSR build which is necessary for the client build in linked mode. Today this is written to the file system. This PR decouples this logic into a store interface which can be implemented in any way. By default the store will continue to use the file system but an alternative in memory store is also provided which can improve performance when using Vite programatically.

Screenshots (if appropriate):

Checklist:

  • I have updated/added documentation affected by my changes.
  • I have added tests to cover my changes.

@changeset-bot
Copy link

changeset-bot bot commented Jan 5, 2023

🦋 Changeset detected

Latest commit: c1ea6a1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@marko/vite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Base: 86.35% // Head: 87.62% // Increases project coverage by +1.26% 🎉

Coverage data is based on head (c1ea6a1) compared to base (3dc1c00).
Patch coverage: 98.03% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #40      +/-   ##
==========================================
+ Coverage   86.35%   87.62%   +1.26%     
==========================================
  Files           6        9       +3     
  Lines         381      412      +31     
  Branches       98      101       +3     
==========================================
+ Hits          329      361      +32     
+ Misses         44       43       -1     
  Partials        8        8              
Impacted Files Coverage Δ
src/store/file-store.ts 97.05% <97.05%> (ø)
src/index.ts 91.39% <100.00%> (+0.41%) ⬆️
src/store/index.ts 100.00% <100.00%> (ø)
src/store/memory-store.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rturnq rturnq changed the title Feat/store feat: Add store option for linked mode builds Jan 5, 2023
@rturnq rturnq merged commit 427c493 into main Jan 5, 2023
@rturnq rturnq deleted the feat/store branch January 5, 2023 23:35
@github-actions github-actions bot mentioned this pull request Jan 5, 2023
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