Skip to content

Commit 4735221

Browse files
Merge pull request #782 from rescript-association/release-11-blogpost
Release blogpost for v11
2 parents 92d11ee + bbfbd0f commit 4735221

File tree

6 files changed

+167
-4
lines changed

6 files changed

+167
-4
lines changed
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
---
2+
author: rescript-team
3+
date: "2024-01-11"
4+
previewImg: /static/blog/compiler_release_11_0.jpg
5+
title: ReScript 11.0
6+
badge: release
7+
description: |
8+
The ReScript developer experience now goes up to eleven!
9+
---
10+
11+
Almost a year after the last release, ReScript is available in version 11! It marks the second major community-driven release and we are very thankful that there are so many willing contributors who invested their spare time into improving the compiler and its ecosystem.
12+
13+
Use your favorite package manager to install the new compiler release, e.g:
14+
15+
```sh
16+
npm install rescript@11
17+
```
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).
20+
21+
The complete list of changes can be found [here](https://github.com/rescript-lang/rescript-compiler/blob/v11.0.0/CHANGELOG.md). Let's have a look at the most notable improvements.
22+
23+
## Highlights
24+
25+
**Note**: As this release is packed, please refer to the linked blogposts for a detailed breakdown of each of the main new features.
26+
27+
### Customizable Variants
28+
29+
We are introducing new features that will improve interop with JavaScript/TypeScript, including customizable runtime representation of variants, zero cost bindings to discriminated unions, and unboxed variants that can be used to map to things like heterogenous array items and nullable values.
30+
31+
- Blogpost: [Better interop with customizable variants](/blog/improving-interop)
32+
33+
### Enhanced Ergonomics for Record Types
34+
35+
New enhancements for record types: Record Type Spread and Record Type Coercion. Record Type Spread allows one to share subsets of record fields with other record types, making it easier to work with types with lots of fields. And Record Type Coercion makes it easier to safely to convert between records with the same set of fields (or a subset).
36+
37+
- Blogpost: [Enhanced Ergonomics for Record Types](/blog/enhanced-ergonomics-for-record-types)
38+
39+
### First-class Dynamic Import Support
40+
41+
Another addition is first-class support for dynamic imports, which will allow developers to split up and load parts of the app code on demand as separate JS modules to prevent bundle bloat and reduce initial load times for applications.
42+
43+
- Blogpost: [First-class Dynamic Import Support](/blog/first-class-dynamic-import-support)
44+
45+
### Uncurried Mode
46+
47+
This release is also introducing uncurried mode, which is a new default mode that compiles all dependencies as uncurried, and it aims to make it easier for newcomers to use the language.
48+
49+
- Blogpost: [Uncurried Mode](/blog/uncurried-mode)
50+
51+
### New Standard Library: ReScript Core
52+
53+
[ReScript Core](https://github.com/rescript-association/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+
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).
56+
57+
## More Features
58+
59+
Furthermore, there are a lot of smaller improvements of which we want to state only a few here.
60+
61+
### More types eligible for type coercion
62+
63+
The `:>` (type coercion) operator now supports a few more datatypes, check out its [Syntax Lookup](/syntax-lookup#type-coercion) page.
64+
65+
### Build System
66+
67+
The watcher can now be called with just `rescript -w`. Also `rescript build` will always build with dependencies by default so the argument `-with-deps` is not needed anymore.
68+
69+
### rescript.json
70+
71+
The compiler config file has been renamed to `rescript.json`. Since the rebrand from `BuckleScript` to `ReScript`, the `bs-` names make no sense anymore. Later on, we will also rename some of the config attributes, like `bs-dependencies`.
72+
73+
### Relaxed Suffix Rules
74+
75+
You can now freely choose the suffix of the generated JS files. We recommend `.res.js`/`.res.mjs` which is also what our official templates in [`create-rescript-app`](#create-rescript-app) are using.
76+
77+
### Opening files from current project globally
78+
79+
It's now possible to have a module opened by default that is just part of the current project. Previously, this only worked with dependencies or namespaced projects. For example, a file with the path `src/Utils.res` can be added to `bsc-flags` like so:
80+
81+
```json
82+
{
83+
"bsc-flags": ["-open Utils"]
84+
}
85+
```
86+
87+
## Ecosystem
88+
89+
### Create-ReScript-App
90+
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+
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.
94+
95+
### ReScript-React v0.12
96+
97+
In tandem with the new ReScript release, a new version of ReScript-React is released as well. It brings support for dynamically loading React components via `React.lazy`, and more. Check out the [corresponding docs](/docs/react/latest/installation).
98+
99+
### ReScript Tools / Documentation Extraction
100+
101+
There is a new experimental tool available that is a building block for documentation generation from ReScript files. It can be installed and used as follows:
102+
103+
```sh
104+
npm install --save-dev @rescript/tools
105+
npx rescript-tools doc src/MyFile.res > doc.json
106+
```
107+
108+
The tool generates a JSON structure with all the information you need to generate documentation automatically for your ReScript code. It also comes with ReScript bindings for that JSON. Shortly we'll also have automatic markdown generation, and we're planning a static site generator as well, so getting a nice looking and useful documentation site for your ReScript code is just a command away.
109+
110+
### LSP
111+
112+
Our LSP powers our editor tooling. Historically, it has lived within the VSCode extension. This has been a problem for people who do not use VSCode. So, we've made sure that each new LSP version is [published standalone to NPM](https://www.npmjs.com/package/@rescript/language-server).
113+
114+
This makes using an up-to-date version of the LSP in other editors than VSCode much easier. You can install and use it like so:
115+
116+
```sh
117+
npm install -g @rescript/language-server
118+
npx rescript-language-server --stdio
119+
```
120+
121+
## What's next
122+
123+
As we now finish up the work on v11, we're looking forward to working on the next ReScript version. Here are some of the features we're planning to focus on in upcoming versions:
124+
125+
- Make JSX usable beyond React:
126+
- [Generic JSX transform](https://github.com/rescript-lang/rescript-compiler/issues/6408)
127+
- [JSX preserve mode](https://github.com/rescript-lang/rescript-compiler/issues/6197)
128+
- Integrate the Rescript Core standard library into the compiler
129+
- remove the OCaml standard library
130+
- remove `Belt` but keep it available as external package
131+
- Make maintaining TS libraries with ReScript a breeze, [thanks to genType](https://github.com/rescript-lang/rescript-compiler/issues/6210)
132+
- Support [tagged template literals](https://github.com/rescript-lang/rescript-compiler/pull/6250)
133+
- [Dedicated syntax for creating Dicts](https://github.com/rescript-lang/rescript-compiler/issues/6545)
134+
- [Array spread syntax](https://github.com/rescript-lang/rescript-compiler/issues/6546)
135+
- A [new custom build system](https://github.com/rolandpeelen/rewatch) with better support for workspaces / monorepos
136+
- More improvements to the type system
137+
138+
## Acknowledgements
139+
140+
We want to thank everyone from the community who volunteered their precious time to support this project with contributions of any kind, from documentation, to PRs, to discussions in the forum.
141+
142+
## That's it
143+
144+
We hope you enjoy the newest improvements as much as we do.
145+
146+
In case of issues / problems, make sure to report bugs to one of the following repositories:
147+
148+
- [rescript-lang/rescript-compiler](https://github.com/rescript-lang/rescript-compiler) (language / syntax / jsx)
149+
- [rescript-lang/rescript-react](https://github.com/rescript-lang/rescript-react) (React bindings)
150+
- [rescript-lang/rescript-vscode](https://github.com/rescript-lang/rescript-vscode) (VSCode language support, LSP, tools)
151+
- [rescript-lang/create-rescript-app](https://github.com/rescript-lang/create-rescript-app) (project generator) or
152+
- [rescript-association/rescript-lang.org](https://github.com/rescript-association/rescript-lang.org) (documentation)
106 KB
Loading

scripts/test-hrefs.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const createApiIndexModules = version => {
120120

121121
return acc.concat(paths);
122122
}, []);
123-
return paths;
123+
return ["latest/api", ...paths];
124124
};
125125

126126
const apiIndexModules = createApiIndexModules("latest")

src/components/Banner.res

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@react.component
2+
let make = (~children) =>
3+
<div className="bg-fire text-white text-center text-14 py-3"> children </div>

src/components/Markdown.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ module A = {
391391

392392
module Ul = {
393393
@react.component
394-
let make = (~children) => <ul className="md-ul mt-12 mb-16"> children </ul>
394+
let make = (~children) => <ul className="md-ul mb-16"> children </ul>
395395
}
396396

397397
module Ol = {

src/layouts/LandingPageLayout.res

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,17 @@ let make = (~components=MarkdownComponents.default, ~children) => {
700700
ogImage="/static/Art-3-rescript-launch.jpg"
701701
/>
702702
<div className="mt-4 xs:mt-16">
703-
<div className="text-gray-80 text-18">
703+
<div className="text-gray-80 text-18 z">
704704
<Navigation overlayState />
705-
<div className="absolute top-16 w-full">
705+
<div className="absolute w-full top-16">
706+
// Delete this again, when ReScript 11 is out for some time.
707+
<Banner>
708+
{React.string("ReScript 11 is out! Read the ")}
709+
<Next.Link href="/blog/release-11-0-0" className="underline">
710+
{React.string("announcement blog post")}
711+
</Next.Link>
712+
{React.string(".")}
713+
</Banner>
706714
<div className="relative overflow-hidden pb-32">
707715
<main className="mt-10 min-w-320 lg:align-center w-full">
708716
<MdxProvider components>

0 commit comments

Comments
 (0)