package js_of_ocaml
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Compiler from OCaml bytecode to JavaScript
Install
dune-project
Dependency
Authors
Maintainers
Sources
js_of_ocaml-6.5.0.tbz
sha256=a991ce25175a5a13240c8bf64354b8f35e0a8d7223b90bef01ba32bc6f929cf4
sha512=ce476986cb2c78990f29b1d7a01bb173a0d30ad0e0a80ba7bde9aa8365952ed01eda4935d92a323b982b0c1c897b20ef01eabe75fe80e4da858f73f6a2d25232
doc/contribute.html
Contributing to Js_of_ocaml
Reporting issues
If you encounter a problem or have questions, please open a GitHub issue.
- Check if your issue has already been reported
- Include version information (
ocamlc -version,js_of_ocaml --version) - Describe the expected and actual behavior
- Provide a minimal reproducible example if possible
Development setup
Install dependencies
opam install --deps-only -t js_of_ocaml js_of_ocaml-lwt \ js_of_ocaml-compiler js_of_ocaml-toplevel js_of_ocaml-ppx \ js_of_ocaml-ppx_deriving_json js_of_ocaml-tyxml
Build
dune build @all
Pull requests
- Discuss significant changes in an issue first
- Fork the repository and create your branch from
master - Write tests for new code
- Ensure tests pass (
make tests) - Update
CHANGES.mdwith an entry describing your change
Code style
OCaml
Code is formatted with ocamlformat 0.29.0. Run before committing:
make fmt
JavaScript
JavaScript runtime files are formatted and linted with Biome:
make fmt-js make lint-js
Documentation
Code examples in the .mli doc-comments and the manual/ pages are checked by the test suite: OCaml code blocks are type-checked against the real API, so examples cannot silently drift out of sync. An illustrative snippet that is not meant to compile can be marked to be only syntax-checked, or skipped entirely. See manual/examples-check/ for the markers.
Testing
# Run all tests make tests # Run WebAssembly tests make tests-wasm # Run a specific test directory dune build @compiler/tests-jsoo/runtest dune build @compiler/tests-ocaml/runtest-js WASM_OF_OCAML=true dune build @compiler/tests-ocaml/runtest-wasm # Run javascript parser tests cd compiler/tests-js-parser git clone https://github.com/tc39/test262.git test262 dune build @runtest-parser # Update expected test output after intentional changes dune promote
Test directories:
compiler/tests-jsoo/- JavaScript and WebAssembly testscompiler/tests-wasm_of_ocaml/- JavaScript and WebAssembly testscompiler/tests-compiler/- Compiler unit testscompiler/tests-ocaml/- Tests from the OCaml compiler codebasecompiler/tests-full/- Full integration tests
Project structure
compiler/- Compiler implementationlib/- Core compiler librarylib-wasm/- WebAssembly backendbin-js_of_ocaml/- js_of_ocaml entry pointbin-wasm_of_ocaml/- wasm_of_ocaml entry point
lib/- Library packages (js_of_ocaml, lwt, tyxml bindings)ppx/- PPX syntax extensionsruntime/- JavaScript and WebAssembly runtime filestoplevel/- Web-based OCaml toplevelexamples/- Example projects
See also
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page