Merged in fix/destinations-speed-test (pull request #1704)

Feat(destination pages): Performance improvements

* fix/destinations: try cache full response

* Added more caching

* Removed unsed env car

* wip

* merge master

* wip

* wip

* wip

* Renaming


Approved-by: Michael Zetterberg
This commit is contained in:
Linus Flood
2025-04-02 11:37:22 +00:00
parent 961e8aea91
commit e4907d4b47
34 changed files with 381 additions and 290 deletions
@@ -10,10 +10,7 @@ export type RoomListItemProps = {
export type RoomListItemImageProps = Pick<
RoomConfiguration,
| "features"
| "roomType"
| "roomTypeCode"
| "roomsLeft"
"features" | "roomType" | "roomTypeCode" | "roomsLeft"
>
type RoomPackagePriceSchema = z.output<typeof packagePriceSchema>
@@ -30,9 +27,9 @@ export type CalculatePricesPerNightProps = {
export interface RoomSizeProps {
roomSize:
| {
max: number
min: number
}
| undefined
| {
max: number
min: number
}
| undefined
}
+8 -1
View File
@@ -1,6 +1,9 @@
import type { z } from "zod"
import type { hotelSchema } from "@/server/routers/hotels/output"
import type {
destinationPagesHotelDataSchema,
hotelSchema,
} from "@/server/routers/hotels/output"
import type { citySchema } from "@/server/routers/hotels/schemas/city"
import type { attributesSchema } from "@/server/routers/hotels/schemas/hotel"
import type { addressSchema } from "@/server/routers/hotels/schemas/hotel/address"
@@ -75,3 +78,7 @@ export type AdditionalData = ReturnType<typeof transformAdditionalData>
export type ExtraPageSchema = z.output<typeof extraPageSchema>
export type HotelDataWithUrl = HotelData & { url: string }
export type DestinationPagesHotelData = z.output<
typeof destinationPagesHotelDataSchema
> & { url: string }
@@ -1,9 +1,9 @@
import type { HotelDataWithUrl } from "@/types/hotel"
import type { DestinationPagesHotelData } from "@/types/hotel"
import type { SortItem } from "../components/destinationFilterAndSort"
import type { DestinationCityListItem } from "../trpc/routers/contentstack/destinationCityPage"
export interface DestinationDataProviderProps extends React.PropsWithChildren {
allHotels: HotelDataWithUrl[]
allHotels: DestinationPagesHotelData[]
allCities?: DestinationCityListItem[]
sortItems: SortItem[]
}
@@ -3,7 +3,7 @@ import type {
SortItem,
} from "../components/destinationFilterAndSort"
import type { SortOption } from "../enums/destinationFilterAndSort"
import type { HotelDataWithUrl } from "../hotel"
import type { DestinationPagesHotelData } from "../hotel"
import type { DestinationCityListItem } from "../trpc/routers/contentstack/destinationCityPage"
interface Actions {
@@ -25,8 +25,8 @@ export interface DestinationDataState {
actions: Actions
allCities: DestinationCityListItem[]
activeCities: DestinationCityListItem[]
allHotels: HotelDataWithUrl[]
activeHotels: HotelDataWithUrl[]
allHotels: DestinationPagesHotelData[]
activeHotels: DestinationPagesHotelData[]
pendingSort: SortOption
activeSort: SortOption
defaultSort: SortOption