Skip to content

Commit 7c10005

Browse files
committed
Merge branch 'master' into new-doc-search
2 parents ff2c51c + 5a7ebe4 commit 7c10005

33 files changed

+785
-494
lines changed

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

_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

_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`.

compilers/package-lock.json

Lines changed: 132 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compilers/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
"license": "MIT",
77
"dependencies": {
88
"@rescript/core": "^0.6.0",
9+
"@rescript/react": "^0.12.0",
910
"rescript-1000": "npm:[email protected]",
1011
"rescript-1010": "npm:[email protected]",
1112
"rescript-1100": "npm:[email protected]",
13+
"rescript-1110": "npm:[email protected]",
1214
"rescript-820": "npm:[email protected]",
1315
"rescript-902": "npm:[email protected]",
1416
"rescript-912": "npm:[email protected]"

compilers/rescript.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"name": "dummy",
3+
"jsx": { "version": 4 },
34
"sources": {
45
"dir": "dummy",
56
"subdirs": true
67
},
78
"bs-dependencies": [
8-
"@rescript/core"
9+
"@rescript/core",
10+
"@rescript/react"
911
],
1012
"bsc-flags": [
1113
"-open RescriptCore"

data/sidebar_manual_latest.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@
2828
"lazy-values",
2929
"promise",
3030
"async-await",
31+
"tagged-templates",
3132
"module",
3233
"import-export",
3334
"attribute",
34-
"reserved-keywords"
35+
"reserved-keywords",
36+
"equality-comparison"
3537
],
3638
"Advanced Features": [
3739
"extensible-variant",
@@ -72,4 +74,4 @@
7274
"project-structure",
7375
"faq"
7476
]
75-
}
77+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
id: "jsx-component-decorator"
3+
keywords: ["jsx", "component", "decorator"]
4+
name: "@jsx.component"
5+
summary: "This is the `@jsx.component` decorator."
6+
category: "decorators"
7+
---
8+
9+
**Since 11.1**
10+
11+
The `@jsx.component` decorator is used to annotate functions that are [JSX](/docs/react/latest/elements-and-jsx) components. This is a _generic_ version that's equivalent to the existing `@react.component` for React.
12+
13+
You will need this decorator whenever you want to use JSX component in JSX expressions, with a [generic JSX transform](/docs/manual/latest/jsx#generic-jsx-transform-jsx-beyond-react-experimental) configured.
14+
15+
16+
### Example
17+
18+
<CodeTab labels={["ReScript", "JS Output"]}>
19+
20+
```res
21+
// Assuming `Preact` is set up and configured as a generic JSX transform.
22+
@jsx.component
23+
let make = (~name) => {
24+
<button> {Preact.string("Hello " ++ name ++ "!")} </button>
25+
}
26+
```
27+
28+
```js
29+
import * as Preact from "preact";
30+
31+
function Playground(props) {
32+
return Preact.jsx("button", {
33+
children: "Hello " + props.name + "!"
34+
});
35+
}
36+
37+
var make = Playground;
38+
```
39+
40+
</CodeTab>
41+
42+
### References
43+
44+
* [Generic JSX transform](/docs/manual/latest/jsx#generic-jsx-transform-jsx-beyond-react-experimental)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
id: "taggedTemplate-decorator"
3+
keywords: ["taggedTemplate", "tagged", "template", "decorator"]
4+
name: "@taggedTemplate"
5+
summary: "This is the `@taggedTemplate` decorator."
6+
category: "decorators"
7+
---
8+
**Since 11.1**
9+
10+
The `@taggedTemplate` decorator is used to bind to JavaScript tag functions.
11+
12+
### Example
13+
14+
<CodeTab labels={["ReScript", "JS Output"]}>
15+
16+
```res example
17+
// see https://bun.sh/docs/runtime/shell
18+
type result = {exitCode: int}
19+
@module("bun") @taggedTemplate
20+
external sh: (array<string>, array<string>) => promise<result> = "$"
21+
22+
let filename = "index.res"
23+
let result = await sh`ls ${filename}`
24+
```
25+
26+
```js
27+
import * as $$Bun from "bun";
28+
var filename = "index.res";
29+
var result = await $$Bun.$`ls ${filename}`;
30+
```
31+
32+
</CodeTab>
33+
34+
### References
35+
36+
* [Tagged template functions](/docs/manual/latest/bind-to-js-function#tagged-template-functions)

0 commit comments

Comments
 (0)