Skip to content

Commit

Permalink
Disable SSR for all pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Mar 17, 2024
1 parent 30d8efb commit 3093eee
Show file tree
Hide file tree
Showing 18 changed files with 2 additions and 49 deletions.
3 changes: 2 additions & 1 deletion frontend/src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Always use trailing slash
export const trailingSlash = 'always';

// Prerender all pages by default
// Disable SSR and prerender all pages by default
export const ssr = false;
export const prerender = true;
3 changes: 0 additions & 3 deletions frontend/src/routes/auth/login/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import {redirect} from '@sveltejs/kit';
import {getCookiesMap} from '$lib/cookies';
import {sanitizeRedirectPath} from '$lib/urls';

// Disable server-side rendering for this page
export const ssr = false;

export async function load({url}): Promise<void> {
const cookies = getCookiesMap(document.cookie);
// Note: The user_id cookie is HTTP only, so we cannot fetch it.
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/routes/auth/logout/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import {goto} from '$app/navigation';

import {apiLogout} from './api';

// Disable server-side rendering for this page
export const ssr = false;

export async function load({fetch}): Promise<void> {
await apiLogout(fetch);

Expand Down
2 changes: 0 additions & 2 deletions frontend/src/routes/auth/password/change/+page.ts

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/src/routes/auth/registration/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import {redirect} from '@sveltejs/kit';
import {getCookiesMap} from '$lib/cookies';
import {sanitizeRedirectPath} from '$lib/urls';

// Disable server-side rendering for this page
export const ssr = false;

export async function load({url}): Promise<void> {
const cookies = getCookiesMap(document.cookie);
// Note: The user_id cookie is HTTP only, so we cannot fetch it.
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/routes/flights/+page.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {loadApiFlights, type FlightListItem, type FlightLocation} from './api';

// Disable server-side rendering for this page
export const ssr = false;

export interface Data {
readonly flights: FlightListItem[];
readonly locations: Record<number, FlightLocation>;
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/routes/flights/[id]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import {z} from 'zod';

import {loadApiFlight, type Flight} from '../api';

// Disable server-side rendering for this page
export const ssr = false;

// Dynamic URL, don't prerender
export const prerender = false;

Expand Down
3 changes: 0 additions & 3 deletions frontend/src/routes/flights/[id]/edit/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import {loadApiGliders, type Glider} from '../../../gliders/api';
import {loadApiLocations} from '../../../locations/api';
import {loadApiFlights, type FlightLocation, loadApiFlight, type Flight} from '../../api';

// Disable server-side rendering for this page
export const ssr = false;

// Dynamic URL, don't prerender
export const prerender = false;

Expand Down
3 changes: 0 additions & 3 deletions frontend/src/routes/flights/add/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import {loadApiGliders, type Glider} from '../../gliders/api';
import {loadApiLocations} from '../../locations/api';
import {loadApiFlights, type FlightLocation} from '../api';

// Disable server-side rendering for this page
export const ssr = false;

export interface Data {
/**
* A sorted array of flight numbers associated with existing flights.
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/routes/gliders/+page.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {loadApiGliders, type GlidersInfo} from './api';

// Disable server-side rendering for this page
export const ssr = false;

export type Data = GlidersInfo;

export async function load({fetch}): Promise<Data> {
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/routes/gliders/[id]/edit/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import {z} from 'zod';

import {loadApiGliders, type Glider} from '../../api';

// Disable server-side rendering for this page
export const ssr = false;

// Dynamic URL, don't prerender
export const prerender = false;

Expand Down
2 changes: 0 additions & 2 deletions frontend/src/routes/gliders/add/+page.ts

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/src/routes/locations/+page.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {loadApiLocations, type Location} from './api';

// Disable server-side rendering for this page
export const ssr = false;

export interface Data {
readonly locations: Location[];
}
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/routes/locations/[id]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import {z} from 'zod';

import {loadApiLocation, type Location} from '../api';

// Disable server-side rendering for this page
export const ssr = false;

// Dynamic URL, don't prerender
export const prerender = false;

Expand Down
3 changes: 0 additions & 3 deletions frontend/src/routes/locations/[id]/edit/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import {z} from 'zod';

import {loadApiLocation, type Location} from '../../api';

// Disable server-side rendering for this page
export const ssr = false;

// Dynamic URL, don't prerender
export const prerender = false;

Expand Down
2 changes: 0 additions & 2 deletions frontend/src/routes/locations/add/+page.ts

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/src/routes/profile/+page.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {loadApiProfile, type Profile} from './api';

// Disable server-side rendering for this page
export const ssr = false;

export interface Data {
readonly profile: Profile;
}
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/routes/stats/+page.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import {loadApiStats, type Stats} from './api';

// Disable server-side rendering for this page
export const ssr = false;

export type Data = Stats;

export async function load({fetch}): Promise<Data> {
Expand Down

0 comments on commit 3093eee

Please sign in to comment.