Skip to content

Commit ad9aefa

Browse files
committed
Merge branch 'master' into playgroud-output-result-rebase-aspeddro
2 parents 0edfffb + b26a82d commit ad9aefa

File tree

240 files changed

+54949
-41243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+54949
-41243
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: 🚀 rescript-compiler
4+
url: https://github.com/rescript-lang/rescript-compiler/issues
5+
about: Please report problems about the ReScript compiler and build system here.
6+
- name: 💻 rescript-vscode
7+
url: https://github.com/rescript-lang/rescript-vscode/issues
8+
about: VSCode language support, LSP, tools
9+
- name: 📦 create-rescript-app
10+
url: https://github.com/rescript-lang/create-rescript-app/issues
11+
about: ReScript's project generator
12+
- name: ⚛️ rescript-react
13+
url: https://github.com/rescript-lang/rescript-react/issues
14+
about: ReScript bindings to React.js
15+
- name: 🌐 rescript-core
16+
url: https://github.com/rescript-association/rescript-core/issues
17+
about: New ReScript standard library
18+
- name: 💬 ReScript Forum
19+
url: https://forum.rescript-lang.org/
20+
about: For discussions about ReScript, please visit the official ReScript forum.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: 🚨 Documentation issue
3+
about: Create an issue to help us improve the rescript-lang.org documentation website
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Please make sure to check out our [Code of Conduct](CODE_OF_CONDUCT.md) and make
66

77
## Ways to contribute
88

