Skip to content

Commit

Permalink
Merge pull request #122 from UW-Macrostrat/vite-v5
Browse files Browse the repository at this point in the history
Upgrade Vite bundler to v5
  • Loading branch information
davenquinn authored Jan 21, 2024
2 parents a241799 + 63e5b2c commit ef231be
Show file tree
Hide file tree
Showing 4 changed files with 245 additions and 33 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"use-react-router-breadcrumbs": "^3.2.1",
"use-resize-observer": "^9.1.0",
"vike": "^0.4.159",
"vite": "^4.4.9",
"vite": "^5.0.12",
"vite-plugin-cesium": "^1.2.22"
},
"resolutions": {
Expand Down
28 changes: 0 additions & 28 deletions src/pages/maps/@id/+Page.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,7 @@
import h from "@macrostrat/hyper";
import { PageContextBuiltInServer } from "vike/types";
import { ClientOnly } from "~/renderer/client-only";
import { apiV2Prefix } from "~/settings";
const MapInterface = () => import("./map-interface");

const apiAddress = apiV2Prefix + "/defs/sources";

export async function onBeforeRender(pageContext: PageContextBuiltInServer) {
const { id } = pageContext.routeParams;

const params = new URLSearchParams({
format: "geojson",
source_id: id,
});
const response = await fetch(apiAddress + "?" + params);
const data: any = await response.json();
const map = data?.success?.data?.features[0];

return {
pageContext: {
pageProps: {
map,
},
documentProps: {
// The page's <title>
title: map.properties.name,
},
},
};
}

export function Page({ map }) {
return h("div.single-map", h(ClientOnly, { component: MapInterface, map }));
}
28 changes: 28 additions & 0 deletions src/pages/maps/@id/+onBeforeRender.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { PageContextBuiltInServer } from "vike/types";
import { apiV2Prefix } from "~/settings";

const apiAddress = apiV2Prefix + "/defs/sources";

export async function onBeforeRender(pageContext: PageContextBuiltInServer) {
const { id } = pageContext.routeParams;

const params = new URLSearchParams({
format: "geojson",
source_id: id,
});
const response = await fetch(apiAddress + "?" + params);
const data: any = await response.json();
const map = data?.success?.data?.features[0];

return {
pageContext: {
pageProps: {
map,
},
documentProps: {
// The page's <title>
title: map.properties.name,
},
},
};
}
220 changes: 216 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3811,7 +3811,7 @@ __metadata:
use-react-router-breadcrumbs: ^3.2.1
use-resize-observer: ^9.1.0
vike: ^0.4.159
vite: ^4.4.9
vite: ^5.0.12
vite-plugin-cesium: ^1.2.22
vite-plugin-rewrite-all: ^1.0.1
dependenciesMeta:
Expand Down Expand Up @@ -5606,6 +5606,97 @@ __metadata:
languageName: node
linkType: hard

"@rollup/rollup-android-arm-eabi@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-android-arm-eabi@npm:4.9.6"
conditions: os=android & cpu=arm
languageName: node
linkType: hard

"@rollup/rollup-android-arm64@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-android-arm64@npm:4.9.6"
conditions: os=android & cpu=arm64
languageName: node
linkType: hard

"@rollup/rollup-darwin-arm64@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-darwin-arm64@npm:4.9.6"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@rollup/rollup-darwin-x64@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-darwin-x64@npm:4.9.6"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@rollup/rollup-linux-arm-gnueabihf@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.9.6"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard

"@rollup/rollup-linux-arm64-gnu@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.9.6"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard

"@rollup/rollup-linux-arm64-musl@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-linux-arm64-musl@npm:4.9.6"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard

"@rollup/rollup-linux-riscv64-gnu@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.9.6"
conditions: os=linux & cpu=riscv64 & libc=glibc
languageName: node
linkType: hard

"@rollup/rollup-linux-x64-gnu@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-linux-x64-gnu@npm:4.9.6"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard

"@rollup/rollup-linux-x64-musl@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-linux-x64-musl@npm:4.9.6"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard

"@rollup/rollup-win32-arm64-msvc@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.9.6"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@rollup/rollup-win32-ia32-msvc@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.9.6"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard

"@rollup/rollup-win32-x64-msvc@npm:4.9.6":
version: 4.9.6
resolution: "@rollup/rollup-win32-x64-msvc@npm:4.9.6"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@samverschueren/stream-to-observable@npm:^0.3.0":
version: 0.3.1
resolution: "@samverschueren/stream-to-observable@npm:0.3.1"
Expand Down Expand Up @@ -6448,6 +6539,13 @@ __metadata:
languageName: node
linkType: hard

"@types/estree@npm:1.0.5":
version: 1.0.5
resolution: "@types/estree@npm:1.0.5"
checksum: dd8b5bed28e6213b7acd0fb665a84e693554d850b0df423ac8076cc3ad5823a6bc26b0251d080bdc545af83179ede51dd3f6fa78cad2c46ed1f29624ddf3e41a
languageName: node
linkType: hard

"@types/express-serve-static-core@npm:*":
version: 4.17.37
resolution: "@types/express-serve-static-core@npm:4.17.37"
Expand Down Expand Up @@ -12955,7 +13053,7 @@ __metadata:
languageName: node
linkType: hard

"esbuild@npm:^0.19.0":
"esbuild@npm:^0.19.0, esbuild@npm:^0.19.3":
version: 0.19.11
resolution: "esbuild@npm:0.19.11"
dependencies:
Expand Down Expand Up @@ -14253,7 +14351,7 @@ __metadata:
languageName: node
linkType: hard

"fsevents@npm:^2.3.2, fsevents@npm:~2.3.2":
"fsevents@npm:^2.3.2, fsevents@npm:~2.3.2, fsevents@npm:~2.3.3":
version: 2.3.3
resolution: "fsevents@npm:2.3.3"
dependencies:
Expand All @@ -14273,7 +14371,7 @@ __metadata:
languageName: node
linkType: hard

"fsevents@patch:fsevents@^2.3.2#~builtin<compat/fsevents>, fsevents@patch:fsevents@~2.3.2#~builtin<compat/fsevents>":
"fsevents@patch:fsevents@^2.3.2#~builtin<compat/fsevents>, fsevents@patch:fsevents@~2.3.2#~builtin<compat/fsevents>, fsevents@patch:fsevents@~2.3.3#~builtin<compat/fsevents>":
version: 2.3.3
resolution: "fsevents@patch:fsevents@npm%3A2.3.3#~builtin<compat/fsevents>::version=2.3.3&hash=df0bf1"
dependencies:
Expand Down Expand Up @@ -21109,6 +21207,15 @@ __metadata:
languageName: node
linkType: hard

"nanoid@npm:^3.3.7":
version: 3.3.7
resolution: "nanoid@npm:3.3.7"
bin:
nanoid: bin/nanoid.cjs
checksum: d36c427e530713e4ac6567d488b489a36582ef89da1d6d4e3b87eded11eb10d7042a877958c6f104929809b2ab0bafa17652b076cdf84324aa75b30b722204f2
languageName: node
linkType: hard

"nanomatch@npm:^1.2.9":
version: 1.2.13
resolution: "nanomatch@npm:1.2.13"
Expand Down Expand Up @@ -23734,6 +23841,17 @@ __metadata:
languageName: node
linkType: hard

"postcss@npm:^8.4.32":
version: 8.4.33
resolution: "postcss@npm:8.4.33"
dependencies:
nanoid: ^3.3.7
picocolors: ^1.0.0
source-map-js: ^1.0.2
checksum: 6f98b2af4b76632a3de20c4f47bf0e984a1ce1a531cf11adcb0b1d63a6cbda0aae4165e578b66c32ca4879038e3eaad386a6be725a8fb4429c78e3c1ab858fe9
languageName: node
linkType: hard

"posthtml-parser@npm:^0.10.1":
version: 0.10.2
resolution: "posthtml-parser@npm:0.10.2"
Expand Down Expand Up @@ -26057,6 +26175,60 @@ __metadata:
languageName: node
linkType: hard

"rollup@npm:^4.2.0":
version: 4.9.6
resolution: "rollup@npm:4.9.6"
dependencies:
"@rollup/rollup-android-arm-eabi": 4.9.6
"@rollup/rollup-android-arm64": 4.9.6
"@rollup/rollup-darwin-arm64": 4.9.6
"@rollup/rollup-darwin-x64": 4.9.6
"@rollup/rollup-linux-arm-gnueabihf": 4.9.6
"@rollup/rollup-linux-arm64-gnu": 4.9.6
"@rollup/rollup-linux-arm64-musl": 4.9.6
"@rollup/rollup-linux-riscv64-gnu": 4.9.6
"@rollup/rollup-linux-x64-gnu": 4.9.6
"@rollup/rollup-linux-x64-musl": 4.9.6
"@rollup/rollup-win32-arm64-msvc": 4.9.6
"@rollup/rollup-win32-ia32-msvc": 4.9.6
"@rollup/rollup-win32-x64-msvc": 4.9.6
"@types/estree": 1.0.5
fsevents: ~2.3.2
dependenciesMeta:
"@rollup/rollup-android-arm-eabi":
optional: true
"@rollup/rollup-android-arm64":
optional: true
"@rollup/rollup-darwin-arm64":
optional: true
"@rollup/rollup-darwin-x64":
optional: true
"@rollup/rollup-linux-arm-gnueabihf":
optional: true
"@rollup/rollup-linux-arm64-gnu":
optional: true
"@rollup/rollup-linux-arm64-musl":
optional: true
"@rollup/rollup-linux-riscv64-gnu":
optional: true
"@rollup/rollup-linux-x64-gnu":
optional: true
"@rollup/rollup-linux-x64-musl":
optional: true
"@rollup/rollup-win32-arm64-msvc":
optional: true
"@rollup/rollup-win32-ia32-msvc":
optional: true
"@rollup/rollup-win32-x64-msvc":
optional: true
fsevents:
optional: true
bin:
rollup: dist/bin/rollup
checksum: cdc0bdd41ee2d3fe7f01df26f5a85921caf46ffe0ae118b2f3deebdf569e8b1c1800b8eee04960425e67aecbd9ccdd37bcdb92595866adb3968d223a07e9b7e6
languageName: node
linkType: hard

"rsvp@npm:^3.3.3":
version: 3.6.2
resolution: "rsvp@npm:3.6.2"
Expand Down Expand Up @@ -29719,6 +29891,46 @@ __metadata:
languageName: node
linkType: hard

"vite@npm:^5.0.12":
version: 5.0.12
resolution: "vite@npm:5.0.12"
dependencies:
esbuild: ^0.19.3
fsevents: ~2.3.3
postcss: ^8.4.32
rollup: ^4.2.0
peerDependencies:
"@types/node": ^18.0.0 || >=20.0.0
less: "*"
lightningcss: ^1.21.0
sass: "*"
stylus: "*"
sugarss: "*"
terser: ^5.4.0
dependenciesMeta:
fsevents:
optional: true
peerDependenciesMeta:
"@types/node":
optional: true
less:
optional: true
lightningcss:
optional: true
sass:
optional: true
stylus:
optional: true
sugarss:
optional: true
terser:
optional: true
bin:
vite: bin/vite.js
checksum: b97b6f1c204d9091d0973626827a6e9d8e8b1959ebd0877b6f76e7068e1e7adf9ecd3b1cc382cbab9d421e3eeca5e1a95f27f9c1734439b229f5a58ef2052fa4
languageName: node
linkType: hard

"vt-pbf@npm:^3.1.3":
version: 3.1.3
resolution: "vt-pbf@npm:3.1.3"
Expand Down

0 comments on commit ef231be

Please sign in to comment.