Skip to content

Commit e3da4fe

Browse files
committed
Fix bullet points
Apparently having new lines between points count as new bullets
1 parent e68c547 commit e3da4fe

19 files changed

+5
-45
lines changed

docs/build-advanced.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ You might use some pre-processor to generate boilerplate code during development
1010
**Note**: pre-processors can be classified as two categories:
1111

1212
- System-dependent, which should be delayed until running on user machines.
13-
1413
- System-independent: lex, yacc, m4, re2c, etc, which can be executed any time.
1514

1615
BS has built in support for [conditional compilation](conditional-compilation.md), which satisfies the first point. This section is about the second point.

docs/build-configuration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ Output to either CommonJS, ES6 modules or AMD. Example:
9696
```
9797

9898
- `"module": "es6-global"` resolves `node_modules` using relative paths. Good for development-time usage of ES6 in conjunction with browsers like Safari and Firefox that support ES6 modules today. No more dev-time bundling!
99-
10099
- `"in-source": true` generates output alongside source files, instead of by default isolating them into `lib/js`. The output directory is otherwise not configurable.
101100

102101
### suffix

docs/build-performance.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ We've stress-tested bsb on a big project of 10,000 files (100 directories with 1
3939
<!-- TODO: better repro -->
4040

4141
- No-op build of 10k files: `440ms` (unfortunately, that's the minimum amount of time required to check the mtimes of 10k files. But maybe we can cleverly optimize this in the future).
42-
4342
- Clean build: 5 minutes.
44-
4543
- Incremental build: depends on the file, but should be under `1s` unless it has lots of dependents.
4644

4745
## Incrementality
@@ -61,9 +59,7 @@ OCaml/BuckleScript/Reason uses the concept of interface files (`.mli` or `.rei`)
6159
Unfortunately, JS build systems are usually the bottleneck for building a JS project nowadays. Having part of the build finishes blazingly fast doesn't matter much if the rest of the build takes seconds or literally minutes. Here are a few suggestions:
6260

6361
- Convert more files into BuckleScript/Reason =). Fewer files going through fewer parts of the JS pipeline helps a ton.
64-
6562
- Careful with bringing in more dependencies: libraries, syntax transforms, build step loaders, etc. The bulk of these dragging down the editing & building experience might out-weight the API benefits they provide.
66-
6763
- Wait for us to create our own super fast linker (aka bundler).
6864

6965
## Hot Reloading

docs/community.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ BuckleScript and [Reason](https://reasonml.github.io/) are sister projects. The
88
Come say hi!
99

1010
- [Discord](https://discord.gg/reasonml)
11-
1211
- [Stack Overflow](http://stackoverflow.com/questions/tagged/bucklescript)

docs/comparison-to-jsoo.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ Js_of_ocaml is a popular compiler which compiles OCaml’s bytecode into JavaScr
88
However, there are a few areas that BuckleScript approaches differently:
99

1010
- Js_of_ocaml takes low-level bytecode from OCaml compiler, BuckleScript takes the high-level rawlambda representation from OCaml compiler.
11-
1211
- Js_of_ocaml focuses more on existing OCaml ecosystem (OPAM) while BuckleScript’s major goal is to target NPM/Yarn and existing JS workflows.
13-
1412
- Js_of_ocaml and BuckleScript have slightly different runtime encoding in several places. For example, BuckleScript encodes OCaml Array as JS Array while js_of_ocaml requires its index 0 to be of value 0.
1513

1614
See also the [What & Why](what-why.md) page for more info on BuckleScript's emphasis.

docs/conditional-compilation.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ People used to use preprocessors like [C preprocessor](http://tigcc.ticalc.org/d
1010
Instead of a preprocessor, BuckleScript adds language-level static `if` compilation. It's less powerful than other preprocessors since it only supports static `if` (no `#define`, `#undefine`, `#include`), but there are several advantages.
1111

1212
- It’s tiny (only ~500 lines) and highly efficient. Everything can be done in a **single pass**. It's easy to rebuild the pre-processor into a standalone file, with no dependencies on compiler libs, to back-port it to old OCaml compilers.
13-
1413
- It’s purely functional and type-safe, and cooperates with editor tooling like Merlin.
1514

1615
**Note**: BuckleScript's conditional compilation doesn't work with Reason yet.
@@ -104,13 +103,9 @@ atom
104103
## Typing Rules
105104

106105
- type of INT is `int`
107-
108106
- type of STRING is `string`
109-
110107
- type of FLOAT is `float`
111-
112108
- value of UIDENT comes from either built-in values (with documented types) or an environment variable, if it is literally `true`, `false` then it is `bool`, else if it is parsable by `int_of_string` then it is of type int, else if it is parsable by `float_of_string` then it is float, otherwise it would be string
113-
114109
- In `lhs operator rhs`, `lhs` and `rhs` are always the same type and return boolean. `=~` is a semantic version operator which requires both sides to be string.
115110

116111
Evaluation rules are obvious. `=~` respect semantic version, for example, the underlying engine

