Skip to content

Commit e78ad7a

Browse files
committed
Merge branch 'master' into playgroud-output-result-rebase-aspeddro
2 parents 8341fbe + 8b5ef34 commit e78ad7a

File tree

295 files changed

+11058
-15364
lines changed

Some content is hidden

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

295 files changed

+11058
-15364
lines changed

.github/workflows/pull-request.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Test
22
on: [pull_request]
33
jobs:
44
build:
5-
name: Test
65
runs-on: ubuntu-latest
76
steps:
87
- uses: actions/checkout@v2
@@ -12,3 +11,6 @@ jobs:
1211
- run: npm ci
1312
- run: npx rescript
1413
- run: npm test
14+
15+
- name: Format check
16+
run: npx rescript format -check -all

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ node_modules/
99
.next/
1010
index_data/*.json
1111

12+
# Generated via test examples script
13+
_tempFile.cmi
14+
_tempFile.cmj
15+
_tempFile.cmt
16+
1217
# these docs are checked in, but we consider them frozen.
1318
pages/docs/manual/v8.0.0/
1419
pages/docs/manual/v9.0.0/
@@ -19,3 +24,5 @@ lib/
1924
.vscode/
2025

2126
.vercel
27+
28+
src/**/*.mjs

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ If you need inspiration on what to work on, you can check out issues tagged with
3030

3131
We really appreciate all input from users, community members and potential contributors. Please make sure to consider the other person's opinion and don't assume any common knowledge.
3232

33-
**Most importantly: Keep it professional and be nice to eachother**
33+
**Most importantly: Keep it professional and be nice to each other**
3434

35-
There might be situations where others don't understand a proposed feature or have different opinions on certain writing styles. That's fine, discussions are always welcome! Communicate in clear actionables, make your plans clear and always to stick to the original topic.
35+
There might be situations where others don't understand a proposed feature or have different opinions on certain writing styles. That's fine, discussions are always welcome! Communicate in clear actionables, make your plans clear and always stick to the original topic.
3636

3737
If other contributors disagree with certain proposals and don't change their mind after longer discussions, please don't get discouraged when an issue gets closed / postponed. Everyone tries their best to make the platform better, and to look at it in another perspective: Closed issues are also a highly valuable resource for others to understand technical decisions later on.
3838

3939
### Communicate your Time Commitment
4040

4141
Open Source development can be a challenge to coordinate, so please make sure to block enough time to work on your tasks and show commitment when taking on some work. Let other contributors know if your time schedule changes significantly, and also let others know if you can't finish a task.
4242

43-
We value your voluntary work, and of course it's fine to step back from a ticket for any reasons (we can also help you if you are getting stuck). Please talk to us in any case, otherwise we might re-assign the ticket to other contributors.
43+
We value your voluntary work, and of course it's fine to step back from a ticket for any reason (we can also help you if you are getting stuck). Please talk to us in any case, otherwise we might re-assign the ticket to other contributors.
4444

4545
### Communication Channels
4646

@@ -66,7 +66,7 @@ Always check if there are any designs for certain UI components and think about
6666
### Technical Writing (Documentation)
6767

