Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions app/routes/LandingPageRoute.res
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ let default = () => {
"web development",
]
/>
<LandingPageLayout>
<> </>
</LandingPageLayout>
<LandingPageLayout />
</>
}
12 changes: 6 additions & 6 deletions markdown-pages/blog/release-12-0-0.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ Note that `Result.getOrThrow` now throws a JavaScript exception, so please updat

We’ve renamed JS errors to `JsError.t` to better distinguish them from the `Result.Error` variant. Since JavaScript allows throwing anything (not only proper Error objects), the previous way of catching JS exceptions was unsafe:

```res
```rescript
let foo = switch myUnsafeJsResult() {
| exception Exn.Error(e) => Error(e->Error.message)
// ☝️ this will crash if `e` is undefined or null
// ☝️ this will crash if `e` is undefined or null
| myRes => Ok(myRes)
}
```
Expand All @@ -209,17 +209,17 @@ Additionally, the coexistence of `Result.Error` and the `Error` module caused co

The new recommended pattern is:

```res
```rescript
let foo = switch myUnsafeJsResult() {
| exception JsExn(e) => Error(e->JsExn.message))
// ☝️ this is now safe even `e` is undefined or null
| exception JsExn(e) => Error(e->JsExn.message)
// ☝️ this is now safe even if `e` is undefined or null
| myRes => Ok(myRes)
}
```

Utility helpers for working with JS errors are now in `JsError`, eg:

```res
```rescript
JsError.throw(JsError.RangeError.make("the payload should be below 16"))
```

Expand Down
2 changes: 1 addition & 1 deletion src/BlogLoader.res
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ let transform = (mdx: Mdx.attributes): BlogApi.post => {
username: "rescript-team",
fullname: "ReScript Team",
role: "Core Development",
imgUrl: "https://pbs.twimg.com/profile_images/1358354824660541440/YMKNWE1V_400x400.png",
imgUrl: "/brand/rescript-brandmark.svg",
social: X("rescriptlang"),
}),
co_authors: (mdx.co_authors->Nullable.getOr([]) :> array<BlogFrontmatter.author>),
Expand Down
2 changes: 1 addition & 1 deletion src/common/BlogFrontmatter.res
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ let authors = [
username: "rescript-team",
fullname: "ReScript Team",
role: "Core Development",
imgUrl: "https://pbs.twimg.com/profile_images/1358354824660541440/YMKNWE1V_400x400.png",
imgUrl: "/brand/rescript-brandmark.svg",
social: X("rescriptlang"),
},
{
Expand Down
10 changes: 7 additions & 3 deletions src/components/CodeMirror.res
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,14 @@ let createEditor = (config: editorConfig): editorInstance => {
".cm-activeLine": dict{
"backgroundColor": "rgba(255, 255, 255, 0.02)",
},
".cm-gutters": dict{"backgroundColor": "inherit"},
".cm-gutters": dict{
"color": "#696b7d",
"backgroundColor": "transparent",
"backdropFilter": "blur(var(--blur-sm))",
},
".cm-gutters.cm-gutters-before": dict{"border": "none"},
".cm-activeLineGutter": dict{
"color": "#cdcdd6",
".cm-gutterElement.cm-activeLineGutter": dict{
"color": "#ffffff",
"backgroundColor": "inherit",
},
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": dict{
Expand Down
3 changes: 1 addition & 2 deletions src/layouts/LandingPageLayout.res
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ module CuratedResources = {
}

@react.component
let make = (~components=MarkdownComponents.default, ~children) => {
let make = (~components=MarkdownComponents.default) => {
<>
<Meta
title="The ReScript Programming Language"
Expand Down Expand Up @@ -708,7 +708,6 @@ let make = (~components=MarkdownComponents.default, ~children) => {
<OtherSellingPoints />
<TrustedBy />
<CuratedResources />
children
</div>
</div>
</main>
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/LandingPageLayout.resi
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@react.component
let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element
let make: (~components: MarkdownComponents.t=?) => React.element