You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
# Contributing
2
2
3
-
Thanks for your help! Due to BuckleScript's nature, the contribution setup isn't all straightforward. If something isn't working, please file an issue!
3
+
Thanks for your help! Due to ReScript's nature, the contribution setup isn't all straightforward. If something isn't working, please file an issue!
4
4
5
5
## Prerequisites
6
6
7
7
-[NodeJS](https://nodejs.org/)
8
8
- C compiler toolchain (you probably already have it installed)
9
-
- OS: Mac/Linux (BuckleScript works on Windows, but developing the repo using Windows isn't tested. Contribution welcome!)
9
+
- OS: Mac/Linux (ReScript works on Windows, but developing the repo using Windows isn't tested. Contribution welcome!)
10
10
11
11
## Build
12
12
@@ -42,7 +42,7 @@ In the rare case there you're making changes to the vendored OCaml fork, rebuild
42
42
43
43
### Integration Test
44
44
45
-
If you'd like to use your modified BuckleScript like an end-user, try:
45
+
If you'd like to use your modified ReScript like an end-user, try:
46
46
47
47
```sh
48
48
BS_TRAVIS_CI=1 npm install -g .
@@ -67,7 +67,7 @@ See https://github.com/reason-association/reasonml.org/
67
67
68
68
## Contribute to the API Reference
69
69
70
-
The API reference is generated from doc comments in the source code. [Here](https://github.com/bucklescript/bucklescript/blob/99650/jscomp/others/js_re.mli#L146-L161)'s a good example.
70
+
The API reference is generated from doc comments in the source code. [Here](https://github.com/rescript-lang/rescript-compiler/blob/99650/jscomp/others/js_re.mli#L146-L161)'s a good example.
71
71
72
72
Some tips:
73
73
@@ -94,7 +94,7 @@ To generate the html:
94
94
95
95
## Contributing to the Runtime
96
96
97
-
BuckleScript runtime implementation is written in pure OCaml with some raw JS code embedded (`jscomp/runtime` directory).
97
+
Our runtime implementation is written in pure OCaml with some raw JS code embedded (`jscomp/runtime` directory).
98
98
99
99
The goal is to implement the runtime **purely in OCaml**. This includes removing all existing occurrences of embedded raw JS code as well, and you can help!
100
100
@@ -138,11 +138,11 @@ This is usually the file you want to create to test certain compile behavior wit
138
138
139
139
## Contribute to the BS Playground Bundle
140
140
141
-
> Note: These instructions are designed for building the 4.06 based version of BuckleScript (BS v6).
141
+
> Note: These instructions are designed for building the 4.06 based version of ReScript (ReScript v6).
142
142
143
-
The "BuckleScript Playground bundle" is the BS compiler compiled to JavaScript, including all necessary dependency files (stdlib / belt etc). It is useful for building tools where you want to compile and execute arbitrary Reason / OCaml in the browser.
143
+
The "Playground bundle" is the BS compiler compiled to JavaScript, including all necessary dependency files (stdlib / belt etc). It is useful for building tools where you want to compile and execute arbitrary Reason / OCaml in the browser.
144
144
145
-
The BuckleScript source code is compiled with a tool called [JSOO (js_of_ocaml)](https://ocsigen.org/js_of_ocaml/3.5.1/manual/overview), which uses OCaml bytecode to compile to JavaScript and is part of the bigger OCaml ecosystem. Before we can compile anything, we need to install the required tools (requires [`opam`](https://opam.ocaml.org/doc/Install.html) to be installed):
145
+
The ReScript source code is compiled with a tool called [JSOO (js_of_ocaml)](https://ocsigen.org/js_of_ocaml/3.5.1/manual/overview), which uses OCaml bytecode to compile to JavaScript and is part of the bigger OCaml ecosystem. Before we can compile anything, we need to install the required tools (requires [`opam`](https://opam.ocaml.org/doc/Install.html) to be installed):
146
146
147
147
```sh
148
148
# Create the right switch, if not created yet (first install)
@@ -163,7 +163,7 @@ The entry point of the JSOO bundle is located in `jscomp/main/jsoo_main.ml` and
163
163
# We create a target directory for storing the bundle / stdlib files
164
164
mkdir playground && mkdir playground/stdlib
165
165
166
-
# We build the BuckleScript source code and also the bytecode for jsoo_main.ml
166
+
# We build the ReScript source code and also the bytecode for jsoo_main.ml
# Now we run the repl.js script pointing to our playground directory (note how it needs to be relative to the repl.js file)
@@ -174,8 +174,8 @@ _Troubleshooting: if ninja build step failed with `Error: cannot find file '+run
174
174
175
175
**You should now find following files:**
176
176
177
-
-`playground/exports.js` -> This is the BuckleScript compiler, which binds the BuckleScript API to the `window` object.
178
-
-`playground/stdlib/*.js` -> All the BuckleScript runtime files.
177
+
-`playground/exports.js` -> This is the ReScript compiler, which binds the ReScript API to the `window` object.
178
+
-`playground/stdlib/*.js` -> All the ReScript runtime files.
179
179
180
180
You can now use the `exports.js` file either directly by using a `<script src="/path/to/exports.js"/>` inside a html file, use a browser bundler infrastructure to optimize it, or you can even use it with `nodejs`:
181
181
@@ -206,7 +206,7 @@ For each compile every successful operation will return `{js_code: string}`. On
206
206
207
207
### Working on the Playground JS API
208
208
209
-
Whenever you are modifying any files in the BuckleScript compiler, or in the `jsoo_main.ml` file, you'll need to rebuild the source and recreate the JS bundle.
209
+
Whenever you are modifying any files in the ReScript compiler, or in the `jsoo_main.ml` file, you'll need to rebuild the source and recreate the JS bundle.
A `.cmj` file contains compile information and JS package information of BuckleScript build artifacts (your `.re / .ml` modules) and are generated on build (`scripts/ninja.js build`).
218
+
A `.cmj` file contains compile information and JS package information of ReScript build artifacts (your `.re / .ml` modules) and are generated on build (`scripts/ninja.js build`).
219
219
220
220
A `.cmi` file is an [OCaml originated file extension](https://waleedkhan.name/blog/ocaml-file-extensions/) and contains all interface information of a certain module without any implementation.
221
221
222
222
In this repo, these files usually sit right next to each compiled `.ml` / `.re` file. The structure of a `.cmj` file is defined in [js_cmj_format.ml](jscomp/core/js_cmj_format.ml). You can run a tool called `./jscomp/bin/cmjdump.exe [some-file.cmj]` to inspect the contents of given `.cmj` file.
223
223
224
-
`.cmj` files are required for making BuckleScript compile modules (this includes modules like ReasonReact). BuckleScript includes a subset of modules by default, which can be found in `jscomp/stdlib-406` and `jscomp/others`. You can also find those modules listed in the `jsoo` call in `scripts/repl.js`. As you probably noticed, the generated `playground` files are all plain `.js`, so how are the `cmj` / `cmi` files embedded?
224
+
`.cmj` files are required for making ReScript compile modules (this includes modules like ReasonReact). ReScript includes a subset of modules by default, which can be found in `jscomp/stdlib-406` and `jscomp/others`. You can also find those modules listed in the `jsoo` call in `scripts/repl.js`. As you probably noticed, the generated `playground` files are all plain `.js`, so how are the `cmj` / `cmi` files embedded?
225
225
226
-
`repl.js` calls an executable called `cmjbrowser.exe` on every build, which is a compile artifact from `jscomp/main/jscmj_main.ml`. It is used to serialize `cmj` / `cmi` artifacts into two files called `jscomp/core/js_cmj_datasets.ml`. These files are only linked for the browser target, where BuckleScript doesn't have access to the filesystem. When working on BS, you'll see diffs on those files whenever there are changes on core modules, e.g. stdlib modules or when the ocaml version was changed. We usually check in these files to keep it in sync with the most recent compiler implementation. JSOO will pick up those files to encode them into the `exports.js` bundle.
226
+
`repl.js` calls an executable called `cmjbrowser.exe` on every build, which is a compile artifact from `jscomp/main/jscmj_main.ml`. It is used to serialize `cmj` / `cmi` artifacts into two files called `jscomp/core/js_cmj_datasets.ml`. These files are only linked for the browser target, where ReScript doesn't have access to the filesystem. When working on BS, you'll see diffs on those files whenever there are changes on core modules, e.g. stdlib modules or when the ocaml version was changed. We usually check in these files to keep it in sync with the most recent compiler implementation. JSOO will pick up those files to encode them into the `exports.js` bundle.
227
227
228
228
For any other dependency needed in the playground, such as `ReasonReact`, you will be required to serialize your `.cmi` / `.cmt` files accordingly from binary to hex encoded strings so that BS Playground's `ocaml.load` function can load the data. Right now we don't provide any instructions inside here yet, but [here's how the official ReasonML playground did it](https://github.com/reasonml/reasonml.github.io/blob/source/website/setupSomeArtifacts.js#L65).
229
229
@@ -259,7 +259,7 @@ Note that there is one design goal to keep in mind, never introduce any meaningl
259
259
260
260
## Contribution Licensing
261
261
262
-
Since BuckleScript is distributed under the terms of the [LGPL Version 3](LICENSE), contributions that you make are licensed under the same terms. In order for us to be able to accept your contributions, we will need explicit confirmation from you that you are able and willing to provide them under these terms, and the mechanism we use to do this is called a Developer's Certificate of Origin [DCO](DCO.md). This is very similar to the process used by the Linux(R) kernel, Samba, and many other major open source projects.
262
+
Since ReScript is distributed under the terms of the [LGPL Version 3](LICENSE), contributions that you make are licensed under the same terms. In order for us to be able to accept your contributions, we will need explicit confirmation from you that you are able and willing to provide them under these terms, and the mechanism we use to do this is called a Developer's Certificate of Origin [DCO](DCO.md). This is very similar to the process used by the Linux(R) kernel, Samba, and many other major open source projects.
263
263
264
264
To participate under these terms, all that you must do is include a line like the following as the last line of the commit message for each commit in your contribution:
0 commit comments