Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a2b665e
another try
tsnobip Nov 6, 2025
e83364e
fix expected static flag missing
tsnobip Nov 16, 2025
5abd1de
remove unused CM5 modes
tsnobip Nov 16, 2025
24e53a3
remove unused focused row
tsnobip Nov 16, 2025
30c3b51
remove unused props
tsnobip Nov 17, 2025
002f902
use the same highlight style for string and special string
tsnobip Nov 17, 2025
98a24b9
simplify codemirror styling
tsnobip Nov 17, 2025
d6de60a
use CM editor for the source of truth of code
tsnobip Nov 18, 2025
498f99b
add an error message when compiler versions can't be loaded
tsnobip Nov 18, 2025
457407f
add back hover hints
tsnobip Nov 18, 2025
7cafb75
style playground closer to V5 version
tsnobip Nov 18, 2025
b0d1689
use rescript-lezer from npm
tsnobip Nov 18, 2025
dce69ff
remove unused codemirror theme
tsnobip Nov 18, 2025
bdb5628
format
tsnobip Nov 18, 2025
ab0a53f
update package lock
tsnobip Nov 18, 2025
cfd6976
remove unused file
tsnobip Nov 21, 2025
d4006b9
remove ansi colors from linter messages
tsnobip Nov 21, 2025
7bc23dc
use dict for more type safe theme
tsnobip Nov 21, 2025
92e437d
improve selection style
tsnobip Nov 21, 2025
c544096
improve JSX intrinsic element highlighting
tsnobip Nov 24, 2025
f5724a8
highlight async/await, `and` and bitwise operators
tsnobip Nov 24, 2025
a17aae8
improve selection match styling
tsnobip Nov 24, 2025
a2390ec
set the theme as dark
tsnobip Nov 24, 2025
cdcfa34
update llms.mdx
tsnobip Nov 24, 2025
655d09b
improve highlighting of record/object definition and field access
tsnobip Nov 24, 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
40 changes: 26 additions & 14 deletions app/routes/TryRoute.res
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,26 @@ let loader = async () => {
)
}

let versions = {
let response = await fetch(versionsBaseUrl + "/playground-bundles/versions.json")
let json = await WebAPI.Response.json(response)
json
->JSON.Decode.array
->Option.getOrThrow
->Array.map(json => json->JSON.Decode.string->Option.getOrThrow)
}
try {
let versions = {
let response = await fetch(versionsBaseUrl + "/playground-bundles/versions.json")
let json = await WebAPI.Response.json(response)
json
->JSON.Decode.array
->Option.getOrThrow
->Array.map(json => json->JSON.Decode.string->Option.getOrThrow)
}

{
bundleBaseUrl,
versions,
Some({
bundleBaseUrl,
versions,
})
} catch {
| JsExn(e) =>
Console.error2("error while fetching compiler versions", e)
None
}
}

module ClientOnly = {
@react.component
let make = (~bundleBaseUrl, ~versions) => {
Expand All @@ -47,12 +52,19 @@ module ClientOnly = {
}

let default = () => {
let {bundleBaseUrl, versions} = ReactRouter.useLoaderData()
let data = ReactRouter.useLoaderData()
<>
<Meta
title="ReScript Playground" description="Try ReScript in the browser" ogImage="/og/try.png"
/>

<ClientOnly bundleBaseUrl versions />
{switch data {
| Some({bundleBaseUrl, versions}) => <ClientOnly bundleBaseUrl versions />
| None =>
<div className="mt-16 p-5 text-xl text-red-500 self-center">
<h1> {React.string("Oops an error occurred!")} </h1>
{React.string("The playground cannot be loaded, please try again in a few moments.")}
</div>
}}
</>
}
2 changes: 1 addition & 1 deletion app/routes/TryRoute.resi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ type props = {
versions: array<string>,
}

let loader: unit => promise<props>
let loader: unit => promise<option<props>>

let default: unit => React.element
10 changes: 5 additions & 5 deletions markdown-pages/docs/manual/llms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: "LLMs"
description: "Documentation for LLMs"
canonical: "/docs/manual/llms"
section: "Overview"
order: 5
order: 4
---

# Documentation for LLMs
Expand All @@ -12,13 +12,13 @@ We adhere to the [llms.txt convention](https://llmstxt.org/) to make documentati

Currently, we have the following files...

- [/manual/llms.txt](/llms/manual/llms.txt) — a list of the available files for ReScript language.
- [/manual/llm-full.txt](/llms/manual/llm-full.txt) — complete documentation for ReScript language.
- [/manual/llm-small.txt](/llms/manual/llm-small.txt) — compressed version of the former, without examples.
- [/docs/manual/llms.txt](/llms/manual//llms.txt) — a list of the available files for ReScript language.
- [/docs/manual/llm-full.txt](/llms/manual//llm-full.txt) — complete documentation for ReScript language.
- [/docs/manual/llm-small.txt](/llms/manual//llm-small.txt) — compressed version of the former, without examples.

...and package-level documentation:

- [/react/llms](../react/llms.mdx) — the LLms documentation for ReScript React.
- [/docs/react/llms](../react/llms.mdx) — the LLms documentation for ReScript React.

## Notes

Expand Down
8 changes: 4 additions & 4 deletions markdown-pages/docs/react/llms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ We adhere to the [llms.txt convention](https://llmstxt.org/) to make documentati

Currently, we have the following files...

- [/react/llms.txt](/llms/react/llms.txt) — a list of the available files for ReScript React.
- [/react/llms-full.txt](/llms/react/llms-full.txt) — complete documentation for ReScript React.
- [/react/llms-small.txt](/llms/react/llms-small.txt) — compressed version of the former, without examples for ReScript React.
- [/docs/react/llms.txt](/llms/react/llms.txt) — a list of the available files for ReScript React.
- [/docs/react/llms-full.txt](/llms/react/llm-full.txt) — complete documentation for ReScript React.
- [/docs/react/llms-small.txt](/llms/react/llm-small.txt) — compressed version of the former, without examples for ReScript React.

...and the language documentation:

- [/manual/llms](../manual/llms.mdx) — the LLms documentation for ReScript.
- [/docs/manual/llms](../manual/llms.mdx) — the LLms documentation for ReScript.

## Notes

Expand Down
Loading