re-route index controller

This commit is contained in:
Brandon Thomas committed 2024-04-16 00:13:44 -04:00
1 parent 8a49045489
commit c4dcbf7c7f
3 files changed
+64 -64

No files matched your search

-32
View File
@@ -1,32 +0,0 @@
import type { HeadersFunction } from "@remix-run/deno";
import { withProtectionRoute } from "~/modules/withProtectedRoute";
import { PageEnigma } from "~/pages/PageEnigma";
// NB(bt): Netlify's custom directives cannot set headers for pages served by Remix,
// so we must specify them here instead. Netlify header rules (in either _headers or
// netlify.toml) will apply to statically served files (images, css, js), however.
// Setting these headers in `vite.config.ts` will also fail to apply them in
// production.
export const headers: HeadersFunction = ({
actionHeaders,
errorHeaders,
loaderHeaders,
parentHeaders,
}) => ({
// NB(bt): The following two headers are required for enabling SharedArrayBuffer (required by
// ffmpeg.wasm) in the post-SPECTRE world. Without these headers being sent by the page, the
// page cannot use SharedArrayBuffer. Downstream services must also set relevant CORS headers.
//
// See the following documentation on how this complex system works:
//
// - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements
// - https://stackoverflow.com/questions/73275184/enable-shared-array-buffer-in-cross-domain
// - https://blog.logrocket.com/understanding-sharedarraybuffer-and-cross-origin-isolation/
// - https://github.com/ffmpegwasm/react-app/issues/3
//
"Cross-Origin-Embedder-Policy": "require-corp",
"Cross-Origin-Opener-Policy": "same-origin",
});
const IdealEnigma = withProtectionRoute(()=><PageEnigma />);
export default IdealEnigma;
+34
View File
@@ -0,0 +1,34 @@
import type { MetaFunction } from "@remix-run/deno";
import { TopBarHelmet } from "~/modules/TopBarHelmet";
import sonic from "./_assets/sonic-the-hedgehog-classic-sonic.gif";
import { useSignals } from "@preact/signals-react/runtime";
import { useEffect } from "react";
import { pageHeight, pageWidth } from "~/store";
import { sidePanelWidth, timelineHeight } from "~/pages/PageEnigma/store";
export const meta: MetaFunction = () => {
return [
{ title: "New Remix App" },
{ name: "description", content: "Welcome to Remix!" },
];
};
export default function Sonic() {
return (
<div className="size-full">
<TopBarHelmet>{null}</TopBarHelmet>
<img
alt="sonic"
src={sonic}
className="
fixed
left-0 top-0
-z-10 h-screen
w-screen
object-cover
"
/>
</div>
);
}
+30 -32
View File
@@ -1,34 +1,32 @@
import type { MetaFunction } from "@remix-run/deno";
import { TopBarHelmet } from "~/modules/TopBarHelmet";
import type { HeadersFunction } from "@remix-run/deno";
import { withProtectionRoute } from "~/modules/withProtectedRoute";
import { PageEnigma } from "~/pages/PageEnigma";
import sonic from "./_assets/sonic-the-hedgehog-classic-sonic.gif";
import { useSignals } from "@preact/signals-react/runtime";
import { useEffect } from "react";
import { pageHeight, pageWidth } from "~/store";
import { sidePanelWidth, timelineHeight } from "~/pages/PageEnigma/store";
// NB(bt): Netlify's custom directives cannot set headers for pages served by Remix,
// so we must specify them here instead. Netlify header rules (in either _headers or
// netlify.toml) will apply to statically served files (images, css, js), however.
// Setting these headers in `vite.config.ts` will also fail to apply them in
// production.
export const headers: HeadersFunction = ({
actionHeaders,
errorHeaders,
loaderHeaders,
parentHeaders,
}) => ({
// NB(bt): The following two headers are required for enabling SharedArrayBuffer (required by
// ffmpeg.wasm) in the post-SPECTRE world. Without these headers being sent by the page, the
// page cannot use SharedArrayBuffer. Downstream services must also set relevant CORS headers.
//
// See the following documentation on how this complex system works:
//
// - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements
// - https://stackoverflow.com/questions/73275184/enable-shared-array-buffer-in-cross-domain
// - https://blog.logrocket.com/understanding-sharedarraybuffer-and-cross-origin-isolation/
// - https://github.com/ffmpegwasm/react-app/issues/3
//
"Cross-Origin-Embedder-Policy": "require-corp",
"Cross-Origin-Opener-Policy": "same-origin",
});
export const meta: MetaFunction = () => {
return [
{ title: "New Remix App" },
{ name: "description", content: "Welcome to Remix!" },
];
};
export default function Index() {
return (
<div className="size-full">
<TopBarHelmet>{null}</TopBarHelmet>
<img
alt="sonic"
src={sonic}
className="
fixed
left-0 top-0
-z-10 h-screen
w-screen
object-cover
"
/>
</div>
);
}
const Index = withProtectionRoute(()=><PageEnigma />);
export default Index;