You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: markdown-pages/blogposts/2020-08-10-bucklescript-is-rebranding.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,15 +64,15 @@ There's no dedicated name for the syntax anymore. It's simply called the ReScrip
64
64
65
65
**Will there be a migration script to gradually convert our code to the new syntax?**
66
66
67
-
Yes. See our [migration page](/docs/manual/v10.0.0/migrate-from-bucklescript-reason). You can mix and match old and new code for a smoother transition.
67
+
Yes. See our [migration page](https://v11.rescript-lang.org/docs/manual/v10.0.0/migrate-from-bucklescript-reason). You can mix and match old and new code for a smoother transition.
68
68
69
69
**Will BuckleScript (now ReScript) break my existing code?**
70
70
71
71
No. The new syntax & tools sit alongside the existing code. We **won't** remove OCaml and Reason support from ReScript for a long time.
72
72
73
73
**What's the editor tooling story?**
74
74
75
-
Much more streamlined now! See our [Editor Plugins](/docs/manual/latest/editor-plugins) page.
75
+
Much more streamlined now! See our [Editor Plugins](/docs/manual/editor-plugins) page.
76
76
77
77
Reason-language-server will continue working as-is for existing usage. We as first party don't work on ocaml's language server.
Copy file name to clipboardExpand all lines: markdown-pages/blogposts/2020-12-07-release-8-4.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ dependent's command line flags for building binary artifacts. Such strategy bene
55
55
56
56
To make `bsb -make-world` more practical for e.g. multi-package setups (`lerna`, `yarn workspaces`, etc.), we introduced a new concept called `pinned-dependencies`. A pinned dependency allows you to automatically rebuild packages that are pinned by a toplevel package, like your final webapp.
57
57
58
-
Please refer to our [pinned dependencies](/docs/manual/latest/build-pinned-dependencies) docs for more details.
58
+
Please refer to our [pinned dependencies](/docs/manual/build-pinned-dependencies) docs for more details.
59
59
60
60
### More robust handling of removal of staled output
Copy file name to clipboardExpand all lines: markdown-pages/blogposts/2021-02-09-release-9-0.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Our compiler comes with a set of stdlib modules (such as `Belt`, `Pervasives`, e
34
34
35
35
In previous versions, users couldn't ship their compiled JS code without defining a `package.json` dependency on `bs-platform`. Whenever a ReScript developer wanted to publish a package just for pure JS consumption / lean container deployment, they were required to use a bundler to bundle up their library / stdlib code, which made things way more complex and harder to understand.
36
36
37
-
To fix this problem, we introduced an `external-stdlib` configuration that allows specifying a pre-compiled stdlib npm package (`@rescript/std`). More details on how to use that feature can be found in our [External Stdlib](/docs/manual/latest/build-external-stdlib) documentation.
37
+
To fix this problem, we introduced an `external-stdlib` configuration that allows specifying a pre-compiled stdlib npm package (`@rescript/std`). More details on how to use that feature can be found in our [External Stdlib](/docs/manual/build-external-stdlib) documentation.
38
38
39
39
### Less Bundle Bloat when Adding ReScript
40
40
@@ -109,7 +109,7 @@ function is_space(param){
109
109
110
110
### `when` -> `if`
111
111
112
-
Starting from 9.0, [`when` clauses](/docs/manual/latest/pattern-matching-destructuring#when-clause) within a `switch` statement will automatically convert to the `if` keyword instead.
112
+
Starting from 9.0, [`when` clauses](/docs/manual/pattern-matching-destructuring#when-clause) within a `switch` statement will automatically convert to the `if` keyword instead.
Copy file name to clipboardExpand all lines: markdown-pages/blogposts/2023-04-17-improving-interop.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -225,7 +225,7 @@ We can now utilize pattern matching fully without needing to do any conversion.
225
225
This has a few implications:
226
226
227
227
- Dealing with external data, that is often nullable and seldom guaranteed to map cleanly to `option` without needing conversion, becomes much easier and zero cost.
228
-
- Special handling like [@return(nullable)](https://rescript-lang.org/syntax-lookup#return-decorator) becomes redundant. This is good also because the current functionality does not work in all cases. The new functionality will work anywhere.
228
+
- Special handling like [@return(nullable)](https://rescript-lang.org/syntax-lookup/return-decorator) becomes redundant. This is good also because the current functionality does not work in all cases. The new functionality will work anywhere.
Copy file name to clipboardExpand all lines: markdown-pages/blogposts/2023-05-17-enhanced-ergonomics-for-record-types.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,14 @@ description: |
9
9
10
10
> This is the second post covering new capabilities that'll ship in ReScript v11. You can check out the first post on [better interop with customizable variants here](https://rescript-lang.org/blog/improving-interop).
11
11
12
-
[Records](https://rescript-lang.org/docs/manual/latest/record) are a fundamental part of ReScript, offering a clear and concise definition of complex data structures, immutability by default, great error messages, and support for exhaustive pattern matching.
12
+
[Records](https://rescript-lang.org/docs/manual/record) are a fundamental part of ReScript, offering a clear and concise definition of complex data structures, immutability by default, great error messages, and support for exhaustive pattern matching.
13
13
14
14
Even though records are generally preferable for defining structured data, there are still a few ergonomic annoyances, such as...
15
15
16
16
1. Existing record types can't be extended, which makes them hard to compose
17
17
2. Functions may only accept record arguments of the exact record type (no explicit sub-typing)
18
18
19
-
To mitigate the limitations above, one would need to retreat to [structural objects](https://rescript-lang.org/docs/manual/latest/object#sidebar) to allow more flexible object field sharing and sub-typing, at the cost of more complex type errors and no pattern matching capabilities.
19
+
To mitigate the limitations above, one would need to retreat to [structural objects](https://rescript-lang.org/docs/manual/object#sidebar) to allow more flexible object field sharing and sub-typing, at the cost of more complex type errors and no pattern matching capabilities.
20
20
21
21
We think that records are a much more powerful data structure though, so we want to encourage more record type usage for these scenarios. This is why ReScript v11 will come with two new big enhancements for record types: **Record Type Spread** and **Record Type Coercion**.
22
22
@@ -141,7 +141,7 @@ let name = nameFromB(a :> b)
141
141
142
142
Notice how `a` now has more fields than `b`, but we can still coerce `a` to `b` because `b` has a subset of the fields of `a`.
143
143
144
-
In combination with [optional record fields](/docs/manual/latest/record#optional-record-fields), one may coerce a mandatory field of an `option` type to an optional field:
144
+
In combination with [optional record fields](/docs/manual/record#optional-record-fields), one may coerce a mandatory field of an `option` type to an optional field:
Copy file name to clipboardExpand all lines: markdown-pages/blogposts/2024-01-11-release-11-0-0.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Use your favorite package manager to install the new compiler release, e.g.:
16
16
npm install rescript@11
17
17
```
18
18
19
-
To upgrade your project or to find out if there are any breaking changes that affect you, please follow the [migration guide](/docs/manual/latest/migrate-to-v11).
19
+
To upgrade your project or to find out if there are any breaking changes that affect you, please follow the [migration guide](/docs/manual/migrate-to-v11).
20
20
21
21
The complete list of changes can be found [here](https://github.com/rescript-lang/rescript/blob/v11.0.0/CHANGELOG.md). Let's have a look at the most notable improvements.
22
22
@@ -52,15 +52,15 @@ This release is also introducing uncurried mode, which is a new default mode tha
52
52
53
53
[ReScript Core](https://github.com/rescript-lang/rescript-core) is ReScript's new standard library. It replaces the complete `Js` module as well as some of the more frequently used modules from `Belt` and is recommended to use with uncurried mode.
54
54
55
-
The latest docs on [rescript-lang.org](/) already use it for the examples. Have a look at the new [RescriptCore API docs](/docs/manual/latest/api/core).
55
+
The latest docs on [rescript-lang.org](/) already use it for the examples. Have a look at the new [RescriptCore API docs](/docs/manual/api/core).
56
56
57
57
## More Features
58
58
59
59
Furthermore, there are a lot of smaller improvements of which we want to state only a few here.
60
60
61
61
### More types eligible for type coercion
62
62
63
-
The `:>` (type coercion) operator now supports a few more datatypes, check out its [Syntax Lookup](/syntax-lookup#type-coercion) page.
63
+
The `:>` (type coercion) operator now supports a few more datatypes, check out its [Syntax Lookup](/syntax-lookup/type-coercion) page.
64
64
65
65
### Build System
66
66
@@ -90,7 +90,7 @@ It's now possible to have a module opened by default that is just part of the cu
90
90
91
91
Previously, the ReScript binary was able to initialize new projects itself. But it was required to have a global npm install to use it. This functionality has been removed.
92
92
93
-
Going forward, `create-rescript-app` is the new recommended way to setup a new project. It can even be used to quickly add ReScript to an existing project. Have a look at the updated [installation instructions](/docs/manual/latest/installation) for how to use it.
93
+
Going forward, `create-rescript-app` is the new recommended way to setup a new project. It can even be used to quickly add ReScript to an existing project. Have a look at the updated [installation instructions](/docs/manual/installation) for how to use it.
Copy file name to clipboardExpand all lines: markdown-pages/blogposts/2024-02-01-release-11-1-0.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,13 +42,13 @@ let make = (~name) => {
42
42
}
43
43
```
44
44
45
-
Read more in the [new documentation on the generic JSX transform](/docs/manual/latest/jsx#generic-jsx-transform-jsx-beyond-react-experimental).
45
+
Read more in the [new documentation on the generic JSX transform](/docs/manual/jsx#generic-jsx-transform-jsx-beyond-react-experimental).
46
46
47
47
## Tagged template literals
48
48
49
49
This release comes with support for [tagged templates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates).
50
50
51
-
A tag function in JavaScript is a function that expects an array of strings and variadic parameters as input. Now it's possibe to bind to such functions with the new [`@taggedTemplate`](/syntax-lookup#taggedTemplate-decorator) decorator:
51
+
A tag function in JavaScript is a function that expects an array of strings and variadic parameters as input. Now it's possibe to bind to such functions with the new [`@taggedTemplate`](/syntax-lookup/taggedTemplate-decorator) decorator:
52
52
53
53
<CodeTablabels={["ReScript", "JS Output"]}>
54
54
@@ -78,7 +78,7 @@ Of course you can also create your own tag function in ReScript now as well, it
78
78
let myTagFunction : (array<string>, array<'param>) => 'output
79
79
```
80
80
81
-
Refer to the docs to find a [detailed example](/docs/manual/latest/tagged-templates).
81
+
Refer to the docs to find a [detailed example](/docs/manual/tagged-templates).
82
82
83
83
## Import attributes
84
84
@@ -130,7 +130,7 @@ var p = 2n ** 2n;
130
130
131
131
</CodeTab>
132
132
133
-
See [bigintegerdocs](https://rescript-lang.org/docs/manual/latest/primitive-types#big-integers-experimental) for more.
133
+
See [bigintegerdocs](https://rescript-lang.org/docs/manual/primitive-types#big-integers-experimental) for more.
134
134
135
135
## Arrayspreadsyntax
136
136
@@ -204,7 +204,7 @@ var result2 = JSON.stringify(obj, undefined, 2);
204
204
205
205
## %todo and warn-error
206
206
207
-
Inspired by languages like [Elm](https://package.elm-lang.org/packages/elm/core/latest/Debug#todo) or [Gleam](https://tour.gleam.run/advanced-features/todo/), we introduced a new extension point: [`%todo`](/syntax-lookup#todo).
207
+
Inspired by languages like [Elm](https://package.elm-lang.org/packages/elm/core/latest/Debug#todo) or [Gleam](https://tour.gleam.run/advanced-features/todo/), we introduced a new extension point: [`%todo`](/syntax-lookup/todo).
208
208
209
209
It is used to tell the compiler that some code still needs to be implemented and it will crash when executed.
210
210
@@ -242,7 +242,7 @@ We also made the compiler's `-warn-error` flag accessible by the build system, s
242
242
rescript-warn-error+110
243
243
```
244
244
245
-
See ["Compile with stricter errors in CI"](/docs/manual/latest/build-overview#compile-with-stricter-errors-in-ci).
245
+
See ["Compile with stricter errors in CI"](/docs/manual/build-overview#compile-with-stricter-errors-in-ci).
Copy file name to clipboardExpand all lines: markdown-pages/blogposts/2025-03-05-what-can-i-do-with-rescript.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: |
7
7
Can I use Vite, or Next.js? Is it only for React? Can I use Node or Deno?
8
8
---
9
9
10
-
You've taken a look and ReScript and you want to try it out, but how do you get started? There's the [installation](/docs/manual/latest/installation) page in the docs,
10
+
You've taken a look and ReScript and you want to try it out, but how do you get started? There's the [installation](/docs/manual/installation) page in the docs,
11
11
which is great if you want to set up a new React app using [create-rescript-app](https://github.com/rescript-lang/create-rescript-app). There's instructions on how to add it to an existing project or set it up manually.
12
12
But that doesn't really answer the question "Can I use this with X?".
13
13
@@ -25,7 +25,7 @@ Console.log("Hello")
25
25
Just run `node index.res.js` and you'll see "Hello" logged to the console. You can import compiled ReScript into any project that could import JavaScript.
26
26
If you can use `.js` or `.mjs` files, you can use ReScript. This does mean that languages with different file formats like Vue or Svelte require you to import the compiled JavaScript instead of writing it directly in the `.vue` or `.svelte` files.
27
27
28
-
Real world projects are more than JavaScript files that you write; they use libraries and frameworks. This is where [bindings](/docs/manual/latest/external) come into play.
28
+
Real world projects are more than JavaScript files that you write; they use libraries and frameworks. This is where [bindings](/docs/manual/external) come into play.
29
29
A binding is a way to tell ReScript the types and imports from external JavaScript. You can think of bindings in the same way that you need to create a `*.d.ts` file to add types to a JavaScript library that doesn't use TypeScript.
30
30
31
31
ReScript has great integration with [React](/docs/react/latest/introduction) and those bindings are kept up to date by the core team, but that doesn't mean you don't have other options!
That's all we need to know to write bindings to use this function in ReScript.
83
-
The first thing we need to figure out is how to handle the type for what `date-fns` considers to be a `date`, which is `Date | string | number`. In ReScript things can't just be of different types like they can in JavaScript or TypeScript. There are a couple options here; you can make a function for each type such as `formatString` and `formatDate`, or you can create a [variant type](/docs/manual/latest/variant) to map to the possible input types.
84
-
Creating a function for each type is simpler, and it's most likely how you will use the library in your project. You probably have a standard type for Dates already. We'll also need a type for `FormatDateOptions` in case we want to pass options. We'll use [labeled argmuments](/docs/manual/latest/function#labeled-arguments) for our binding.
83
+
The first thing we need to figure out is how to handle the type for what `date-fns` considers to be a `date`, which is `Date | string | number`. In ReScript things can't just be of different types like they can in JavaScript or TypeScript. There are a couple options here; you can make a function for each type such as `formatString` and `formatDate`, or you can create a [variant type](/docs/manual/variant) to map to the possible input types.
84
+
Creating a function for each type is simpler, and it's most likely how you will use the library in your project. You probably have a standard type for Dates already. We'll also need a type for `FormatDateOptions` in case we want to pass options. We'll use [labeled argmuments](/docs/manual/function#labeled-arguments) for our binding.
85
85
86
86
```res
87
87
// DateFns.res - you might want to put this in a folder called "bindings" or "external"
0 commit comments