Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
71c2897
refactor: switch to React Router
jderochervlk Sep 28, 2025
3d46e64
refactor: add order and section to language manual frontmatter
jderochervlk Sep 28, 2025
365d522
Merge branch 'vlk/add-order-and-section-to-manual' of github.com:resc…
jderochervlk Sep 28, 2025
24c9fdc
add react
jderochervlk Sep 28, 2025
bce0ea1
Merge branch 'vlk/add-order-and-section-to-manual' of github.com:resc…
jderochervlk Sep 28, 2025
b3e42b7
improve css loading speed
jderochervlk Sep 28, 2025
62a4916
fix fouc
jderochervlk Sep 28, 2025
2a54652
fix css not loading
jderochervlk Sep 28, 2025
100fb4c
make sure progress is synced
jderochervlk Oct 1, 2025
3b5acdb
language manual
jderochervlk Oct 2, 2025
1217a60
working on tables
jderochervlk Oct 2, 2025
4d28ff6
back out table changes for now
jderochervlk Oct 2, 2025
a39d058
updating blog pages
jderochervlk Oct 3, 2025
06987bb
builds are working
jderochervlk Oct 3, 2025
5282ad2
copy to out folder
jderochervlk Oct 3, 2025
50c193e
add static server
jderochervlk Oct 3, 2025
b0c3673
cleanup some deps
jderochervlk Oct 5, 2025
d167bf2
cleanup some todo comments
jderochervlk Oct 5, 2025
f571352
configure loadmdx
jderochervlk Oct 5, 2025
8c812c6
tables looking good
jderochervlk Oct 5, 2025
96d9032
more mdx work
jderochervlk Oct 5, 2025
4732229
Merge branch 'master' of github.com:rescript-lang/rescript-lang.org i…
jderochervlk Oct 5, 2025
565e2d2
move react docs
jderochervlk Oct 7, 2025
009596d
react docs and anchor scrolling
jderochervlk Oct 7, 2025
c23be9b
fixed scrolling on full page nav
jderochervlk Oct 7, 2025
5a5904f
api is rendering
jderochervlk Oct 7, 2025
778f521
api prerender is working
jderochervlk Oct 7, 2025
f566bec
working on api table of contents
jderochervlk Oct 8, 2025
f478604
Initial plan
Copilot Oct 12, 2025
34acb8f
Migrate CodeMirror from v5 to v6 - initial implementation
Copilot Oct 12, 2025
1040aa7
Fix warnings and remove CodeMirror v5 dependency
Copilot Oct 12, 2025
cc339b5
Address code review feedback - fix import paths, error handling, and …
Copilot Oct 12, 2025
8311c48
Fix error validation logic - properly validate both line and column b…
Copilot Oct 12, 2025
6a1b928
Clarify error position indexing in comments - rows are 1-based, colum…
Copilot Oct 12, 2025
87c0785
Fix ReferenceError: createEditor is not defined - call function direc…
Copilot Oct 13, 2025
a631fc4
Format JavaScript files with Prettier
Copilot Oct 13, 2025
5ee2f10
Convert createEditor from raw JavaScript to native ReScript with comp…
Copilot Oct 13, 2025
924e84a
apidocs
jderochervlk Oct 13, 2025
1213a43
use more idiomatic rescript bindings
tsnobip Oct 13, 2025
bc74250
api nav is working
jderochervlk Oct 13, 2025
a90d0a8
trying to fix the inline codeblock
jderochervlk Oct 13, 2025
f8185ff
just remove it for now
jderochervlk Oct 13, 2025
23eaffe
fix &
jderochervlk Oct 13, 2025
31058cb
move syntax pages
jderochervlk Oct 13, 2025
6942b6b
working on blog listing page
jderochervlk Oct 14, 2025
0321c41
working on syntax page
jderochervlk Oct 14, 2025
e997c36
blog listing page is mostly working
jderochervlk Oct 15, 2025
a599198
update to rc.2
jderochervlk Oct 17, 2025
eed9347
blog post is rendering
jderochervlk Oct 17, 2025
bd882a6
fix archived blog posts
jderochervlk Oct 19, 2025
58001ca
Merge branch 'master' of github.com:rescript-lang/rescript-lang.org i…
jderochervlk Oct 19, 2025
0a505e7
static builds are working
jderochervlk Oct 19, 2025
9fe79d8
rendering community pages
jderochervlk Oct 19, 2025
f8dc09b
getting close
jderochervlk Oct 20, 2025
91f9442
package search
jderochervlk Oct 20, 2025
b07a66c
syntax lookup
jderochervlk Oct 20, 2025
dc0ad5d
remove package-lock
jderochervlk Oct 20, 2025
654f09e
rebuild package lock
jderochervlk Oct 20, 2025
b7ba93f
fix webapi
jderochervlk Oct 20, 2025
9ce7121
fixes
jderochervlk Oct 20, 2025
14f7bd2
Merge branch 'master' of github.com:rescript-lang/rescript-lang.org i…
jderochervlk Oct 20, 2025
0fcf8a8
Merge branch 'copilot/migrate-playground-to-cm-v6' of github.com:resc…
jderochervlk Oct 20, 2025
9272d9d
control panel
jderochervlk Oct 20, 2025
7d7bbdf
fix divider
jderochervlk Oct 20, 2025
f676837
more cleanup
jderochervlk Oct 20, 2025
8f15c78
more style fixes
jderochervlk Oct 20, 2025
89112cc
config cleanup
jderochervlk Oct 20, 2025
b1156d8
delete pages folder
jderochervlk Oct 20, 2025
ec22753
Merge branch 'master' of github.com:rescript-lang/rescript-lang.org i…
jderochervlk Oct 21, 2025
0b63251
rebuild package lock and remove .nvmrc
jderochervlk Oct 21, 2025
a5bbc50
try fixing missing types
jderochervlk Oct 22, 2025
219742d
add search
jderochervlk Oct 22, 2025
c9f8095
use npm build
jderochervlk Oct 22, 2025
011e271
fix typo
jderochervlk Oct 22, 2025
7a22a0a
fix package lock webapi version
jderochervlk Oct 22, 2025
0b9887a
run formatter
jderochervlk Oct 22, 2025
ba425b2
rollback codemirror
jderochervlk Oct 23, 2025
201a0ea
back to codemirror 5
jderochervlk Oct 23, 2025
3d650b7
Revert "use more idiomatic rescript bindings"
jderochervlk Oct 23, 2025
ad9b581
back to codemirror 5
jderochervlk Oct 23, 2025
a0ce329
Revert "rollback codemirror"
jderochervlk Oct 23, 2025
7dbe3df
playground is working
jderochervlk Oct 23, 2025
45b99f2
fix background color on dropdown
jderochervlk Oct 23, 2025
3015186
warning table
jderochervlk Oct 23, 2025
d5b111b
docson
jderochervlk Oct 23, 2025
1882fa0
fixed markdown
jderochervlk Oct 23, 2025
3852202
import css
jderochervlk Oct 24, 2025
70aeb1c
remove trailing ;
jderochervlk Oct 24, 2025
ce8576d
add back tests
jderochervlk Oct 24, 2025
7dc4b86
fix doc tests
jderochervlk Oct 24, 2025
0304baa
remove href test
jderochervlk Oct 24, 2025
d48b592
test out redirects
jderochervlk Oct 24, 2025
8547f39
formatting
jderochervlk Oct 24, 2025
11a742f
add 404 page
jderochervlk Oct 24, 2025
91d8860
typo in redirects
jderochervlk Oct 24, 2025
3b0bd2d
fix filename
jderochervlk Oct 24, 2025
20a153b
fix prettier ignore
jderochervlk Oct 24, 2025
113e21b
preconnect to css
jderochervlk Oct 24, 2025
ff62b7b
fix flicker
jderochervlk Oct 24, 2025
9f886db
fix community link
jderochervlk Oct 24, 2025
2d42ed9
Fix community links
jderochervlk Oct 24, 2025
2b785e2
fix search box and docson
jderochervlk Oct 26, 2025
14d00a1
getting meta tags to work
jderochervlk Nov 4, 2025
666f235
meta tags
jderochervlk Nov 4, 2025
20227bb
Merge branch 'master' of github.com:rescript-lang/rescript-lang.org i…
jderochervlk Nov 4, 2025
7cf2561
fix image imports after merge
jderochervlk Nov 4, 2025
6880219
formatting
jderochervlk Nov 4, 2025
2074165
align naming for Lazy components
jderochervlk Nov 5, 2025
416591a
add scroll lock and fix mobile nav bar
jderochervlk Nov 6, 2025
b438b3b
fix edit link
jderochervlk Nov 6, 2025
82f90fa
close mobile navbar and disable scroll lock on navigation
jderochervlk Nov 6, 2025
05bb0b4
fix non doc page mobile nav
jderochervlk Nov 6, 2025
b80a9b1
fix syntax lookup url
jderochervlk Nov 6, 2025
bc07101
pr feedback
jderochervlk Nov 6, 2025
f20ebd5
clean up todos
jderochervlk Nov 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
meta tags
  • Loading branch information
