diff --git a/package-lock.json b/package-lock.json index 12cf8a86d..b7352781c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,9 +15,7 @@ "@docsearch/react": "^3.5.2", "@headlessui/react": "^1.2.0", "@mdx-js/loader": "^3.1.0", - "@rescript/core": "^1.4.0", "@rescript/react": "^0.12.0-alpha.3", - "@rescript/tools": "^0.5.0", "codemirror": "^5.54.0", "docson": "^2.1.0", "escodegen": "^2.1.0", @@ -44,7 +42,7 @@ "remark-rehype": "^11.1.1", "remark-stringify": "^11.0.0", "request": "^2.88.0", - "rescript": "^11.1.0", + "rescript": "^12.0.0-alpha.9", "stringify-object": "^3.3.0", "unified": "^11.0.5", "vfile-matter": "^5.0.0" @@ -1566,14 +1564,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/@rescript/core": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@rescript/core/-/core-1.4.0.tgz", - "integrity": "sha512-2zwlYp/SFvjb9M4PcS+NCTNXeXJ9ZHSn5Q4o+EQq9Yfc1jOgsAWqBhu7RW6n2IceugH0H/6eZjqYT7IZAoLRsw==", - "peerDependencies": { - "rescript": "^11.1.0-rc.7" - } - }, "node_modules/@rescript/react": { "version": "0.12.0-alpha.3", "resolved": "https://registry.npmjs.org/@rescript/react/-/react-0.12.0-alpha.3.tgz", @@ -1583,20 +1573,6 @@ "react-dom": ">=18.0.0" } }, - "node_modules/@rescript/tools": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@rescript/tools/-/tools-0.5.0.tgz", - "integrity": "sha512-gqKZhpXdFMRb0i+aCNKNtbHANFYC/nM7LLLRkkYQLgeJ2teVCV9otO09KIA7CvSZevN6x68r/dkeWi3klLdydA==", - "dependencies": { - "rescript": "^11.0.0-rc.7" - }, - "bin": { - "rescript-tools": "npm/cli.js" - }, - "engines": { - "node": "*" - } - }, "node_modules/@rushstack/eslint-patch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz", @@ -17174,17 +17150,20 @@ } }, "node_modules/rescript": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.0.tgz", - "integrity": "sha512-9la2Dv+ACylQ77I8s4spPu1JnLZXbH5WgxcLHLLUBWgFFSiv0wXqgzWztrBIZqwFgVX5BYcwldUqUVcEzdCyHg==", + "version": "12.0.0-alpha.9", + "resolved": "https://registry.npmjs.org/rescript/-/rescript-12.0.0-alpha.9.tgz", + "integrity": "sha512-h1RHv3AGge/td+4s3mufCyJkBQ+/OcQtu3RyvQjR0c3SZJNB87G/0LESoa7FLlKokwjtX+fpcIoQP9WK2PDAqQ==", "hasInstallScript": true, + "license": "SEE LICENSE IN LICENSE", "bin": { - "bsc": "bsc", + "bsc": "cli/bsc", "bstracing": "lib/bstracing", - "rescript": "rescript" + "rescript": "cli/rescript", + "rescript-tools": "cli/rescript-tools", + "rewatch": "cli/rewatch" }, "engines": { - "node": ">=10" + "node": ">=18" } }, "node_modules/resolve": { @@ -20110,26 +20089,12 @@ "tslib": "^2.6.0" } }, - "@rescript/core": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@rescript/core/-/core-1.4.0.tgz", - "integrity": "sha512-2zwlYp/SFvjb9M4PcS+NCTNXeXJ9ZHSn5Q4o+EQq9Yfc1jOgsAWqBhu7RW6n2IceugH0H/6eZjqYT7IZAoLRsw==", - "requires": {} - }, "@rescript/react": { "version": "0.12.0-alpha.3", "resolved": "https://registry.npmjs.org/@rescript/react/-/react-0.12.0-alpha.3.tgz", "integrity": "sha512-/S1uj77RPDzuLg3Ofb8KKU3Vppqy97/vF6bBdBZ+saIO9bpHVlsmmJyJG8QXjGZKE+aMynrrR3Tj4+9+5OzLdw==", "requires": {} }, - "@rescript/tools": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@rescript/tools/-/tools-0.5.0.tgz", - "integrity": "sha512-gqKZhpXdFMRb0i+aCNKNtbHANFYC/nM7LLLRkkYQLgeJ2teVCV9otO09KIA7CvSZevN6x68r/dkeWi3klLdydA==", - "requires": { - "rescript": "^11.0.0-rc.7" - } - }, "@rushstack/eslint-patch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.3.2.tgz", @@ -29624,9 +29589,9 @@ "dev": true }, "rescript": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.0.tgz", - "integrity": "sha512-9la2Dv+ACylQ77I8s4spPu1JnLZXbH5WgxcLHLLUBWgFFSiv0wXqgzWztrBIZqwFgVX5BYcwldUqUVcEzdCyHg==" + "version": "12.0.0-alpha.9", + "resolved": "https://registry.npmjs.org/rescript/-/rescript-12.0.0-alpha.9.tgz", + "integrity": "sha512-h1RHv3AGge/td+4s3mufCyJkBQ+/OcQtu3RyvQjR0c3SZJNB87G/0LESoa7FLlKokwjtX+fpcIoQP9WK2PDAqQ==" }, "resolve": { "version": "1.22.2", diff --git a/package.json b/package.json index 247171155..c855c1e16 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,7 @@ "@docsearch/react": "^3.5.2", "@headlessui/react": "^1.2.0", "@mdx-js/loader": "^3.1.0", - "@rescript/core": "^1.4.0", "@rescript/react": "^0.12.0-alpha.3", - "@rescript/tools": "^0.5.0", "codemirror": "^5.54.0", "docson": "^2.1.0", "escodegen": "^2.1.0", @@ -52,7 +50,7 @@ "remark-rehype": "^11.1.1", "remark-stringify": "^11.0.0", "request": "^2.88.0", - "rescript": "^11.1.0", + "rescript": "^12.0.0-alpha.9", "stringify-object": "^3.3.0", "unified": "^11.0.5", "vfile-matter": "^5.0.0" @@ -80,4 +78,4 @@ "simple-functional-loader": "^1.2.1", "tailwindcss": "^3.3.3" } -} \ No newline at end of file +} diff --git a/rescript.json b/rescript.json index 38bdaad59..fc09510b1 100644 --- a/rescript.json +++ b/rescript.json @@ -5,14 +5,7 @@ "version": 4 }, "bs-dependencies": [ - "@rescript/react", - "@rescript/tools", - "@rescript/core" - ], - "uncurried": true, - "ppx-flags": [], - "bsc-flags": [ - "-open RescriptCore" + "@rescript/react" ], "sources": [ { @@ -38,4 +31,4 @@ "shims": [], "module": "es6" } -} \ No newline at end of file +} diff --git a/scripts/gendocs.res b/scripts/gendocs.res index 33bafdabc..23d5124fa 100644 --- a/scripts/gendocs.res +++ b/scripts/gendocs.res @@ -115,7 +115,9 @@ let docs = docsDecoded->Array.map(doc => { let rec getModules = (lst: list<Docgen.item>, moduleNames: list<module_>) => switch lst { | list{ - Module({id, items, name, docstrings}) | ModuleAlias({id, items, name, docstrings}), + Module({id, items, name, docstrings}) + | ModuleAlias({id, items, name, docstrings}) + | ModuleType({id, items, name, docstrings}), ...rest, } => if Array.includes(hiddenModules, id) { @@ -255,7 +257,10 @@ let () = { } let rec getModules = (lst: list<Docgen.item>, moduleNames, path) => { switch lst { - | list{Module({id, items, name}) | ModuleAlias({id, items, name}), ...rest} => + | list{ + Module({id, items, name}) | ModuleAlias({id, items, name}) | ModuleType({id, items, name}), + ...rest, + } => if Array.includes(hiddenModules, id) { getModules(rest, moduleNames, path) } else { diff --git a/src/ApiDocs.res b/src/ApiDocs.res index d7ad0cd4b..c3be8314b 100644 --- a/src/ApiDocs.res +++ b/src/ApiDocs.res @@ -307,7 +307,7 @@ let default = (props: props) => { let valuesAndType = items->Array.map(item => { switch item { | Value({name, signature, docstrings, deprecated}) => - let code = String.replaceRegExp(signature, %re("/\\n/g"), "\n") + let code = String.replaceRegExp(signature, /\\n/g, "\n") let slugPrefix = "value-" ++ name <> <H2 id=slugPrefix> {name->React.string} </H2> @@ -316,7 +316,7 @@ let default = (props: props) => { <DocstringsStylize docstrings slugPrefix /> </> | Type({name, signature, docstrings, deprecated}) => - let code = String.replaceRegExp(signature, %re("/\\n/g"), "\n") + let code = String.replaceRegExp(signature, /\\n/g, "\n") let slugPrefix = "type-" ++ name <> <H2 id=slugPrefix> {name->React.string} </H2> @@ -474,6 +474,7 @@ let processStaticProps = (~slug: array<string>, ~version: string) => { }) Variant({items: items})->Null.make + | Signature(_) => Null.null } | None => Null.null } diff --git a/src/Blog.res b/src/Blog.res index a0cc2d25b..262d684ef 100644 --- a/src/Blog.res +++ b/src/Blog.res @@ -95,8 +95,8 @@ module BlogCard = { { let className = "absolute top-0 h-full w-full object-cover" switch previewImg { - | Some(src) => <img className src loading={#"lazy"} /> - | None => <img className src=defaultPreviewImg loading={#"lazy"} /> + | Some(src) => <img className src loading={#lazy} /> + | None => <img className src=defaultPreviewImg loading={#lazy} /> } } </Link> diff --git a/src/CommunityContent.res b/src/CommunityContent.res index 846ae9905..92598e92c 100644 --- a/src/CommunityContent.res +++ b/src/CommunityContent.res @@ -20,7 +20,7 @@ module LinkCard = { let make = (~link, ~index) => { let loading = switch index { | 0 => #eager - | _ => #"lazy" + | _ => #lazy } <div className="rounded-lg hover:text-fire overflow-hidden bg-gray-10 border-2 border-gray-30"> <a href=link.url className="flex flex-col h-full"> diff --git a/src/ConsolePanel.res b/src/ConsolePanel.res index 03861c714..b7bba9587 100644 --- a/src/ConsolePanel.res +++ b/src/ConsolePanel.res @@ -34,7 +34,7 @@ let make = (~logs, ~appendLog) => { ->Array.mapWithIndex(({level: logLevel, content: log}, i) => { let log = Array.join(log, " ") <pre - key={RescriptCore.Int.toString(i)} + key={Int.toString(i)} className={switch logLevel { | #log => "" | #warn => "text-orange" diff --git a/src/SyntaxLookup.res b/src/SyntaxLookup.res index 7e916c775..f98e9f76d 100644 --- a/src/SyntaxLookup.res +++ b/src/SyntaxLookup.res @@ -151,14 +151,14 @@ type params = {slug: string} let decode = (json: JSON.t) => { open Json.Decode - let id = json->(field("id", string, _)) - let keywords = json->(field("keywords", array(string, ...), _)) - let name = json->(field("name", string, _)) - let summary = json->(field("summary", string, _)) - let category = json->field("category", string, _)->Category.fromString + let id = json->field("id", string, _) + let keywords = json->field("keywords", array(string, ...), _) + let name = json->field("name", string, _) + let summary = json->field("summary", string, _) + let category = json->(field("category", string, _))->Category.fromString let status = json - ->optional(field("status", string, _), _) + ->(optional(field("status", string, _), _)) ->Option.mapOr(Status.Active, Status.fromString) { diff --git a/src/Try.res b/src/Try.res index 1f9d25940..bd776e438 100644 --- a/src/Try.res +++ b/src/Try.res @@ -37,11 +37,9 @@ let getStaticProps: Next.GetStaticProps.t<props, _> = async _ => { switch line->String.startsWith("<a href") { | true => // Adapted from https://semver.org/ - let semverRe = %re( - "/v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/" - ) - switch Re.exec(semverRe, line) { - | Some(result) => Re.Result.fullMatch(result)->Some + let semverRe = /v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/ + switch RegExp.exec(semverRe, line) { + | Some(result) => RegExp.Result.fullMatch(result)->Some | None => None } | false => None diff --git a/src/bindings/RescriptCompilerApi.res b/src/bindings/RescriptCompilerApi.res index 5d953825f..af966350d 100644 --- a/src/bindings/RescriptCompilerApi.res +++ b/src/bindings/RescriptCompilerApi.res @@ -97,12 +97,12 @@ module LocMsg = { let decode = (json): t => { open Json.Decode { - fullMsg: json->(field("fullMsg", string, _)), - shortMsg: json->(field("shortMsg", string, _)), - row: json->(field("row", int, _)), - column: json->(field("column", int, _)), - endRow: json->(field("endRow", int, _)), - endColumn: json->(field("endColumn", int, _)), + fullMsg: json->field("fullMsg", string, _), + shortMsg: json->field("shortMsg", string, _), + row: json->field("row", int, _), + column: json->field("column", int, _), + endRow: json->field("endRow", int, _), + endColumn: json->field("endColumn", int, _), } } diff --git a/src/common/Ansi.res b/src/common/Ansi.res index 99277341b..d2bb88ea3 100644 --- a/src/common/Ansi.res +++ b/src/common/Ansi.res @@ -54,7 +54,7 @@ module Sgr = { let esc = `\u001B` -let isAscii = (c: string) => Re.test(%re(`/[\x40-\x7F]/`), c) +let isAscii = (c: string) => RegExp.test(/[\x40-\x7F]/, c) module Location = { type t = { @@ -177,9 +177,9 @@ module Lexer = { let loc = {startPos, endPos: startPos + String.length(raw) - 1} - let token = switch Re.exec(%re(`/\[([0-9;]+)([\x40-\x7F])/`), raw) { + let token = switch RegExp.exec(/\[([0-9;]+)([\x40-\x7F])/, raw) { | Some(result) => - let groups = Re.Result.matches(result) + let groups = RegExp.Result.matches(result) switch groups[1] { | Some(str) => switch String.split(str, ";") { @@ -318,7 +318,7 @@ module SgrString = { let toString = (e: t): string => { let content = { open String - replaceRegExp(e.content, %re("/\n/g"), "\\n")->replace(esc, "") + replaceRegExp(e.content, /\n/g, "\\n")->replace(esc, "") } let params = Array.map(e.params, Sgr.paramToString)->Array.join(", ") @@ -334,7 +334,7 @@ module Printer = { | Text({content, loc: {startPos, endPos}}) => let content = { open String - replaceRegExp(content, %re("/\n/g"), "\\n")->replace(esc, "") + replaceRegExp(content, /\n/g, "\\n")->replace(esc, "") } `Text "${content}" (${startPos->Int.toString} to ${endPos->Int.toString})` | Sgr({params, raw, loc: {startPos, endPos}}) => diff --git a/src/common/BlogApi.res b/src/common/BlogApi.res index 4b24c55ab..4f770a568 100644 --- a/src/common/BlogApi.res +++ b/src/common/BlogApi.res @@ -30,7 +30,7 @@ type post = { } let blogPathToSlug = path => { - path->String.replaceRegExp(%re(`/^(archive\/)?\d\d\d\d-\d\d-\d\d-(.+)\.mdx$/`), "$2") + path->String.replaceRegExp(/^(archive\/)?\d\d\d\d-\d\d-\d\d-(.+)\.mdx$/, "$2") } let mdxFiles = dir => { diff --git a/src/common/BlogFrontmatter.res b/src/common/BlogFrontmatter.res index 3f1329c97..811f1a937 100644 --- a/src/common/BlogFrontmatter.res +++ b/src/common/BlogFrontmatter.res @@ -134,16 +134,16 @@ let authorDecoder = (~fieldName: string, ~authors) => { let decode = (json: JSON.t): result<t, string> => { open Json.Decode switch { - author: json->field("author", string, _)->decodeAuthor(~fieldName="author", ~authors), + author: json->(field("author", string, _))->decodeAuthor(~fieldName="author", ~authors), co_authors: json - ->optional(field("co-authors", authorDecoder(~fieldName="co-authors", ~authors), ...), _) + ->(optional(field("co-authors", authorDecoder(~fieldName="co-authors", ~authors), ...), _)) ->Option.getOr([]), - date: json->field("date", string, _)->DateStr.fromString, - badge: json->optional(j => field("badge", string, j)->decodeBadge, _)->Null.fromOption, - previewImg: json->optional(field("previewImg", string, ...), _)->Null.fromOption, - articleImg: json->optional(field("articleImg", string, ...), _)->Null.fromOption, - title: json->(field("title", string, _)), - description: json->(nullable(field("description", string, ...), _)), + date: json->(field("date", string, _))->DateStr.fromString, + badge: json->(optional(j => field("badge", string, j)->decodeBadge, _))->Null.fromOption, + previewImg: json->(optional(field("previewImg", string, ...), _))->Null.fromOption, + articleImg: json->(optional(field("articleImg", string, ...), _))->Null.fromOption, + title: json->field("title", string, _), + description: json->nullable(field("description", string, ...), _), } { | fm => Ok(fm) | exception DecodeError(str) => Error(str) diff --git a/src/common/DateStr.res b/src/common/DateStr.res index 5fc0207a6..a4d50d0fd 100644 --- a/src/common/DateStr.res +++ b/src/common/DateStr.res @@ -1,8 +1,7 @@ type t = string // Used to prevent issues with webkit based date representations -let parse = (dateStr: string): Date.t => - dateStr->String.replaceRegExp(%re("/-/g"), "/")->Date.fromString +let parse = (dateStr: string): Date.t => dateStr->String.replaceRegExp(/-/g, "/")->Date.fromString let fromDate = date => Date.toString(date) let toDate = dateStr => parse(dateStr) diff --git a/src/common/Semver.res b/src/common/Semver.res index 5c41c873e..c0a6420f5 100644 --- a/src/common/Semver.res +++ b/src/common/Semver.res @@ -30,7 +30,7 @@ let parse = (versionStr: string) => { } // Some version contain a suffix. Example: v11.0.0-alpha.5, v11.0.0-beta.1 - let isPrerelease = versionStr->String.search(%re("/-/")) != -1 + let isPrerelease = versionStr->String.search(/-/) != -1 // Get the first part i.e vX.Y.Z let versionNumber = versionStr->String.split("-")->Array.get(0)->Option.getOr(versionStr) diff --git a/src/common/Url.res b/src/common/Url.res index d152d78ef..4c28634f3 100644 --- a/src/common/Url.res +++ b/src/common/Url.res @@ -58,7 +58,7 @@ let prettyString = (str: string) => { let parse = (route: string): t => { let fullpath = route->String.split("/")->Array.filter(s => s !== "") let foundVersionIndex = Array.findIndex(fullpath, chunk => { - Re.test(%re(`/latest|next|v\d+(\.\d+)?(\.\d+)?/`), chunk) + RegExp.test(/latest|next|v\d+(\.\d+)?(\.\d+)?/, chunk) }) let (version, base, pagepath) = if foundVersionIndex == -1 { diff --git a/src/components/Button.res b/src/components/Button.res index 6f034a1a1..317cc6059 100644 --- a/src/components/Button.res +++ b/src/components/Button.res @@ -7,7 +7,7 @@ let make = ( ~kind: kind=PrimaryRed, ~size: size=Large, ~children, - ~onClick: option<JsxEventU.Mouse.t => unit>=?, + ~onClick: option<JsxEvent.Mouse.t => unit>=?, ) => { let bgColor = switch kind { | PrimaryRed => "bg-fire hover:bg-fire-70 text-white" diff --git a/src/components/Button.resi b/src/components/Button.resi index 0b75d7bfa..d7926657d 100644 --- a/src/components/Button.resi +++ b/src/components/Button.resi @@ -6,5 +6,5 @@ let make: ( ~kind: kind=?, ~size: size=?, ~children: React.element, - ~onClick: JsxEventU.Mouse.t => unit=?, + ~onClick: JsxEvent.Mouse.t => unit=?, ) => React.element diff --git a/src/components/CodeMirror.res b/src/components/CodeMirror.res index b0a327432..9cfc3221f 100644 --- a/src/components/CodeMirror.res +++ b/src/components/CodeMirror.res @@ -66,46 +66,24 @@ module CM = { } @module("codemirror") - external onMouseOver: ( - Dom.element, - @as("mouseover") _, - @uncurry ReactEvent.Mouse.t => unit, - ) => unit = "on" + external onMouseOver: (Dom.element, @as("mouseover") _, ReactEvent.Mouse.t => unit) => unit = "on" @module("codemirror") - external onMouseMove: ( - Dom.element, - @as("mousemove") _, - @uncurry ReactEvent.Mouse.t => unit, - ) => unit = "on" + external onMouseMove: (Dom.element, @as("mousemove") _, ReactEvent.Mouse.t => unit) => unit = "on" @module("codemirror") - external offMouseOver: ( - Dom.element, - @as("mouseover") _, - @uncurry ReactEvent.Mouse.t => unit, - ) => unit = "off" + external offMouseOver: (Dom.element, @as("mouseover") _, ReactEvent.Mouse.t => unit) => unit = + "off" @module("codemirror") - external offMouseOut: ( - Dom.element, - @as("mouseout") _, - @uncurry ReactEvent.Mouse.t => unit, - ) => unit = "off" + external offMouseOut: (Dom.element, @as("mouseout") _, ReactEvent.Mouse.t => unit) => unit = "off" @module("codemirror") - external offMouseMove: ( - Dom.element, - @as("mousemove") _, - @uncurry ReactEvent.Mouse.t => unit, - ) => unit = "off" + external offMouseMove: (Dom.element, @as("mousemove") _, ReactEvent.Mouse.t => unit) => unit = + "off" @module("codemirror") - external onMouseOut: ( - Dom.element, - @as("mouseout") _, - @uncurry ReactEvent.Mouse.t => unit, - ) => unit = "on" + external onMouseOut: (Dom.element, @as("mouseout") _, ReactEvent.Mouse.t => unit) => unit = "on" @module("codemirror") external fromTextArea: (Dom.element, Options.t) => t = "fromTextArea" @@ -122,7 +100,7 @@ module CM = { @send external refresh: t => unit = "refresh" @send - external onChange: (t, @as("change") _, @uncurry t => unit) => unit = "on" + external onChange: (t, @as("change") _, t => unit) => unit = "on" @send external toTextArea: t => unit = "toTextArea" @@ -131,7 +109,7 @@ module CM = { @send external getValue: t => string = "getValue" @send - external operation: (t, @uncurry unit => unit) => unit = "operation" + external operation: (t, unit => unit) => unit = "operation" @send external setGutterMarker: (t, int, string, Dom.element) => unit = "setGutterMarker" @@ -485,7 +463,7 @@ let extractRowColFromId = (id: string): option<(int, int)> => | _ => None } -module ErrorHash = Belt.Id.MakeHashableU({ +module ErrorHash = Belt.Id.MakeHashable({ type t = int let hash = a => a let eq = (a, b) => a == b @@ -536,7 +514,7 @@ let updateErrors = (~state: state, ~onMarkerFocus=?, ~onMarkerFocusLeave=?, ~cm: (), ), ) - ->Array.push(state.marked, _) + ->(Array.push(state.marked, _)) ->ignore () } diff --git a/src/components/Markdown.res b/src/components/Markdown.res index 649de3edc..c519c5998 100644 --- a/src/components/Markdown.res +++ b/src/components/Markdown.res @@ -234,7 +234,7 @@ module Code = { String.split(metastring, " ") ->Array.find(s => String.startsWith(s, "{") && String.endsWith(s, "}")) ->Option.map(str => { - let nums = String.replaceRegExp(str, %re("/[\{\}]/g"), "")->parseNumericRange + let nums = String.replaceRegExp(str, /[\{\}]/g, "")->parseNumericRange nums }) ->Option.getOr([]) @@ -248,9 +248,9 @@ module Code = { let highlightedLines = parseNumericRangeMeta(metastring) - if List.has(metaSplits, "example", \"=") { + if List.has(metaSplits, "example", String.equal) { <CodeExample code lang /> - } else if List.has(metaSplits, "sig", \"=") { + } else if List.has(metaSplits, "sig", String.equal) { <CodeExample code lang showLabel=false /> } else { <CodeExample highlightedLines code lang /> @@ -374,7 +374,7 @@ module A = { // Ideally one would check if this link is relative first, // but it's very unlikely we'd refer to an absolute URL ending // with .md - let regex = %re("/\.md(x)?|\.html$/") + let regex = /\.md(x)?|\.html$/ let href = switch String.split(href, "#") { | [pathname, anchor] => String.replaceRegExp(pathname, regex, "") ++ ("#" ++ anchor) | [pathname] => String.replaceRegExp(pathname, regex, "") diff --git a/src/vendor/Json_decode.res b/src/vendor/Json_decode.res index ec71e6107..c8903c761 100644 --- a/src/vendor/Json_decode.res +++ b/src/vendor/Json_decode.res @@ -41,7 +41,7 @@ let string = json => let char = json => { let s = string(json) if String.length(s) == 1 { - OCamlCompat.String.get(s, 0) + String.getUnsafe(s, 0)->Obj.magic } else { \"@@"(raise, DecodeError("Expected single-character string, got " ++ JSON.stringify(json))) } diff --git a/src/vendor/Json_encode.res b/src/vendor/Json_encode.res index f66096108..fc5118343 100644 --- a/src/vendor/Json_encode.res +++ b/src/vendor/Json_encode.res @@ -6,7 +6,7 @@ external float: float => JSON.t = "%identity" external int: int => JSON.t = "%identity" external bool: bool => JSON.t = "%identity" -let char = c => string(OCamlCompat.String.make(1, c)) +let char = c => string(String.make(c)) let date = d => string(Date.toJSON(d)->Option.getUnsafe)