Skip to content

Commit

Permalink
Greatly simplify client-side loading of map page
Browse files Browse the repository at this point in the history
  • Loading branch information
davenquinn committed Jan 27, 2024
1 parent 6cf932b commit 8c21ff5
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
2 changes: 0 additions & 2 deletions packages/sift/src/js/components/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export const siftImages = import.meta.glob("../../img/*.{png,jpg,jpeg}", {
eager: true,
});

console.log(siftImages);

export function SiftLink(props): ReactNode {
const { to, ...rest } = props;
return h(Link, { to, ...rest });
Expand Down
14 changes: 0 additions & 14 deletions src/pages/map/+Page.ts

This file was deleted.

18 changes: 18 additions & 0 deletions src/pages/map/+config.h.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import MapInterface from "./map-interface";

export default {
Page: MapInterface,
route: "/map/*",
meta: {
Page: {
/* Sift must be rendered as a single-page app, because that is its design.
It must only use server-side links to other pages,
because of its reliance on global styles that could leak to other pages with client routing
*/
env: {
client: true,
server: false,
},
},
},
};
1 change: 0 additions & 1 deletion src/pages/map/+route.ts

This file was deleted.

2 changes: 2 additions & 0 deletions src/renderer/+onRenderClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ async function render(pageContext: PageContextClient) {
"Client-side render() hook expects pageContext.Page to be defined"
);

console.log("Rendering on client side");

FocusStyleManager.onlyShowFocusOnTabs();

const page = h(PageShell, { pageContext }, h(Page, pageProps));
Expand Down
5 changes: 5 additions & 0 deletions src/renderer/+onRenderHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ async function render(pageContext: PageContextServer) {
);
}

// await import("~/styles/blueprint-core");
// await import("~/styles/_theme.styl");
// await import("../styles/core.sass");
// await import("../styles/padding.css");

// See https://vike.dev/head
const { documentProps } = pageContext.exports;
const title = (documentProps && documentProps.title) || "Macrostrat";
Expand Down

0 comments on commit 8c21ff5

Please sign in to comment.