jderochervlk committed Nov 4, 2025
commit 666f23588bf982ce33c249f4f37cff5703d542a5
4 changes: 4 additions & 0 deletions app/root.res
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ let default = () => {
<link rel="stylesheet" href={hljsCss} />
<link rel="stylesheet" href={utilsCss} />
<link rel="icon" href="/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, minimal-ui"
/>
<meta charSet="UTF-8" />
</head>
<body>
Expand Down
17 changes: 9 additions & 8 deletions app/routes/BlogRoute.res
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ let loader: ReactRouter.Loader.t<loaderData> = async ({request}) => {
let default = () => {
let {posts, category} = ReactRouter.useLoaderData()
<>
<title>
{React.string(
`${switch category {
| All => "All Posts"
| Archived => "Archived Posts"
}} | ReScript Blog`,
)}
</title>
<Meta
siteName="ReScript Blog"
title={`${switch category {
| All => "All Posts"
| Archived => "Archived Posts"
}} | ReScript Blog`}
description="News, Announcements, Release Notes and more"
/>

<Blog posts category />
</>
}
4 changes: 0 additions & 4 deletions app/routes/CommunityRoute.res

This file was deleted.

13 changes: 12 additions & 1 deletion app/routes/LandingPageRoute.res
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
let default = () => {
<>
<title> {React.string("The ReScript Programming Language")} </title>
<Meta
title="The ReScript Programming Language"
description="Fast, Simple, Fully Typed JavaScript from the Future"
keywords=[
"JavaScript",
"JS",
"programming language",
"ReScript",
"rescriptlang",
"web development",
]
/>
<LandingPageLayout>
<> </>
</LandingPageLayout>
Expand Down
61 changes: 30 additions & 31 deletions app/routes/MdxRoute.res
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
open ReactRouter
open Mdx

type loaderData = {
Expand Down Expand Up @@ -133,7 +132,7 @@ let communityTableOfContents = async () => {
categories
}

let loader: Loader.t<loaderData> = async ({request}) => {
let loader: ReactRouter.Loader.t<loaderData> = async ({request}) => {
let {pathname} = WebAPI.URL.make(~url=request.url)

let mdx = await loadMdx(request, ~options={remarkPlugins: [Mdx.gfm]})
Expand Down Expand Up @@ -264,39 +263,41 @@ let loader: Loader.t<loaderData> = async ({request}) => {
}

let default = () => {
let {pathname} = useLocation()
let {pathname} = ReactRouter.useLocation()
let component = useMdxComponent(~components)
let attributes = useMdxAttributes()

let loaderData: loaderData = useLoaderData()
let loaderData: loaderData = ReactRouter.useLoaderData()

let {entries, categories, title} = loaderData

<>
{title != "" ? <title> {React.string(title)} </title> : React.null}
<meta name="description" content={attributes.description->Nullable.getOr("")} />
{if (pathname :> string) == "/docs/manual/api" {
<ApiOverviewLayout.Docs>
<div className="markdown-body"> {component()} </div>
</ApiOverviewLayout.Docs>
<>
<Meta title=title description={attributes.description->Nullable.getOr("ReScript API")} />
<ApiOverviewLayout.Docs>
<div className="markdown-body"> {component()} </div>
</ApiOverviewLayout.Docs>
</>
} else if (
(pathname :> string)->String.includes("docs/manual") ||
(pathname :> string)->String.includes("docs/react")
) {
<DocsLayout
categories
activeToc={title: "Introduction", entries}
breadcrumbs=?loaderData.breadcrumbs
editHref={`https://github.com/rescript-lang/rescript-lang.org/blob/master/pages${attributes.path}.mdx`}
>
<div className="markdown-body pt-20 md:pt-0"> {component()} </div>
</DocsLayout>
<>
<Meta title=title description={attributes.description->Nullable.getOr("")} />
<DocsLayout
categories
activeToc={title: "Introduction", entries}
breadcrumbs=?loaderData.breadcrumbs
editHref={`https://github.com/rescript-lang/rescript-lang.org/blob/master/pages${attributes.path}.mdx`}
>
<div className="markdown-body pt-20 md:pt-0"> {component()} </div>
</DocsLayout>
</>
} else if (pathname :> string)->String.includes("community") {
<div>
<CommunityLayout categories entries>
<div className="markdown-body"> {component()} </div>
</CommunityLayout>
</div>
<CommunityLayout categories entries>
<div className="markdown-body"> {component()} </div>
</CommunityLayout>
} else if (pathname :> string)->String.includes("blog") {
switch loaderData.blogPost {
| Some({frontmatter, archived, path}) =>
Expand All @@ -307,13 +308,13 @@ let default = () => {
switch loaderData.mdxSources {
| Some(mdxSources) =>
<>
<title>
{React.string(
`${loaderData.activeSyntaxItem
->Option.map(item => item.name)
->Option.getOr("Syntax Lookup")} | ReScript API`,
)}
</title>
<Meta
title={loaderData.activeSyntaxItem
->Option.map(item => item.name)
->Option.getOr("Syntax Lookup | ReScript API")}
description={attributes.description->Nullable.getOr("")}
/>

<SyntaxLookup mdxSources activeItem=?loaderData.activeSyntaxItem>
{component()}
</SyntaxLookup>
Expand All @@ -322,6 +323,4 @@ let default = () => {
}
}}
</>

// </ManualDocsLayout.V1200Layout>
}
6 changes: 5 additions & 1 deletion app/routes/PackagesRoute.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ let loader = async () => {
let default = () => {
let props = ReactRouter.useLoaderData()
<>
<title> {React.string("Package Index | ReScript Documentation")} </title>
<Meta
ogSiteName="ReScript Packages"
title="Package Index | ReScript Documentation"
description="Official and unofficial resources, libraries and bindings for ReScript"
/>
<Packages {...props} />
</>
}
5 changes: 4 additions & 1 deletion app/routes/TryRoute.res
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ module ClientOnly = {
let default = () => {
let {bundleBaseUrl, versions} = ReactRouter.useLoaderData()
<>
<title> {React.string("ReScript Playground")} </title>
<Meta
title="ReScript Playground" description="Try ReScript in the browser" ogImage="/og/try.png"
/>

<ClientOnly bundleBaseUrl versions />
</>
}
5 changes: 0 additions & 5 deletions src/Blog.res
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ type params = {slug: string}
@react.component
let make = (~posts: array<BlogApi.post>, ~category: category): React.element => {
let content = if Array.length(posts) === 0 {
/* <div> {React.string("Currently no posts available")} </div>; */
<div className="mt-8">
<Markdown.H1> {React.string("Blog not yet available")} </Markdown.H1>
<Markdown.Warn> {React.string("This blog is currently in the works.")} </Markdown.Warn>
Expand Down Expand Up @@ -259,12 +258,8 @@ let make = (~posts: array<BlogApi.post>, ~category: category): React.element =>
}

let (isOverlayOpen, setOverlayOpen) = React.useState(() => false)
let title = "Blog | ReScript Documentation"

<>
<Meta
siteName="ReScript Blog" title description="News, Announcements, Release Notes and more"
/>
<div className="mt-16 pt-2">
<div className="text-gray-80 text-18">
<div className="flex justify-center overflow-hidden">
Expand Down
50 changes: 8 additions & 42 deletions src/common/Util.res
Original file line number Diff line number Diff line change
@@ -1,44 +1,3 @@
/**
module Debounce = {
// See: https://davidwalsh.name/javascript-debounce-function
let debounce = (~wait, fn) => {
let timeout = ref(None)

() => {
let unset = () => timeout := None

switch timeout.contents {
| Some(id) => Js.Global.clearTimeout(id)
| None => fn()
}
timeout := Some(Js.Global.setTimeout(unset, wait))
}
}

let debounce3 = (~wait, ~immediate=false, fn) => {
let timeout = ref(None)

(a1, a2, a3) => {
let unset = () => {
timeout := None
immediate ? fn(a1, a2, a3) : ()
}

switch timeout.contents {
| Some(id) => Js.Global.clearTimeout(id)
| None => fn(a1, a2, a3)
}
timeout := Some(Js.Global.setTimeout(unset, wait))

if immediate && timeout.contents === None {
fn(a1, a2, a3)
} else {
()
}
}
}
}
**/
module Unsafe = {
external elementAsString: React.element => string = "%identity"
}
Expand All @@ -51,9 +10,16 @@ module String = {
let capitalize: string => string = %raw("str => {
return str && str.charAt(0).toUpperCase() + str.substring(1);
}")

let capitalizeSentence = str =>
str
->String.split(" ")
->Array.map(str => str->String.length > 2 ? str->String.capitalize : str)
->Array.join(" ")
}

module Url = {
// TODO: convert to ReScript
let isAbsolute: string => bool = %raw(`
function(str) {
var r = new RegExp('^(?:[a-z]+:)?//', 'i');
Expand All @@ -63,7 +29,7 @@ module Url = {
}
return false;
}
`) //', 'i');
`)
}

module Date = {
Expand Down
1 change: 1 addition & 0 deletions src/common/Util.resi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module Unsafe: {
module String: {
let camelCase: string => string
let capitalize: string => string
let capitalizeSentence: string => string
}

module Date: {
Expand Down
19 changes: 4 additions & 15 deletions src/components/Meta.res
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let make = (
~canonical=?,
~title=?,
~ogLocale="en_US",
~ogSiteName=?,
~ogSiteName=siteName,
~ogDescription=description,
~ogTitle=?,
~ogImage="/Art-3-rescript-launch.jpg",
Expand All @@ -23,11 +23,6 @@ let make = (
| Some(title) => title
}

let ogSiteName = switch ogSiteName {
| Some(ogSiteName) => ogSiteName
| None => siteName
}

let ogTitle = switch ogTitle {
| Some(ogTitle) => ogTitle
| None => title
Expand Down Expand Up @@ -67,14 +62,8 @@ let make = (
<meta key="twitter:card" name="twitter:card" content="summary_large_image" />
<link rel="alternate" type_="application/rss+xml" title="ReScript Blog" href="/blog/feed.xml" />
// Docsearch meta tags
<meta
name="docsearch:version"
content={switch version {
| Some(Version(v)) => v
| Some(Latest) => Constants.versions.latest
| Some(Next) => Constants.versions.next
| _ => Constants.versions.latest
}}
/>
<meta name="docsearch:version" content="v12" />
// Robots meta tag
<meta name="robots" content="index, follow" />
</>
}
8 changes: 1 addition & 7 deletions src/layouts/ApiOverviewLayout.res
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Sidebar = SidebarLayout.Sidebar

// TODO RR7 - do I need this?
let categories: array<Sidebar.Category.t> = [
{
name: "Overview",
Expand Down Expand Up @@ -46,12 +45,7 @@ module Docs = {
/>

<SidebarLayout
breadcrumbs
categories
// metaTitle="API"
sidebarState=(isSidebarOpen, setSidebarOpen)
theme={#Js}
sidebar
breadcrumbs categories sidebarState=(isSidebarOpen, setSidebarOpen) theme={#Js} sidebar
>
children
</SidebarLayout>
Expand Down
44 changes: 28 additions & 16 deletions src/layouts/CommunityLayout.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,35 @@
let make = (~children, ~categories, ~entries) => {
let {pathname} = ReactRouter.useLocation()

Console.log((pathname :> string)->String.split("/"))

let activePage =
(pathname :> string)
->String.split("/")
->Array.filter(str => str !== "")
->Array.at(1)
->Option.getOr("Community")
->String.replaceAll("-", " ")
->Util.String.capitalizeSentence

let breadcrumbs = list{{Url.name: "Community", href: "/community"}}

let (isSidebarOpen, setSidebarOpen) = React.useState(_ => false)

<SidebarLayout
sidebar={<SidebarLayout.Sidebar
categories
isOpen={isSidebarOpen}
route=pathname
toggle={() => setSidebarOpen(prev => !prev)}
activeToc={title: "Overview", entries}
/>}
sidebarState=(isSidebarOpen, setSidebarOpen)
theme=#Reason
// metaTitle="ReScript Community"
breadcrumbs
>
children
</SidebarLayout>
<>
<Meta title={`${activePage} | ReScript Community`} />
<SidebarLayout
sidebar={<SidebarLayout.Sidebar
categories
isOpen={isSidebarOpen}
route=pathname
toggle={() => setSidebarOpen(prev => !prev)}
activeToc={title: "Overview", entries}
/>}
sidebarState=(isSidebarOpen, setSidebarOpen)
theme=#Reason
breadcrumbs
>
children
</SidebarLayout>
</>
}
Loading