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

Don't SSR pages in dev - fixes slow dev server #3019

Merged
merged 6 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/two-spoons-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@evidence-dev/evidence': patch
---

Fix dev server speed regression
90 changes: 64 additions & 26 deletions sites/example-project/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,72 @@
<div>
<!-- SvelteKit Hydrated Content -->
%sveltekit.body%
</div>

<!-- SplashScreen -->
<div
aria-disabled
id="__evidence_project_splash"
data-test-id="__evidence_project_splash"
class="fixed inset-0 w-screen h-screen flex items-center justify-center z-[9999] bg-base-100"
style="visibility: hidden"
>
<svg
width="100"
height="100"
viewBox="-8 -8 588 588"
xmlns="http://www.w3.org/2000/svg"
fill="currentColor"
class="animate-pulse"
<!-- SplashScreen -->
<div
aria-disabled
id="__evidence_project_splash"
data-test-id="__evidence_project_splash"
style="visibility: hidden"
>
<path
d="M7.19462e-05 74.3583C109.309 74.3583 195.795 86.2578 286.834 37.825C377.872 -10.6077 466.416 1.29174 573.667 1.29175L573.667 126.549C466.416 126.549 377.373 114.91 286.834 163.082C196.294 211.254 109.309 199.615 6.11417e-05 199.615L7.19462e-05 74.3583Z"
/>
<path
d="M573.669 499.31C464.36 499.31 377.874 487.411 286.835 535.843C195.797 584.276 107.252 572.377 0.0014801 572.377V447.12C107.252 447.12 196.295 458.758 286.835 410.586C377.375 362.415 464.36 374.053 573.669 374.053V499.31Z"
/>
<path
d="M452.896 186.499C395.028 187.686 341.581 194.947 286.835 224.074C211.396 264.212 136.995 262.826 52.2355 261.247C35.2696 260.931 17.8887 260.608 0.0014801 260.608V385.865C18.1032 385.865 35.6721 386.204 52.81 386.534C137.212 388.162 211.162 389.589 286.835 349.331C341.838 320.07 395.18 312.831 452.896 311.685V186.499Z"
/>
</svg>
<svg width="100" height="100" viewBox="-8 -8 588 588" xmlns="http://www.w3.org/2000/svg">
<path
d="M7.19462e-05 74.3583C109.309 74.3583 195.795 86.2578 286.834 37.825C377.872 -10.6077 466.416 1.29174 573.667 1.29175L573.667 126.549C466.416 126.549 377.373 114.91 286.834 163.082C196.294 211.254 109.309 199.615 6.11417e-05 199.615L7.19462e-05 74.3583Z"
class="draw-path"
/>
<path
d="M573.669 499.31C464.36 499.31 377.874 487.411 286.835 535.843C195.797 584.276 107.252 572.377 0.0014801 572.377V447.12C107.252 447.12 196.295 458.758 286.835 410.586C377.375 362.415 464.36 374.053 573.669 374.053V499.31Z"
class="draw-path"
/>
<path
d="M452.896 186.499C395.028 187.686 341.581 194.947 286.835 224.074C211.396 264.212 136.995 262.826 52.2355 261.247C35.2696 260.931 17.8887 260.608 0.0014801 260.608V385.865C18.1032 385.865 35.6721 386.204 52.81 386.534C137.212 388.162 211.162 389.589 286.835 349.331C341.838 320.07 395.18 312.831 452.896 311.685V186.499Z"
class="draw-path"
/>
</svg>
</div>
</div>
</body>
</html>

<style>
#__evidence_project_splash {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
z-index: 9999;
}

[data-theme='dark'] #__evidence_project_splash {
background-color: #000000;
}

.draw-path {
fill: #000000;
animation: blinking-logo 2s;
animation-fill-mode: both;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
}

[data-theme='dark'] .draw-path {
fill: #ffffff;
}

@keyframes blinking-logo {
0% {
fill-opacity: 1;
}
50% {
fill-opacity: 0.2;
}
100% {
fill-opacity: 1;
}
}
</style>
1 change: 1 addition & 0 deletions sites/example-project/src/pages/+layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { setTrackProxy } from '@evidence-dev/sdk/usql';
import { addBasePath } from '@evidence-dev/sdk/utils/svelte';
import md5 from 'blueimp-md5';

export const ssr = !dev;
export const prerender = import.meta.env.VITE_EVIDENCE_SPA !== 'true';
export const trailingSlash = 'always';

Expand Down
Loading