9-
- Writing docs for the manual (Check for issues that are marked with a [`manual`](https://github.com/reason-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"manual") and [`help wanted`](https://github.com/reason-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted") tag)
10-
- Joining in discussions on our [issue tracker](https://github.com/reason-association/rescript-lang.org/issues)
9+
- Writing docs for the manual (Check for issues that are marked with a [`manual`](https://github.com/rescript-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"manual") and [`help wanted`](https://github.com/rescript-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted") tag)
10+
- Joining in discussions on our [issue tracker](https://github.com/rescript-association/rescript-lang.org/issues)
1111
- Give feedback for improvements (incomplete / missing docs, bad wording,
1212
search user experience / design, etc.)
1313
- Advanced: Help building platform features (design system, automatic testing, markdown parsing, etc.)
@@ -16,15 +16,15 @@ Please make sure to check out our [Code of Conduct](CODE_OF_CONDUCT.md) and make
1616

1717
### Find an issue
1818

19-
Before you start any work or submit any PRs, make sure to check our [issue tracker](https://github.com/reason-association/rescript-lang.org/issues) for any issues or discussions on the topic.
19+
Before you start any work or submit any PRs, make sure to check our [issue tracker](https://github.com/rescript-association/rescript-lang.org/issues) for any issues or discussions on the topic.
2020

2121
If you can't find any relevant issues, feel free to create a new one to start a discussion. We usually assign issues to a responsible person to prevent confusion and duplicate work, so always double check if an issue is currently being worked on, or talk to the current assignee to take over the task.
2222

2323
**Always make sure to get feedback from the core maintainers before starting any work**
2424

2525
The project follows very specific goals and tries to deliver the highest value with the least amount of resources. Please help us focus on the tasks at hand and don't submit any code / bigger refactorings without any proper discussion on the issue tracker. Otherwise your PR might not be accepted!
2626

27-
If you need inspiration on what to work on, you can check out issues tagged with [`good first issue`](https://github.com/reason-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"good+first+issue") or [`help wanted`](https://github.com/reason-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted").
27+
If you need inspiration on what to work on, you can check out issues tagged with [`good first issue`](https://github.com/rescript-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"good+first+issue") or [`help wanted`](https://github.com/rescript-association/rescript-lang.org/issues?q=is%3Aissue+is%3Aopen+label%3A"help+wanted").
2828

2929
### Discuss an issue
3030

@@ -44,7 +44,7 @@ We value your voluntary work, and of course it's fine to step back from a ticket
4444

4545
### Communication Channels
4646

47-
- [Issue Tracker](https://github.com/reason-association/rescript-lang.org/issues)
47+
- [Issue Tracker](https://github.com/rescript-association/rescript-lang.org/issues)
4848
- [ReScript Discourse (General / mostly unrelated discussions)](http://forum.rescript-lang.org)
4949

5050
## Working on the rescript-lang.org
@@ -55,7 +55,7 @@ We try to keep our contribution guidelines to a minimum. Please keep following r
5555

5656
The less code we write, the better. If there's a way to do rendering on the server, or enhance existing markdown files, we prefer that over client-side rendering and external loading.
5757

58-
We also try to keep our third-party dependencies to a minimum. We use specific frameworks to make things work (`unified`, `remark`, `mdx`, `bs-platform`, etc). Please try to keep a small JS footprint, especially for client side code (to keep the bundle size small).
58+
We also try to keep our third-party dependencies to a minimum. We use specific frameworks to make things work (`unified`, `remark`, `mdx`, `bs-platform`, etc). Please try to keep a small JS footprint, especially for client side code (to keep the bundle size small).
5959

6060
### Think about the target audience & UX
6161

@@ -72,7 +72,7 @@ Always check if there are any designs for certain UI components and think about
7272

7373
### Tailwind for CSS Development
7474

75-
We use [TailwindCSS](https://tailwindcss.com) for our component styling. Check out the [tailwind.config.js](tailwind.config.js) file for configured tailwind features, colors, border-radius values etc.. If you are not familiar with Tailwind, check out existing components for inspiration.
75+
We use [TailwindCSS](https://tailwindcss.com) for our component styling. Check out the [tailwind.config.js](tailwind.config.js) file for configured tailwind features, colors, border-radius values etc.. If you are not familiar with Tailwind, check out existing components for inspiration.
7676

7777
We sometimes also need to fall back to common css (with tailwind `@apply` directives to enforce our style system). You can find the CSS main entrypoint in [styles/main.css](styles/main.css).
7878

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This is the official documentation platform for the [ReScript](https://rescript-
99
**Please report any technical issues with ReScript to the [compiler repository](https://github.com/rescript-lang/rescript-compiler).**
1010

1111
**In case you are missing some specific documentation:**
12+
1213
- Some language / compiler feature may not be documented yet
1314
- Create an issue to let us know what you are missing
1415
- In case you want to contribute missing docs, please refer to our [Contribution section](#contributing)
@@ -42,7 +43,7 @@ open localhost:3000
4243
In case you want to run ReScript in watchmode:
4344

4445
```sh
45-
npx rescript build -w
46+
npx rescript -w
4647
```
4748

4849
## Build Index Data
@@ -82,9 +83,10 @@ build specific pages (file `index_data/x.json` not found).
8283
### Markdown Codeblock Tests
8384

8485
We check the validity of our code examples marked with:
85-
- `` ```res example `` (ReScript code snippet)
86-
- `` ```res sig `` (signature)
87-
- `` ```res prelude `` (ReScript code snippet available for all subsequent code snippets)
86+
87+
- ` ```res example ` (ReScript code snippet)
88+
- ` ```res sig ` (signature)
89+
- ` ```res prelude ` (ReScript code snippet available for all subsequent code snippets)
8890

8991
Run the checks with:
9092

_blogposts/2020-08-10-bucklescript-is-rebranding.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The ReScript community will comprise of the majority of the old Reason community
9999

100100
**The new changes make me worried about the future support I'm going to receive from the team.**
101101

102-
_Retrospective edit, in 2021_: suffice to day that we've been doing well =).
102+
_Retrospective edit, in 2021_: suffice to say that we've been doing well =).
103103

104104
## Conclusion
105105

_blogposts/2020-11-17-editor-support-custom-operators-and-more.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Hongbo continues to improve the compiler experience in monorepo-like setups. Exp
2828

2929
## Docs
3030

31-
Patrick is [rearranging the React documentation](https://github.com/reason-association/rescript-lang.org/pull/96), and continues to improve the main documentation site with Cheng Lou.
31+
Patrick is [rearranging the React documentation](https://github.com/rescript-association/rescript-lang.org/pull/96), and continues to improve the main documentation site with Cheng Lou.
3232

3333
## Syntax
3434

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)

_blogposts/archive/2020-05-11-state-of-reasonml-org-2020-q2-pt2.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ List.head([1, 2, 3]); /* This should actually be Belt.List */
3333
Running the test with the broken example would produce:
3434

3535
```sh
36-
node scripts/test-examples.js "pages/apis/latest/belt/list.mdx"
36+
node scripts/test-examples.mjs "pages/apis/latest/belt/list.mdx"
3737

3838
Testing example in 'pages/apis/latest/belt/list.mdx' on line 23...
3939
Testing example in 'pages/apis/latest/belt/list.mdx' on line 43...
@@ -54,7 +54,7 @@ Failed: 1
5454
Success: 55
5555

5656
Tip: You can also run tests just for specific files / globs:
57-
`node scripts/test-examples.js "pages/belt_docs/array.mdx"`
57+
`node scripts/test-examples.mjs "pages/belt_docs/array.mdx"`
5858

5959
-----------
6060
Error Preview:

_blogposts/archive/2020-07-01-bucklescript-8-1-new-syntax.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The release of BuckleScript 8.1 contains a new important addition: we've rewritt
1616

1717
The rewrite was done by a community member of ours, [Maxim](https://twitter.com/_binary_search). Maxim was a main contributor to the old Reason repo, and together we've reached the conclusion a while ago that the codebase needed a revamp. After wrestling with it for the longest time, we've settled on a low-key rewrite.
1818

19-
Syntax discussions have always been churny, so we didn't want to prematurity announce something before it's ready for proper critiques. After testing this extensively; we now deem it solid enough for your consumption.
19+
Syntax discussions have always been churny, so we didn't want to prematurely announce something before it's ready for proper critiques. After testing this extensively, we now deem it solid enough for your consumption.
2020

2121
**Here's what you need to know:**
2222
- The new syntax comes directly with your BuckleScript >=8.1 installation. You won't have to install anything else. It does not depend on the old `refmt`.

_blogposts/archive/2020-07-06-a-note-on-bucklescripts-future-commitments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ description: |
1616

1717
Our [new ReScript syntax announcement](/blog/bucklescript-8-1-new-syntax) generated lots of good feedback, but also raised some concerns from community members whose use-cases still align with our goal, but sometimes extend outside of it, and who are worried about further commitments to the ecosystem in the face of new unknowns.
1818

19-
This post is dedicated to answer some commons questions regarding trust, breakages, and future investment.
19+
This post is dedicated to answer some common questions regarding trust, breakages, and future investment.
2020

2121
## Q & A
2222

compilers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
This folder is needed to install additional rescript compiler versions for testing our documented source code on multiple compiler versions.
44

5-
Our `scripts/test-examples.js` script will automatically install all package.json dependencies if it cannot find any compiler versions.
5+
Our `scripts/test-examples.mjs` script will automatically install all package.json dependencies if it cannot find any compiler versions.

0 commit comments

Comments
 (0)