6868
- Think and write in a JS friendly mindset when explaining concepts / showing examples.
69-
- No `foo` examples if somewhat possible. Try to establish practical context in your show case examples.
69+
- No `foo` examples if somewhat possible. Try to establish practical context in your showcase examples.
7070
- No references to `OCaml`. ReScript is its own language, and we don't rely on external resources of our host language.
7171
- If possible, no references to `Reason` examples / external resources. Our goal is to migrate everything to ReScript syntax.
7272

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
SHELL = /bin/bash
2+
3+
node_modules/.bin/rescript:
4+
npm install
5+
npm run update-index
6+
7+
build: node_modules/.bin/rescript
8+
node_modules/.bin/rescript
9+
npm run update-index
10+
11+
dev: build
12+
npm run dev
13+
14+
test: build
15+
npm run test
16+
17+
clean:
18+
rm -r node_modules lib
19+
20+
.DEFAULT_GOAL := build
21+
22+
.PHONY: clean test

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
This is the official documentation platform for the [ReScript](https://rescript-lang.org) programming language.
88

9-
**In case you want to report a technical issue, please refer to the appropriate repository:**
10-
- [rescript-compiler](https://github.com/rescript-lang/rescript-compiler): The compiler and build system
11-
- [rescript-syntax](https://github.com/rescript-lang/syntax): The ReScript syntax
9+
**Please report any technical issues with ReScript to the [compiler repository](https://github.com/rescript-lang/rescript-compiler).**
1210

1311
**In case you are missing some specific documentation:**
1412
- Some language / compiler feature may not be documented yet
@@ -17,21 +15,21 @@ This is the official documentation platform for the [ReScript](https://rescript-
1715

1816
## System Requirements
1917

20-
- `node@12.22.1` or higher (for ES6 module compat)
21-
- `npm@7` (package-lock v2)
18+
- `node@16.x` or higher (for ES6 module compat)
19+
- `npm@7` or higher (package-lock v2)
2220

2321
## Setup
2422

2523
```sh
2624
# For first time clone / build (install dependencies)
2725
npm i
2826

29-
# Only needed for initial clone (or content H2 changes)
30-
npm run update-index
31-
3227
# Initial build
3328
npx rescript
3429

30+
# Only needed for initial clone (or content H2 changes)
31+
npm run update-index
32+
3533
# Build the index data
3634
npm run update-index
3735

@@ -91,7 +89,7 @@ We check the validity of our code examples marked with:
9189
Run the checks with:
9290

9391
```sh
94-
node scripts/test-examples.js
92+
node scripts/test-examples.mjs
9593
```
9694

9795
### Markdown Hyperlink Tests
@@ -117,10 +115,10 @@ Here is an example on how to run the tests:
117115

118116
```sh
119117
# Tests all files
120-
node scripts/test-hrefs.js
118+
node scripts/test-hrefs.mjs
121119

122120
# Or just a subset (glob pattern)
123-
node scripts/test-hrefs.js "pages/docs/manual/**/*.mdx"
121+
node scripts/test-hrefs.mjs "pages/docs/manual/**/*.mdx"
124122
```
125123

126124
### Continous Integration
@@ -153,6 +151,15 @@ NODE_ENV=production npx postcss styles/main.css -o test.css
153151

154152
In case you are a blog author, please refer to our [guide on writing blog posts](https://rescript-lang.org/blogpost-guide).
155153

154+
## How to Add Your Company Logo to Our Front Page
155+
156+
In case your company is a user of ReScript and wants to be displayed on our front page ("Trusted by our users" section), do the following:
157+
158+
- Get your logo as a black / white `.svg` version and use `#979AAD` as a fill color (check out the existing logos on our front page).
159+
- Put your logo into the [`public/static/lp`](./public/static/lp) folder; the file should be named after your company.
160+
- Open [src/common/OurUsers.res](./src/common/OurUsers.res) and add your info
161+
- Commit, push, and open a PR.
162+
156163
### Contributing
157164

158165
Please make sure to first read and comply to our [Code of Conduct](CODE_OF_CONDUCT.md) and check out our [CONTRIBUTING.md](CONTRIBUTING.md) file to learn how to get started with our contribution process!

_blogposts/2021-02-09-release-9-0.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ReScript is a robustly typed language that compiles to efficient and human-reada
1717
Use `npm` to install the newest [9.0.1 release](https://www.npmjs.com/package/bs-platform/v/9.0.1) with the following command:
1818

1919
```
20-
npm install bs-platform@9.0.1 --save-dev
20+
npm install bs-platform@9.0.1
2121
```
2222

2323
You can also try our new release in the [Online Playground](/try).

_blogposts/2021-03-03-rescript-association-rebranding.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Furthermore, we serve as a communication channel for our partners and donors.
4545

4646
High quality, long-term Open Source work doesn’t come from some good words and pats on the back. While we do try to be efficient, past a certain point, big amounts of time and financial resources are needed to keep up the momentum for maintaining and developing the platform. To this end, we regularly raise donations to make sure that the running costs are covered, and Open Source contributors paid.
4747

48-
If your company relies on the ReScript platform for building commercial products, please consider supporting our efforts by [sending a donation](https://rescript-association.org/donate). It’s the best way to future proof your product’s foundation. Alternatively, you can sponsor individual members like [ryyppy](https://github.com/sponsors/ryyppy/) on Github Sponsors.
48+
If your company relies on the ReScript platform for building commercial products, please consider supporting our efforts by [sending a donation](https://rescript-association.org/donate). It’s the best way to future proof your product’s foundation. Alternatively, you can sponsor individual members like [ryyppy](https://github.com/sponsors/ryyppy/) on GitHub Sponsors.
4949

5050
We want to take this opportunity to thank our previous and active sponsors:
5151
- [Tezos Foundation](https://tezos.foundation) (2020-21)
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
author: rescript-team
3+
date: "2022-08-25"
4+
previewImg: static/blog/grid_0.jpeg
5+
title: ReScript 10.0
6+
badge: release
7+
description: |
8+
The first community powered release.
9+
---
10+
11+
ReScript version 10 is available! Version 10 is a culmination of over a year's worth of work, bringing faster builds, improving JS interop, and including a bunch of bug fixes. It's also the first fully community powered release, with contributions from over 20 community members.
12+
13+
```
14+
npm install rescript@10
15+
```
16+
17+
All changes are listed [here](https://github.com/rescript-lang/rescript-compiler/blob/10.0_release/CHANGELOG.md). Let's take a tour of a few of the features we're extra excited about.
18+
19+
## Faster builds with native M1 support
20+
Users with M1 chips should see a notable speedup, as the new ReScript version has full native support for M1.
21+
22+
## Better ergonomics with Unicode support in regular strings
23+
You can now use Unicode characters directly in regular strings. This will now produce what you'd expect:
24+
```res
25+
let str = "Σ"
26+
```
27+
28+
You can also pattern match on Unicode characters:
29+
```res
30+
switch someCharacter {
31+
| 'Σ' => "what a fine Unicode char"
32+
| _ => "Unicode is fun"
33+
}
34+
```
35+
36+
## Experimental optional record fields
37+
Previously, a record would always have to define all its optional fields:
38+
```res
39+
type user = {
40+
name: string,
41+
age: option<int>
42+
}
43+
44+
let userWithoutAge = {
45+
name: "Name",
46+
age: None,
47+
}
48+
49+
let userWithAge = {
50+
name: "Name",
51+
age: Some(34),
52+
}
53+
```
54+
For small records like the one above, this is typically fine. But for records with many fields, the friction of having to always set all optional fields explicitly adds up. This release has a new experimental feature called optional record fields, allowing you to rewrite the above to this instead:
55+
56+
```res
57+
type user = {
58+
name: string,
59+
age?: int
60+
}
61+
62+
// No need to set `age` unless it should have a value
63+
let userWithoutAge = {
64+
name: "Name",
65+
}
66+
67+
let userWithAge = {
68+
name: "Name",
69+
age: 34
70+
}
71+
```
72+
73+
Other than drastically improving the experience when working with large records with optional fields, this also has implications for bindings. For example, binding to JS APIs with large configuration objects is now more ergonomic.
74+
This feature also paves the way for other exciting features coming in the next release, such as a more idiomatic representation of React components.
75+
76+
## What's next
77+
78+
Version 10 brings the building blocks needed for a number of exciting new features that'll be available in the next version. Features ranging from native support for async/await, to a new version of the JSX integration, making it leaner and more flexible. You'll hear more about this soon.
79+
80+
## Upgrade guide
81+
82+
Please see the detailed [changelog](https://github.com/rescript-lang/rescript-compiler/blob/10.0_release/CHANGELOG.md) for a list of breaking changes.
83+
Each breaking change lists suggestions on how to upgrade your project.
84+
This can be out of your control in case of dependencies. In that case, please raise issues with the maintainers of those libraries.
85+
86+
One special word for PPXs, in particular for PPX authors: As mentioned in the changelog, some PPXs may give an error `"Attributes not allowed here"`. The solution is to adapt the PPXs following the example of `rescript-relay` in https://github.com/zth/rescript-relay/pull/372.
87+
88+
## Acknowledgements
89+
90+
We would like to thank everyone from the community who volunteered their precious time to suport this project with contributions of any kind, from documentation, to PRs, to discussions in the forum.
91+
In particular, thank you [@cknitt](https://github.com/cknitt), [@TheSpyder](https://github.com/TheSpyder), [@mattdamon108](https://github.com/mattdamon108), [@DZakh](https://github.com/DZakh), [@fhammerschmidt](https://github.com/fhammerschmidt), [@amiralies](https://github.com/amiralies), [@Minnozz](https://github.com/Minnozz), [@Zeta611](https://github.com/Zeta611), [@jchavarri](https://github.com/jchavarri), [@nkrkv](https://github.com/nkrkv), [@whitchapman](https://github.com/whitchapman), [@ostera](https://github.com/ostera), [@benadamstyles](https://github.com/benadamstyles), [@cannorin](https://github.com/cannorin), [@ClaireNeveu](https://github.com/ClaireNeveu), [@kevinbarabash](https://github.com/kevinbarabash), [@JsonKim](https://github.com/JsonKim), [@Sehun0819](https://github.com/Sehun0819), [@glennsl](https://github.com/glennsl), [@namenu](https://github.com/namenu), [@a-c-sreedhar-reddy](https://github.com/a-c-sreedhar-reddy).

0 commit comments

Comments
 (0)