Skip to content

Commit 275503c

Browse files
authored
Polish v12 blogpost and playground (#1150)
* use self-hosted brand logo * remove typos * remove unused children * add backdrop blur to gutter
1 parent bc8925d commit 275503c

File tree

7 files changed

+18
-17
lines changed

7 files changed

+18
-17
lines changed

app/routes/LandingPageRoute.res

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ let default = () => {
1212
"web development",
1313
]
1414
/>
15-
<LandingPageLayout>
16-
<> </>
17-
</LandingPageLayout>
15+
<LandingPageLayout />
1816
</>
1917
}

markdown-pages/blog/release-12-0-0.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ Note that `Result.getOrThrow` now throws a JavaScript exception, so please updat
197197

198198
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:
199199

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

210210
The new recommended pattern is:
211211

212-
```res
212+
```rescript
213213
let foo = switch myUnsafeJsResult() {
214-
| exception JsExn(e) => Error(e->JsExn.message))
215-
// ☝️ this is now safe even `e` is undefined or null
214+
| exception JsExn(e) => Error(e->JsExn.message)
215+
// ☝️ this is now safe even if `e` is undefined or null
216216
| myRes => Ok(myRes)
217217
}
218218
```
219219

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

222-
```res
222+
```rescript
223223
JsError.throw(JsError.RangeError.make("the payload should be below 16"))
224224
```
225225

src/BlogLoader.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let transform = (mdx: Mdx.attributes): BlogApi.post => {
1919
username: "rescript-team",
2020
fullname: "ReScript Team",
2121
role: "Core Development",
22-
imgUrl: "https://pbs.twimg.com/profile_images/1358354824660541440/YMKNWE1V_400x400.png",
22+
imgUrl: "/brand/rescript-brandmark.svg",
2323
social: X("rescriptlang"),
2424
}),
2525
co_authors: (mdx.co_authors->Nullable.getOr([]) :> array<BlogFrontmatter.author>),

src/common/BlogFrontmatter.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ let authors = [
5555
username: "rescript-team",
5656
fullname: "ReScript Team",
5757
role: "Core Development",
58-
imgUrl: "https://pbs.twimg.com/profile_images/1358354824660541440/YMKNWE1V_400x400.png",
58+
imgUrl: "/brand/rescript-brandmark.svg",
5959
social: X("rescriptlang"),
6060
},
6161
{

src/components/CodeMirror.res

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,14 @@ let createEditor = (config: editorConfig): editorInstance => {
695695
".cm-activeLine": dict{
696696
"backgroundColor": "rgba(255, 255, 255, 0.02)",
697697
},
698-
".cm-gutters": dict{"backgroundColor": "inherit"},
698+
".cm-gutters": dict{
699+
"color": "#696b7d",
700+
"backgroundColor": "transparent",
701+
"backdropFilter": "blur(var(--blur-sm))",
702+
},
699703
".cm-gutters.cm-gutters-before": dict{"border": "none"},
700-
".cm-activeLineGutter": dict{
701-
"color": "#cdcdd6",
704+
".cm-gutterElement.cm-activeLineGutter": dict{
705+
"color": "#ffffff",
702706
"backgroundColor": "inherit",
703707
},
704708
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": dict{

src/layouts/LandingPageLayout.res

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ module CuratedResources = {
677677
}
678678

679679
@react.component
680-
let make = (~components=MarkdownComponents.default, ~children) => {
680+
let make = (~components=MarkdownComponents.default) => {
681681
<>
682682
<Meta
683683
title="The ReScript Programming Language"
@@ -708,7 +708,6 @@ let make = (~components=MarkdownComponents.default, ~children) => {
708708
<OtherSellingPoints />
709709
<TrustedBy />
710710
<CuratedResources />
711-
children
712711
</div>
713712
</div>
714713
</main>

src/layouts/LandingPageLayout.resi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
@react.component
2-
let make: (~components: MarkdownComponents.t=?, ~children: React.element) => React.element
2+
let make: (~components: MarkdownComponents.t=?) => React.element

0 commit comments

Comments
 (0)