-
-
Notifications
You must be signed in to change notification settings - Fork 252
Release blogpost for v11 #782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
76212e7
Release blogpost for v11
fhammerschmidt 8970c76
Fix tests
fhammerschmidt 1df4e2f
Move ReScript Core mention up a bit
fhammerschmidt 4e75fbe
Changes according comments
fhammerschmidt f6b95a3
Some more feature mentions
fhammerschmidt 29bba40
Improve suffix text
fhammerschmidt a3e4106
Add advertisment banner for ReScript 11
fhammerschmidt ff2adff
Fix banner on landing page
fhammerschmidt 220b276
Move Banner to just the landing page
fhammerschmidt dab5265
Add link to Rescript Core API docs
fhammerschmidt 6b824b1
Fix changelog url
fhammerschmidt bf98ba0
Make Banner color consistent with Button color
fhammerschmidt 941f600
Add some sentences to describe the main features
fhammerschmidt 42f1e3a
Move ReScript Core to a more prominent position
fhammerschmidt bbfbd0f
Fix ul margin
fhammerschmidt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
--- | ||
author: rescript-team | ||
date: "2024-01-11" | ||
previewImg: /static/blog/compiler_release_11_0.jpg | ||
title: ReScript 11.0 | ||
badge: release | ||
description: | | ||
The ReScript developer experience now goes up to eleven! | ||
--- | ||
|
||
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. | ||
|
||
Use your favorite package manager to install the new compiler release, e.g: | ||
|
||
```sh | ||
npm install rescript@11 | ||
``` | ||
|
||
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). | ||
|
||
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. | ||
|
||
## Highlights | ||
|
||
**Note**: As this release is packed, please refer to the linked blogposts for a detailed breakdown of each of the main new features. | ||
|
||
### Customizable Variants | ||
|
||
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. | ||
|
||
- Blogpost: [Better interop with customizable variants](/blog/improving-interop) | ||
|
||
### Enhanced Ergonomics for Record Types | ||
|
||
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). | ||
|
||
- Blogpost: [Enhanced Ergonomics for Record Types](/blog/enhanced-ergonomics-for-record-types) | ||
|
||
### First-class Dynamic Import Support | ||
|
||
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. | ||
|
||
- Blogpost: [First-class Dynamic Import Support](/blog/first-class-dynamic-import-support) | ||
|
||
### Uncurried Mode | ||
|
||
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. | ||
|
||
- Blogpost: [Uncurried Mode](/blog/uncurried-mode) | ||
|
||
### New Standard Library: ReScript Core | ||
|
||
[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. | ||
|
||
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). | ||
|
||
## More Features | ||
|
||
Furthermore, there are a lot of smaller improvements of which we want to state only a few here. | ||
|
||
### More types eligible for type coercion | ||
|
||
The `:>` (type coercion) operator now supports a few more datatypes, check out its [Syntax Lookup](/syntax-lookup#type-coercion) page. | ||
|
||
### Build System | ||
|
||
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. | ||
|
||
### rescript.json | ||
|
||
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`. | ||
|
||
### Relaxed Suffix Rules | ||
|
||
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. | ||
|
||
### Opening files from current project globally | ||
|
||
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: | ||
|
||
```json | ||
{ | ||
"bsc-flags": ["-open Utils"] | ||
} | ||
``` | ||
|
||
## Ecosystem | ||
|
||
### Create-ReScript-App | ||
|
||
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. | ||
|
||
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. | ||
|
||
### ReScript-React v0.12 | ||
|
||
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). | ||
|
||
### ReScript Tools / Documentation Extraction | ||
|
||
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: | ||
|
||
```sh | ||
npm install --save-dev @rescript/tools | ||
npx rescript-tools doc src/MyFile.res > doc.json | ||
``` | ||
|
||
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. | ||
|
||
### LSP | ||
|
||
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). | ||
|
||
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: | ||
|
||
```sh | ||
npm install -g @rescript/language-server | ||
npx rescript-language-server --stdio | ||
``` | ||
|
||
## What's next | ||
|
||
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: | ||
|
||
- Make JSX usable beyond React: | ||
- [Generic JSX transform](https://github.com/rescript-lang/rescript-compiler/issues/6408) | ||
- [JSX preserve mode](https://github.com/rescript-lang/rescript-compiler/issues/6197) | ||
- Integrate the Rescript Core standard library into the compiler | ||
- remove the OCaml standard library | ||
- remove `Belt` but keep it available as external package | ||
- Make maintaining TS libraries with ReScript a breeze, [thanks to genType](https://github.com/rescript-lang/rescript-compiler/issues/6210) | ||
- Support [tagged template literals](https://github.com/rescript-lang/rescript-compiler/pull/6250) | ||
- [Dedicated syntax for creating Dicts](https://github.com/rescript-lang/rescript-compiler/issues/6545) | ||
- [Array spread syntax](https://github.com/rescript-lang/rescript-compiler/issues/6546) | ||
- A [new custom build system](https://github.com/rolandpeelen/rewatch) with better support for workspaces / monorepos | ||
- More improvements to the type system | ||
|
||
fhammerschmidt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## Acknowledgements | ||
|
||
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. | ||
|
||
## That's it | ||
|
||
We hope you enjoy the newest improvements as much as we do. | ||
|
||
In case of issues / problems, make sure to report bugs to one of the following repositories: | ||
|
||
- [rescript-lang/rescript-compiler](https://github.com/rescript-lang/rescript-compiler) (language / syntax / jsx) | ||
- [rescript-lang/rescript-react](https://github.com/rescript-lang/rescript-react) (React bindings) | ||
- [rescript-lang/rescript-vscode](https://github.com/rescript-lang/rescript-vscode) (VSCode language support, LSP, tools) | ||
- [rescript-lang/create-rescript-app](https://github.com/rescript-lang/create-rescript-app) (project generator) or | ||
- [rescript-association/rescript-lang.org](https://github.com/rescript-association/rescript-lang.org) (documentation) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@react.component | ||
let make = (~children) => | ||
<div className="bg-fire text-white text-center text-14 py-3"> children </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.