Skip to content

Commit

Permalink
Update readme on source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
7h3kk1d committed Aug 9, 2024
1 parent 2449be7 commit 458dd6c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,18 @@ helper functions for printing and serializing this data. For a type named `t`, t
for a type named something else like `q`, it will be `show_q`.

#### Source Maps
`js_of_ocaml` does support source maps and has some other flags that might be useful. If you experiment with those and get them to work, please update this README with some notes.
Source maps for `js_of_ocaml` should be configured when making locally with the dev profile (`make`). This is configured using the env stanzas present in the `dune` files for each top-level directory:
```dune
(env
(dev
(js_of_ocaml
(flags :standard --debuginfo --noinline --dynlink --linkall --sourcemap)))
(release
(js_of_ocaml
(flags :standard))))
```

Since source maps are generated browser developer tools should show reason code in the debugger and source tree. Stack traces should also include reason line numbers.

#### Debug Mode
If Hazel is hanging on load or when you perform certain actions, you can load into Debug Mode by appending `#debug` to the URL and reloading. From there, you have some buttons that will change settings or reset local storage. Refresh without the `#debug` flag and hopefully you can resolve the situation from there.
Expand Down

0 comments on commit 458dd6c

Please sign in to comment.