docs/difference-from-native-ocaml.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ OCaml’s weak map is not available in BuckleScript. The weak pointer is replace
2626
OCaml has `int`, `int32`, `nativeint` and `int64` types.
2727

2828
- Both `int32` and `int64` in BuckleScript have the exact same semantics as OCaml.
29-
3029
- `int` in BuckleScript is the same as `int32` while in OCaml it’s platform dependent.
31-
3230
- `nativeint` is treated as JavaScript float, except for division. For example, `Nativeint.div a b` will be translated into `a / b | 0`.
3331

3432
**Note**: `Nativeint.shift_right_logical x 0` is different from `Int32.shift_right_local x 0`. The former is literally translated into `x >>> 0` (translated into an unsigned int), while the latter is `x | 0`.

docs/function.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ Fs.readFileSync("xx.txt", "ascii");
272272
```
273273

274274
- Attaching `[@bs.string]` to the whole poly variant type makes its constructor compile to a string of the same name.
275-
276275
- Attaching a `[@bs.as "foo"]` to a constructor lets you customize the final string.
277276

278277
And now, passing something like `"myOwnUnicode"` or other variant constructor names to `readFileSync` would correctly error.
@@ -500,9 +499,7 @@ This is an uncurried bucklescript function. It must be applied with [@bs].
500499
The above solution is safe, guaranteed, and performant, but sometimes visually a little burdensome. We provide an alternative solution if:
501500

502501
- you're binding with `external`
503-
504502
- the `external` function takes in an argument that's another function
505-
506503
- you want the user not to need to annotate the call sites with `[@bs]`
507504

508505
<!-- TODO: is this up-to-date info? -->

docs/generate-converters-accessors.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ type action =
3030
Variants constructors with payloads generate functions, payload-less constructors generate plain integers. **Note**:
3131

3232
- The generated accessors are lower-cased.
33-
3433
- You can now use these helpers on the JavaScript side! But don't rely on their actual values please.
35-
3634
- Doesn't work with polymorphic variants yet.
3735

3836
Output:
@@ -66,7 +64,6 @@ let s = submit("hello"); /* gives Submit("hello") */
6664
This is useful:
6765

6866
- When you're passing the accessor function as a higher-order function (which plain variant constructors aren't).
69-
7067
- When you'd like the JS side to use these values & functions opaquely and pass you back a variant constructor (since JS has no such thing).
7168

7269
## Convert Between `Js.t` Object and Record

docs/interop-with-js-build-systems.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ The JS ecosystem uses a few build systems: [browserify](http://browserify.org/),
1212
BuckleScript and bsb only take care of the compilation step; it maps one ml/re/mli/rei file into one JS output file. As such, in theory, no build system integration is needed from our side. From e.g. the webpack watcher's perspective, the JS files BuckleScript generates are almost equivalent to your hand-written JS files. We also recommend that you initially check in those BS-generated JS files, as this workflow means:
1313

1414
- You can introduce BuckleScript and/or Reason silently into your codebase without disturbing existing build infra.
15-
1615
- You have a visual diff of the performance & correctness of your JS file when you update the ml/re files and the JS artifacts change.
17-
1816
- You can let teammates hot-patch the JS files in emergency situations, without needing to first start learning BS/Reason.
19-
2017
- You can remove BuckleScript and Reason completely from your codebase and things will still work (in case your company decides to stop using us for whatever reason).
2118

2219
The slight disavantage of such approach is that you need to keep both a bsb watcher and a webpack watcher open. Though if you activate [VSCode-Reasonml's bsb feature](https://github.com/reasonml-editor/vscode-reasonml#bsb), you avoid the former rather seamlessly.
@@ -40,7 +37,6 @@ You can make BS JS files look even more idiomatic through the in-source + bs suf
4037
This will:
4138

4239
- Generate the JS files alongside your BS source files.
43-
4440
- Use the file extension `.bs.js`, so that you can require these files on the JS side through `require('./MyFile.bs')`, without needing a loader.
4541

4642
## Use Loaders on BS Side

docs/object.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ BS splits the many overloaded usage of JS objects into distinct categories, for
1212
Up until recently, where JS finally got proper Map support, objects have been used as a map. The characteristics of object-as-map are the following:
1313

1414
- contains values that are all of the same type
15-
1615
- might or might not add/remove arbitrary keys
17-
1816
- might or might not be accessed using a dynamic/computed key
1917

2018
If these points (especially the first one) describe your object usage, then look no further than using the [`Js.Dict`](https://bucklescript.github.io/bucklescript/api/Js.Dict.html) API! This is a thin layer of binding we've made for such situation. Under the hood, a `Js.Dict` is just an object, and the bindings are compiled away. No performance cost. Actually, **better** than no perf cost! See the Design Decisions below.
@@ -26,7 +24,6 @@ In this mode, you can do all the metaprogramming you're used to with JS objects:
2624
If your object:
2725

2826
- has a known number of fields
29-
3027
- might or might not contain values of heterogeneous types
3128

3229
Then you're really using it like a "record" in most languages. For example, think of the difference of use-case and intent between the object `{name: "John", age: 10, job: "CEO"}` and `{"John": 10, "Allison": 20, "Jimmy": 15}`.
@@ -287,9 +284,7 @@ If you don't want to work with `Js.t` objects and want to use idiomatic OCaml/Re
287284
When The two above modes of binding to objects fail, you can always fall back to this one. And sometimes this the **preferable** way of binding to objects, because it:
288285

289286
- deals with objects with potentially arbitrary shapes
290-
291287
- allows heterogeneous values
292-
293288
- allows hyphen in object keys
294289

295290
```ocaml

