{React.string(prefixText)}
- {React.string(j` Line $row, column $column:`)}
+ {React.string(` Line ${row->Belt.Int.toString}, column ${column->Belt.Int.toString}:`)}
shortMsg
@@ -247,7 +247,7 @@ module ResultPane = {
"Formatting completed with 0 errors"
} else {
let toStr = Api.Lang.toString(toLang)
- j`Switched to $toStr with 0 errors`
+ `Switched to ${toStr} with 0 errors`
}
{React.string(msg)}
| Conv(Fail({fromLang, toLang, details})) =>
@@ -268,11 +268,11 @@ module ResultPane = {
// We keep both cases though in case we change things later
let msg = if fromLang === toLang {
let langStr = Api.Lang.toString(toLang)
- j`The code is not valid $langStr syntax.`
+ `The code is not valid ${langStr} syntax.`
} else {
let fromStr = Api.Lang.toString(fromLang)
let toStr = Api.Lang.toString(toLang)
- j`Could not convert from "$fromStr" to "$toStr" due to malformed syntax:`
+ `Could not convert from "${fromStr}" to "${toStr}" due to malformed syntax:`
}
{React.string(msg)}
@@ -310,7 +310,9 @@ module ResultPane = {
| Nothing =>
let syntax = Api.Lang.toString(targetLang)
- {React.string(j`This playground is now running on compiler version $compilerVersion with $syntax syntax`)}
+ {React.string(
+ `This playground is now running on compiler version ${compilerVersion} with ${syntax} syntax`,
+ )}
}
@@ -1053,7 +1055,7 @@ module ControlPanel = {
}
module ShareButton = {
- let copyToClipboard: string => bool = %raw(j`
+ let copyToClipboard: string => bool = %raw(`
function(str) {
try {
const el = document.createElement('textarea');
@@ -1406,7 +1408,7 @@ module App = {
// Feel free to play around and compile some
// ReScript code!
-let initialReContent = j`Js.log("Hello Reason 3.6!");`
+let initialReContent = `Js.log("Hello Reason 3.6!");`
let default = (~props: Try.props) => {
let router = Next.Router.useRouter()
diff --git a/src/Try.res b/src/Try.res
index 704acd270..e22200db3 100644
--- a/src/Try.res
+++ b/src/Try.res
@@ -6,7 +6,7 @@ let default = (props: {"children": React.element}) => {
<>
-
+
diff --git a/src/bindings/RescriptCompilerApi.res b/src/bindings/RescriptCompilerApi.res
index 854fd3f57..faf569599 100644
--- a/src/bindings/RescriptCompilerApi.res
+++ b/src/bindings/RescriptCompilerApi.res
@@ -26,7 +26,7 @@ module Lang = {
| "ml" => OCaml
| "re" => Reason
| "res" => Res
- | other => raise(DecodeError(j`Unknown language "$other"`))
+ | other => raise(DecodeError(`Unknown language "${other}"`))
}
}
}
@@ -110,7 +110,7 @@ module LocMsg = {
| #E => "E"
}
- j`[1;31m[$prefix] Line $row, $column:[0m $shortMsg`
+ `[1;31m[${prefix}] Line ${row->Belt.Int.toString}, ${column->Belt.Int.toString}:[0m ${shortMsg}`
}
// Creates a somewhat unique id based on the rows / cols of the locMsg
@@ -160,11 +160,11 @@ module Warning = {
| Warn({warnNumber, details})
| WarnErr({warnNumber, details}) =>
let {LocMsg.row: row, column, shortMsg} = details
- let msg = j`(Warning number $warnNumber) $shortMsg`
+ let msg = `(Warning number ${warnNumber->Belt.Int.toString}) ${shortMsg}`
(row, column, msg)
}
- j`[1;31m[$prefix] Line $row, $column:[0m $msg`
+ `[1;31m[${prefix}] Line ${row->Belt.Int.toString}, ${column->Belt.Int.toString}:[0m ${msg}`
}
}
@@ -295,7 +295,7 @@ module CompileFail = {
| "warning_flag_error" =>
let warningFlag = WarningFlag.decode(json)
WarningFlagErr(warningFlag)
- | other => raise(DecodeError(j`Unknown type "$other" in CompileFail result`))
+ | other => raise(DecodeError(`Unknown type "${other}" in CompileFail result`))
}
}
}
@@ -336,7 +336,7 @@ module ConversionResult = {
| "syntax_error" =>
let locMsgs = field("errors", array(LocMsg.decode), json)
Fail({fromLang, toLang, details: locMsgs})
- | other => Unknown(j`Unknown conversion result type "$other"`, json)
+ | other => Unknown(`Unknown conversion result type "${other}"`, json)
} catch {
| DecodeError(errMsg) => Unknown(errMsg, json)
}
diff --git a/src/common/Ansi.res b/src/common/Ansi.res
index 9492f9d90..1a1e667c7 100644
--- a/src/common/Ansi.res
+++ b/src/common/Ansi.res
@@ -52,7 +52,7 @@ module Sgr = {
}
}
-let esc = j`\u001B`
+let esc = `\u001B`
let isAscii = (c: string) => Js.Re.test_(%re(`/[\x40-\x7F]/`), c)
@@ -324,7 +324,7 @@ module SgrString = {
}
let params = Belt.Array.map(e.params, Sgr.paramToString)->Js.Array2.joinWith(", ")
- j`SgrString params: $params | content: $content`
+ `SgrString params: ${params} | content: ${content}`
}
}
@@ -338,14 +338,14 @@ module Printer = {
open Js.String2
replaceByRe(content, %re("/\n/g"), "\\n")->replace(esc, "")
}
- j`Text "$content" ($startPos to $endPos)`
+ `Text "${content}" (${startPos->Belt.Int.toString} to ${endPos->Belt.Int.toString})`
| Sgr({params, raw, loc: {startPos, endPos}}) =>
let raw = Js.String2.replace(raw, esc, "")
let params = Belt.Array.map(params, Sgr.paramToString)->Js.Array2.joinWith(", ")
- j`Sgr "$raw" -> $params ($startPos to $endPos)`
+ `Sgr "${raw}" -> ${params} (${startPos->Belt.Int.toString} to ${endPos->Belt.Int.toString})`
| ClearSgr({loc: {startPos, endPos}, raw}) =>
let raw = Js.String2.replace(raw, esc, "")
- j`Clear Sgr "$raw" ($startPos to $endPos)`
+ `Clear Sgr "${raw}" (${startPos->Belt.Int.toString} to ${endPos->Belt.Int.toString})`
}
let plainString = (tokens: array): string =>
diff --git a/src/common/BlogApi.res b/src/common/BlogApi.res
index 3595d0a21..877dfa777 100644
--- a/src/common/BlogApi.res
+++ b/src/common/BlogApi.res
@@ -134,7 +134,7 @@ module RssFeed = {
Belt.Array.get(items, 0)
->Belt.Option.map(item => {
let latestPubDateStr = item.pubDate->dateToUTCString
- j`$latestPubDateStr`
+ `${latestPubDateStr}`
})
->Belt.Option.getWithDefault("")
@@ -143,33 +143,34 @@ module RssFeed = {
->Js.Array2.map(({title, pubDate, description, href}) => {
let descriptionElement = switch description {
| "" => ""
- | desc => j`
-
+ | desc =>
+ `
+
`
}
// TODO: convert pubdate to string
let dateStr = pubDate->dateToUTCString
- j`
+ `
-
- $href
- $href
- $descriptionElement
- $dateStr
+
+ ${href}
+ ${href}
+ ${descriptionElement}
+ ${dateStr}`
})
->Js.Array2.joinWith("\n")
- let ret = j`
+ let ret = `
- $siteTitle
+ ${siteTitle}
https://rescript-lang.org
- $siteDescription
+ ${siteDescription}en
- $latestPubDateElement
-$itemsStr
+ ${latestPubDateElement}
+${itemsStr}
` //rescript-lang.org
diff --git a/src/common/BlogFrontmatter.res b/src/common/BlogFrontmatter.res
index 75f27c5b7..234ba450a 100644
--- a/src/common/BlogFrontmatter.res
+++ b/src/common/BlogFrontmatter.res
@@ -98,7 +98,7 @@ let decodeBadge = (str: string): Badge.t =>
| "testing" => Testing
| "preview" => Preview
| "roadmap" => Roadmap
- | str => raise(Json.Decode.DecodeError(j`Unknown category "$str"`))
+ | str => raise(Json.Decode.DecodeError(`Unknown category "${str}"`))
}
exception AuthorNotFound(string)
@@ -106,7 +106,7 @@ exception AuthorNotFound(string)
let decodeAuthor = (~fieldName: string, ~authors, username) =>
switch Js.Array2.find(authors, a => a.username === username) {
| Some(author) => author
- | None => raise(AuthorNotFound(j`Couldn't find author "$username" in field $fieldName`))
+ | None => raise(AuthorNotFound(`Couldn't find author "${username}" in field ${fieldName}`))
}
let authorDecoder = (~fieldName: string, ~authors, json) => {
diff --git a/src/common/CompilerManagerHook.res b/src/common/CompilerManagerHook.res
index 4f753c5b3..65e745f06 100644
--- a/src/common/CompilerManagerHook.res
+++ b/src/common/CompilerManagerHook.res
@@ -28,7 +28,7 @@ module LoadScript = {
loadScript(
~src=url,
~onSuccess=() => resolve(. Ok()),
- ~onError=_err => resolve(. Error(j`Could not load script: $url`)),
+ ~onError=_err => resolve(. Error(`Could not load script: ${url}`)),
)->ignore
})
}
diff --git a/src/common/Hooks.res b/src/common/Hooks.res
index f7a026ea5..7df6c7872 100644
--- a/src/common/Hooks.res
+++ b/src/common/Hooks.res
@@ -1,7 +1,7 @@
/* Contains some generic hooks */
%%raw("import React from 'react'")
-let useOutsideClick: (ReactDOM.Ref.t, unit => unit) => unit = %raw(j`(outerRef, trigger) => {
+let useOutsideClick: (ReactDOM.Ref.t, unit => unit) => unit = %raw(`(outerRef, trigger) => {
function handleClickOutside(event) {
if (outerRef.current && !outerRef.current.contains(event.target)) {
trigger();
@@ -16,7 +16,7 @@ let useOutsideClick: (ReactDOM.Ref.t, unit => unit) => unit = %raw(j`(outerRef,
});
}`)
-let useWindowWidth: unit => option = %raw(j` () => {
+let useWindowWidth: unit => option = %raw(` () => {
const isClient = typeof window === 'object';
function getSize() {
diff --git a/src/components/CodeExample.res b/src/components/CodeExample.res
index 68ef4a729..f3c5831c1 100644
--- a/src/components/CodeExample.res
+++ b/src/components/CodeExample.res
@@ -29,7 +29,7 @@ module DomUtil = {
}
module CopyButton = {
- let copyToClipboard: string => bool = %raw(j`
+ let copyToClipboard: string => bool = %raw(`
function(str) {
try {
const el = document.createElement('textarea');
diff --git a/src/components/CodeMirror.res b/src/components/CodeMirror.res
index 3f7830e13..d3e6b91c9 100644
--- a/src/components/CodeMirror.res
+++ b/src/components/CodeMirror.res
@@ -8,7 +8,7 @@
This file is providing the core functionality and logic of our CodeMirror instances.
*/
-let useWindowWidth: unit => int = %raw(j` () => {
+let useWindowWidth: unit => int = %raw(` () => {
const isClient = typeof window === 'object';
function getSize() {
@@ -460,7 +460,7 @@ module GutterMarker = {
}
let (row, col) = rowCol
- marker->setId(j`gutter-marker_$row-$col`)
+ marker->setId(`gutter-marker_${row->Belt.Int.toString}-${col->Belt.Int.toString}`)
marker->setClassName(
"flex items-center justify-center text-14 text-center ml-1 h-6 font-bold hover:cursor-pointer " ++
colorClass,
@@ -702,7 +702,7 @@ let make = // props relevant for the react wrapper
*/
let errorsFingerprint = Belt.Array.map(errors, e => {
let {Error.row: row, column} = e
- j`$row-$column`
+ `${row->Belt.Int.toString}-${column->Belt.Int.toString}`
})->Js.Array2.joinWith(";")
React.useEffect1(() => {
diff --git a/src/layouts/LandingPageLayout.res b/src/layouts/LandingPageLayout.res
index 37b954e4e..4cd7acce7 100644
--- a/src/layouts/LandingPageLayout.res
+++ b/src/layouts/LandingPageLayout.res
@@ -131,7 +131,7 @@ exports.Button = Button;`,
module QuickInstall = {
module CopyButton = {
- let copyToClipboard: string => bool = %raw(j`
+ let copyToClipboard: string => bool = %raw(`
function(str) {
try {
const el = document.createElement('textarea');