diff --git a/REWRITE_CHECKLIST.md b/REWRITE_CHECKLIST.md index 5bbdac1..a7f4622 100644 --- a/REWRITE_CHECKLIST.md +++ b/REWRITE_CHECKLIST.md @@ -18,6 +18,9 @@ Complete list of components needed for 1:1 functionality with the original site. - [ ] Created/Updated/Published markers - [ ] Robots.txt generation - [ ] Sitemap txt & xml generation + +## Secondary + - [X] Hot reload - [ ] Hot reload when runtime scripts change - [ ] Base design & stylesheet diff --git a/packages/site/assets/scripts/old/components/now-listening/nowListening.tsx b/packages/site/assets/scripts/components/now-listening/nowListening.tsx similarity index 97% rename from packages/site/assets/scripts/old/components/now-listening/nowListening.tsx rename to packages/site/assets/scripts/components/now-listening/nowListening.tsx index bb3aea3..20a8b4e 100644 --- a/packages/site/assets/scripts/old/components/now-listening/nowListening.tsx +++ b/packages/site/assets/scripts/components/now-listening/nowListening.tsx @@ -1,5 +1,5 @@ -import jsx from '../../jsx'; -import { getElementsByClassName } from '../../utils'; +import jsx from '../../old/jsx'; +import { getElementsByClassName } from '../../old/utils'; const tempUrl = 'https://d1nx86j0adclnv.cloudfront.net'; interface PlexNowListening { diff --git a/packages/site/assets/scripts/old/script.ts b/packages/site/assets/scripts/old/script.ts index 0f882b2..8d45f77 100644 --- a/packages/site/assets/scripts/old/script.ts +++ b/packages/site/assets/scripts/old/script.ts @@ -14,7 +14,6 @@ import { setupBlueSkyComments } from './bluesky'; import { handleWebmentions } from './webmentions'; import { setupUpdatedElements } from './manual-updated'; import { setupMathjax } from './setup-mathjax'; -import { getCurrentListen } from './components/now-listening/nowListening'; /** This file blocks rendering and will run before any dom content loads, call heavy functions in a listener! */ @@ -39,6 +38,4 @@ document.addEventListener('DOMContentLoaded', async function () { setupBlueSkyComments(), handleWebmentions(), ]); - - void getCurrentListen(); }); diff --git a/packages/site/assets/scripts/script.ts b/packages/site/assets/scripts/script.ts new file mode 100644 index 0000000..20fb135 --- /dev/null +++ b/packages/site/assets/scripts/script.ts @@ -0,0 +1,3 @@ +import { NowListening } from './components/now-listening/nowListening'; + +customElements.define('now-listening', NowListening); diff --git a/packages/site/external.d.ts b/packages/site/external.d.ts new file mode 100644 index 0000000..4cb4dc5 --- /dev/null +++ b/packages/site/external.d.ts @@ -0,0 +1,20 @@ +/// + +declare namespace JSX { + // The return type of our JSX Factory: this could be anything + type Element = HTMLElement; + + // IntrinsicElementMap grabs all the standard HTML tags in the TS DOM lib. + interface IntrinsicElements extends IntrinsicElementMap {} + + // The following are custom types, not part of TS's known JSX namespace: + type IntrinsicElementMap = { + [K in keyof HTMLElementTagNameMap | string]: { + [k: string]: any; + }; + }; + + interface Component { + (properties?: { [key: string]: any }, children?: Node[]): Node; + } +}