docs/try.md renamed to docs/playground.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
id: try
3-
title: Try
2+
id: playground
3+
title: Playground
44
---
55

66
You can try BuckleScript with both the OCaml and Reason syntax displayed side-by-side, with live JS output, in the [Reason Try page](https://reasonml.github.io/try/).

docs/roadmap.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ Some future plans are briefly discussed in the repo's [issues page](https://gith
1212
Wanna help?
1313

1414
- Help us translate the docs! Click on the translation symbol on the upper right.
15-
1615
- Improve the documentation and website.
17-
1816
- [Suggest better error messages for BuckleScript](https://github.com/reasonml-community/error-message-improvement/issues).
19-
2017
- Convert over the more things to BuckleScript! With the great interop, you can actually keep your JS library's API stable while provinding a better BuckleScript API.

docs/stdlib-overview.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@ BuckleScript is mostly just OCaml, so they share the same standard library. The
1010
In addition, we provide a few extra modules:
1111

1212
- `Dom`: contains DOM types. The DOM is very hard to bind to, so we've decided to only keep the types in the stdlib and let users bind to the subset of DOM they need downstream.
13-
1413
- `Node`: for node-specific APIs. Experimental; contribution welcome!
15-
1614
- `Js`: all the familiar JS APIs and modules are here! E.g. if you want to use the [JS Array API](https://bucklescript.github.io/bucklescript/api/Js.Array.html) over the [OCaml Array API](https://caml.inria.fr/pub/docs/manual-ocaml-4.02/libref/Array.html) because you're more familiar with the former, go ahead.

docs/what-why.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ Despite its clear advantages, JavaScript does present a few drawbacks. Here's ho
2828
BuckleScript's type system alone offers three major benefits:
2929

3030
- **Strong type inference**. Almost the entirely of the language can be inferred. You don't have to tediously write all the types manually. Feel free to still type out some parts for readability!
31-
3231
- **Sound type system**. "Sound" here means that the types _guarantee_ that they are what they are, not just 90% of the time. Once a BuckleScript project compiles, there are no runtime type errors. \*
33-
3432
- **Expressive type features**. With well-thought-out features like [variants](https://reasonml.github.io/guide/language/variant), [modules](https://reasonml.github.io/guide/language/module) and even an opt-in [object system](https://reasonml.github.io/guide/language/object), the types guide you through your iteration process and don't block you from expressing what you need.
3533

3634
The combination of these three highlights, along with other type system features, unlocks new workflow possibilities and is something existing gradual typing solutions for JavaScript don't offer.
@@ -43,7 +41,6 @@ The JavaScript ecosystem is very reliant on dependencies, and quite often many o
4341
levels:
4442

4543
- Function and module level code elimination is facilitated by the well-engineered type system and **purity analysis**.
46-
4744
- At the global level, BuckleScript generates code that are naturally friendly to dead code elimination done by bundling tools such as [Rollup](https://github.com/rollup/rollup) and [Closure Compiler](https://developers.google.com/closure/compiler/), after its own sophisticated elimination pass.
4845

4946
### Compile-time Optimizations

website/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ In the end, we spit out normal HTML, with all the JS dependencies (barring a few
1313
Two special files:
1414

1515
- `sidebars.json`: lists the sections.
16-
1716
- `siteConfig.json`: some header and i18n configs.
1817

1918
During your development, most changes will be picked up at each browser refresh. If you touch these two files, however, you'll have to kill & restart the server.

website/i18n/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
"nodejs-special-variables": "NodeJS Special Variables",
3838
"null-undefined-option": "Null, Undefined & Option",
3939
"object": "Object",
40+
"playground": "Playground",
4041
"regular-expression": "Regular Expression",
4142
"roadmap": "Roadmap & Contribution",
4243
"stdlib-overview": "Overview",
43-
"try": "Try",
4444
"typescript-support": "TypeScript Support",
4545
"use-existing-ocaml-libraries": "Use Existing OCaml Libraries",
4646
"what-why": "What & Why",

website/sidebars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"try-menu": {
4949
"Try": [
50-
"try",
50+
"playground",
5151
"load-third-party-libraries"
5252
]
5353
},

website/siteConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const siteConfig = {
7070
projectName: "bucklescript",
7171
headerLinks: [
7272
{ doc: "installation", label: "Docs" },
73-
{ doc: "try", label: "Try"},
73+
{ doc: "playground", label: "Try"},
7474
{ doc: "community", label: "Community" },
7575
{ blog: true, label: "Blog" },
7676
{ languages: true },

0 commit comments

Comments
 (0)