-
Notifications
You must be signed in to change notification settings - Fork 626
refactor: switch to fresh #2016
Conversation
# Conflicts: # components/Registry.tsx
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/denoland/deno-website2/GfRQszxL521hTBgpcS621z8vLfjk |
import "https://esm.sh/prismjs@1.25.0/components/prism-bash?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-batch?no-check"; | ||
import "https://esm.sh/prismjs@1.25.0/components/prism-css?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-css-extras?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-editorconfig?no-check"; | ||
import "https://esm.sh/prismjs@1.25.0/components/prism-diff?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-docker?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-git?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-ignore?no-check"; | ||
import "https://esm.sh/prismjs@1.25.0/components/prism-javascript?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-js-extras?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-js-templates?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-jsdoc?no-check"; | ||
import "https://esm.sh/prismjs@1.25.0/components/prism-json?no-check"; | ||
import "https://esm.sh/prismjs@1.25.0/components/prism-jsx?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-markdown?no-check"; | ||
import "https://esm.sh/prismjs@1.25.0/components/prism-rust?no-check"; | ||
//import "https://esm.sh/prismjs@1.25.0/components/prism-toml?no-check"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these dont work, so will look into this on a later date
@@ -45,164 +64,94 @@ export interface CodeBlockProps { | |||
export function RawCodeBlock({ | |||
code, | |||
language, | |||
className: extraClassName, | |||
class: extraClassName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be preferable to avoid keywords like class
... is there a reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we declare classes with class
attribute, this is just to keep in line with that
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta property="og:locale" content="en_US" /> | ||
<meta property="og:site_name" content="DenoLand" /> | ||
<meta | ||
property="og:title" | ||
content="Deno - A modern runtime for JavaScript and TypeScript" | ||
/> | ||
<meta | ||
property="og:description" | ||
content="Deno is a simple, modern runtime for JavaScript and | ||
TypeScript that uses V8 and is built in Rust." | ||
/> | ||
<meta property="og:image" content="/images/icons/icon-512x512.png" /> | ||
<meta property="og:type" content="website" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for now but I'd really like to have custom og:description
for each page in the future. Current og behavior is pretty obnoxious and not very useful.
async function getVersionList(module) { | ||
const url = \`${CDN_ENDPOINT}\${module}/meta/versions.json\`; | ||
const res = await fetch(url, { | ||
headers: { | ||
accept: 'application/json', | ||
}, | ||
}); | ||
if (res.status === 403 || res.status === 404) return null; | ||
if (res.status !== 200) { | ||
throw Error( | ||
\`Got an error (\${res.status}) while getting the version list:\\n\${await res | ||
.text()}\`, | ||
); | ||
} | ||
|
||
return await res.json(); | ||
} | ||
|
||
function updateWebhookUrl() { | ||
const name = document.getElementById('modulename').value; | ||
const subdir = document.getElementById('subdirectory').value; | ||
document.getElementById('webhookURL').innerText = \`https://api.deno.land/webhook/gh/\${name}\${subdir ? ('?subdir=' + encodeURIComponent(subdir)) : ''}\`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not for now, but string literals is not the ideal place to be programming... Why isn't fresh's esbuild capabilities not sufficient ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - massive rewrite @crowlKats - nice work!
Left to do:
module file search &manual searchbars