From b99940877ba4dca51fa00505fd389c9262ed4c50 Mon Sep 17 00:00:00 2001 From: Adam <24621027+WhiteDopeOnPunk@users.noreply.github.com> Date: Thu, 20 Apr 2023 09:46:28 -0400 Subject: [PATCH] suspense --- lightning/package.json | 8 +-- lightning/pnpm-lock.yaml | 77 +++++++++++++------------- lightning/src/components/BadassMap.tsx | 30 +++++----- 3 files changed, 58 insertions(+), 57 deletions(-) diff --git a/lightning/package.json b/lightning/package.json index 21253bc..9bd6657 100644 --- a/lightning/package.json +++ b/lightning/package.json @@ -12,12 +12,12 @@ "postcss": "^8.4.23", "solid-start-node": "^0.2.26", "typescript": "^4.9.5", - "vite": "^4.2.2" + "vite": "^4.3.0" }, "dependencies": { - "@deck.gl/layers": "^8.9.7", - "@deck.gl/mapbox": "^8.9.7", - "@deck.gl/mesh-layers": "^8.9.7", + "@deck.gl/layers": "^8.9.8", + "@deck.gl/mapbox": "^8.9.8", + "@deck.gl/mesh-layers": "^8.9.8", "@solidjs/meta": "^0.28.4", "@solidjs/router": "^0.8.2", "mapbox-gl": "npm:empty-npm-package@^1.0.0", diff --git a/lightning/pnpm-lock.yaml b/lightning/pnpm-lock.yaml index 8d92af6..a3ada56 100644 --- a/lightning/pnpm-lock.yaml +++ b/lightning/pnpm-lock.yaml @@ -2,14 +2,14 @@ lockfileVersion: '6.0' dependencies: '@deck.gl/layers': - specifier: ^8.9.7 - version: 8.9.7(@deck.gl/core@8.9.7)(@loaders.gl/core@3.3.3)(@luma.gl/core@8.5.19) + specifier: ^8.9.8 + version: 8.9.8(@deck.gl/core@8.9.8)(@loaders.gl/core@3.3.3)(@luma.gl/core@8.5.19) '@deck.gl/mapbox': - specifier: ^8.9.7 - version: 8.9.7(@deck.gl/core@8.9.7) + specifier: ^8.9.8 + version: 8.9.8(@deck.gl/core@8.9.8) '@deck.gl/mesh-layers': - specifier: ^8.9.7 - version: 8.9.7(@deck.gl/core@8.9.7)(@loaders.gl/images@3.3.3)(@luma.gl/core@8.5.19)(@luma.gl/engine@8.5.19)(@luma.gl/gltools@8.5.19)(@luma.gl/webgl@8.5.19) + specifier: ^8.9.8 + version: 8.9.8(@deck.gl/core@8.9.8)(@loaders.gl/images@3.3.3)(@luma.gl/core@8.5.19)(@luma.gl/engine@8.5.19)(@luma.gl/gltools@8.5.19)(@luma.gl/webgl@8.5.19) '@solidjs/meta': specifier: ^0.28.4 version: 0.28.4(solid-js@1.7.3) @@ -30,7 +30,7 @@ dependencies: version: 1.7.2(empty-npm-package@1.0.0) solid-start: specifier: ^0.2.26 - version: 0.2.26(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.3)(solid-start-node@0.2.26)(vite@4.2.2) + version: 0.2.26(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.3)(solid-start-node@0.2.26)(vite@4.3.0) undici: specifier: ^5.21.2 version: 5.21.2 @@ -47,13 +47,13 @@ devDependencies: version: 8.4.23 solid-start-node: specifier: ^0.2.26 - version: 0.2.26(solid-start@0.2.26)(undici@5.21.2)(vite@4.2.2) + version: 0.2.26(solid-start@0.2.26)(undici@5.21.2)(vite@4.3.0) typescript: specifier: ^4.9.5 version: 4.9.5 vite: - specifier: ^4.2.2 - version: 4.2.2(@types/node@18.15.12) + specifier: ^4.3.0 + version: 4.3.0(@types/node@18.15.12) packages: @@ -1164,8 +1164,8 @@ packages: '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 - /@deck.gl/core@8.9.7: - resolution: {integrity: sha512-khcOrlee8yD84VTYvxaZrWmUaOFKkrOhHk7hVupqBr7erzsHBWj3/RWJqlfwCCN8a8YbhZOcfpSOSSbAau0OIA==} + /@deck.gl/core@8.9.8: + resolution: {integrity: sha512-R/bJ1nJJIVO+My1Ksp39vi5Vs/WHOzsdz3mAy8SUK2mt3jH7OvQHvJYs+dAAr4fjNTd8XkCPZohN9elv2Xv1MQ==} dependencies: '@loaders.gl/core': 3.3.3 '@loaders.gl/images': 3.3.3 @@ -1183,14 +1183,14 @@ packages: mjolnir.js: 2.7.1 dev: false - /@deck.gl/layers@8.9.7(@deck.gl/core@8.9.7)(@loaders.gl/core@3.3.3)(@luma.gl/core@8.5.19): - resolution: {integrity: sha512-D4k1aDzTcXTBuYrM/cE3fqHhS6XPpT6XANOuc1i47sAEnOUjLqsreo4QyY5x5apFn00dkllnWLZfzLURm5liXg==} + /@deck.gl/layers@8.9.8(@deck.gl/core@8.9.8)(@loaders.gl/core@3.3.3)(@luma.gl/core@8.5.19): + resolution: {integrity: sha512-rzG+hMDJBgbgT35Zb/IRlmjWnmmX2fosBfEGLVyeeH226bThINX1iZCgAno++o18NLGITDpZvqrMZHsB5jfefQ==} peerDependencies: '@deck.gl/core': ^8.0.0 '@loaders.gl/core': ^3.0.0 '@luma.gl/core': ^8.0.0 dependencies: - '@deck.gl/core': 8.9.7 + '@deck.gl/core': 8.9.8 '@loaders.gl/core': 3.3.3 '@loaders.gl/images': 3.3.3 '@loaders.gl/schema': 3.3.3 @@ -1203,22 +1203,22 @@ packages: earcut: 2.2.4 dev: false - /@deck.gl/mapbox@8.9.7(@deck.gl/core@8.9.7): - resolution: {integrity: sha512-EcELbZ24s+aE99C38v2ubRjppoEGUgSZuz9wHrjK9BT1a9+wGKBpeRkks79HOy0ey5343guOgUWoKGKQ/QdAeg==} + /@deck.gl/mapbox@8.9.8(@deck.gl/core@8.9.8): + resolution: {integrity: sha512-ZW9ZLgv2CSEmg9vZ6QXCgGclf9wfLOrRO4zrkje5DLp5bSFQxCpXl0ZhDN8IfpV1TW5vVqA+EXa1ORAuw2lmcw==} peerDependencies: '@deck.gl/core': ^8.0.0 dependencies: - '@deck.gl/core': 8.9.7 + '@deck.gl/core': 8.9.8 '@types/mapbox-gl': 2.7.10 dev: false - /@deck.gl/mesh-layers@8.9.7(@deck.gl/core@8.9.7)(@loaders.gl/images@3.3.3)(@luma.gl/core@8.5.19)(@luma.gl/engine@8.5.19)(@luma.gl/gltools@8.5.19)(@luma.gl/webgl@8.5.19): - resolution: {integrity: sha512-XoviQjafSmdOOrTFQuCRhPggtTLzKWDvu1gTPb0XJWrVoPRmJWyoGmStSVubrBZcbpAHocFSwLavs9yGx5H8JA==} + /@deck.gl/mesh-layers@8.9.8(@deck.gl/core@8.9.8)(@loaders.gl/images@3.3.3)(@luma.gl/core@8.5.19)(@luma.gl/engine@8.5.19)(@luma.gl/gltools@8.5.19)(@luma.gl/webgl@8.5.19): + resolution: {integrity: sha512-f+QX+1Xr1nTEmrciFYxjFlzp1h4+lK6tg4/U+lBbU9vWb8LI4cbKxnOd0oJwu3zReeY+kiaqO113LbyLOM8AFw==} peerDependencies: '@deck.gl/core': ^8.0.0 '@luma.gl/core': ^8.0.0 dependencies: - '@deck.gl/core': 8.9.7 + '@deck.gl/core': 8.9.8 '@loaders.gl/gltf': 3.3.3 '@luma.gl/constants': 8.5.19 '@luma.gl/core': 8.5.19 @@ -3097,7 +3097,7 @@ packages: '@babel/types': 7.21.4 solid-js: 1.7.3 - /solid-start-node@0.2.26(solid-start@0.2.26)(undici@5.21.2)(vite@4.2.2): + /solid-start-node@0.2.26(solid-start@0.2.26)(undici@5.21.2)(vite@4.3.0): resolution: {integrity: sha512-8vciTGoQV+lIlCUSVHJPazlaoKDRfBowDkPeBr/EZdmtbcMOKoJYf/APPQWFspylF+nhzunMf0+zJP90VtMEYg==} peerDependencies: solid-start: '*' @@ -3111,14 +3111,14 @@ packages: polka: 1.0.0-next.22 rollup: 3.20.6 sirv: 2.0.2 - solid-start: 0.2.26(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.3)(solid-start-node@0.2.26)(vite@4.2.2) + solid-start: 0.2.26(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.3)(solid-start-node@0.2.26)(vite@4.3.0) terser: 5.17.1 undici: 5.21.2 - vite: 4.2.2(@types/node@18.15.12) + vite: 4.3.0(@types/node@18.15.12) transitivePeerDependencies: - supports-color - /solid-start@0.2.26(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.3)(solid-start-node@0.2.26)(vite@4.2.2): + /solid-start@0.2.26(@solidjs/meta@0.28.4)(@solidjs/router@0.8.2)(solid-js@1.7.3)(solid-start-node@0.2.26)(vite@4.3.0): resolution: {integrity: sha512-kne2HZlnSMzsirdnvNs1CsDqBl0L0uvKKt1t4de1CH7JIngyqoMcER97jTE0Ejr84KknANaKAdvJAzZcL7Ueng==} hasBin: true peerDependencies: @@ -3181,12 +3181,12 @@ packages: set-cookie-parser: 2.6.0 sirv: 2.0.2 solid-js: 1.7.3 - solid-start-node: 0.2.26(solid-start@0.2.26)(undici@5.21.2)(vite@4.2.2) + solid-start-node: 0.2.26(solid-start@0.2.26)(undici@5.21.2)(vite@4.3.0) terser: 5.17.1 undici: 5.21.2 - vite: 4.2.2(@types/node@18.15.12) - vite-plugin-inspect: 0.7.23(rollup@3.20.6)(vite@4.2.2) - vite-plugin-solid: 2.7.0(solid-js@1.7.3)(vite@4.2.2) + vite: 4.3.0(@types/node@18.15.12) + vite-plugin-inspect: 0.7.23(rollup@3.20.6)(vite@4.3.0) + vite-plugin-solid: 2.7.0(solid-js@1.7.3)(vite@4.3.0) wait-on: 6.0.1(debug@4.3.4) transitivePeerDependencies: - supports-color @@ -3356,7 +3356,7 @@ packages: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} - /vite-plugin-inspect@0.7.23(rollup@3.20.6)(vite@4.2.2): + /vite-plugin-inspect@0.7.23(rollup@3.20.6)(vite@4.3.0): resolution: {integrity: sha512-VodzewpE9ufA8aPQhzTihbiMKAJ1aFoXNe+BB/3L52HB4Hf7I2WEOc1Yu4BC45rvw2VFuVnlXYlXL7JVQuseUw==} engines: {node: '>=14'} peerDependencies: @@ -3368,12 +3368,12 @@ packages: fs-extra: 11.1.1 picocolors: 1.0.0 sirv: 2.0.2 - vite: 4.2.2(@types/node@18.15.12) + vite: 4.3.0(@types/node@18.15.12) transitivePeerDependencies: - rollup - supports-color - /vite-plugin-solid@2.7.0(solid-js@1.7.3)(vite@4.2.2): + /vite-plugin-solid@2.7.0(solid-js@1.7.3)(vite@4.3.0): resolution: {integrity: sha512-avp/Jl5zOp/Itfo67xtDB2O61U7idviaIp4mLsjhCa13PjKNasz+IID0jYTyqUp9SFx6/PmBr6v4KgDppqompg==} peerDependencies: solid-js: ^1.7.2 @@ -3386,13 +3386,13 @@ packages: merge-anything: 5.1.4 solid-js: 1.7.3 solid-refresh: 0.5.2(solid-js@1.7.3) - vite: 4.2.2(@types/node@18.15.12) - vitefu: 0.2.4(vite@4.2.2) + vite: 4.3.0(@types/node@18.15.12) + vitefu: 0.2.4(vite@4.3.0) transitivePeerDependencies: - supports-color - /vite@4.2.2(@types/node@18.15.12): - resolution: {integrity: sha512-PcNtT5HeDxb3QaSqFYkEum8f5sCVe0R3WK20qxgIvNBZPXU/Obxs/+ubBMeE7nLWeCo2LDzv+8hRYSlcaSehig==} + /vite@4.3.0(@types/node@18.15.12): + resolution: {integrity: sha512-JTGFgDh3dVxeGBpuQX04Up+JZmuG6wu9414Ei36vQzaEruY/M4K0AgwtuB2b4HaBgB7R8l+LHxjB0jcgz4d2qQ==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -3419,12 +3419,11 @@ packages: '@types/node': 18.15.12 esbuild: 0.17.17 postcss: 8.4.23 - resolve: 1.22.2 rollup: 3.20.6 optionalDependencies: fsevents: 2.3.2 - /vitefu@0.2.4(vite@4.2.2): + /vitefu@0.2.4(vite@4.3.0): resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==} peerDependencies: vite: ^3.0.0 || ^4.0.0 @@ -3432,7 +3431,7 @@ packages: vite: optional: true dependencies: - vite: 4.2.2(@types/node@18.15.12) + vite: 4.3.0(@types/node@18.15.12) /vt-pbf@3.1.3: resolution: {integrity: sha512-2LzDFzt0mZKZ9IpVF2r69G9bXaP2Q2sArJCmcCgvfTdCCZzSyz4aCLoQyUilu37Ll56tCblIZrXFIjNUpGIlmA==} diff --git a/lightning/src/components/BadassMap.tsx b/lightning/src/components/BadassMap.tsx index f8e9345..863bc29 100644 --- a/lightning/src/components/BadassMap.tsx +++ b/lightning/src/components/BadassMap.tsx @@ -1,5 +1,5 @@ import MapGL, { Viewport, Camera } from 'solid-map-gl'; -import { createSignal, Show, createEffect, createResource, For, Accessor } from 'solid-js'; +import { createSignal, Show, Suspense, createEffect, createResource, For, Accessor } from 'solid-js'; import { useRouteData } from 'solid-start'; import * as maplibre from 'maplibre-gl'; import MapControls from './MapControls'; @@ -123,17 +123,17 @@ const TEST_PACKET: StationRequest = { Distance: 10, CountLimit: 10, } +async function fetchStations() { + const payload: RequestInit = { + method: "POST", + cache: 'default', + body: JSON.stringify(TEST_PACKET), + headers: { 'Content-Type': 'application/json' }, + } + const response = await fetch("https://kevinfwu.com/getnearest", payload); + return await response.json() as StationResponse[]; +}; function BadassMap(): JSX.Element { - async function fetchStations() { - const payload: RequestInit = { - method: "POST", - cache: 'default', - body: JSON.stringify(TEST_PACKET), - headers: { 'Content-Type': 'application/json' }, - } - const response = await fetch("https://kevinfwu.com/getnearest", payload); - return await response.json() as StationResponse[]; - }; const [stations] = createResource(fetchStations); const [viewport, setViewport] = createSignal(INITIAL_VIEWPORT); @@ -185,9 +185,11 @@ function BadassMap(): JSX.Element {
  • - - {(station) =>
  • {station.Dist}
  • } -
    + Loading stations...}> + + {(station) =>
  • {station.Dist}
  • } +
    +