Development Guide
QuickJS-ng is an open-source JavaScript engine that welcomes contributions from the community. This guide will help you get started with contributing to the project.Getting Started
Prerequisites
- Git
- CMake 3.x or higher
- A C compiler (GCC, Clang, MSVC, or TCC)
- Make (on Unix-like systems)
Cloning the Repository
Building QuickJS-ng
Quick Build
The simplest way to build QuickJS-ng is using the helper Makefile:qjs and qjsc executables and other test tools.
Debug Build
For development, you’ll want to create a debug build without optimizations:Manual CMake Build
If you prefer to use CMake directly (required on Windows):Contribution Workflow
git clone https://github.com/YOUR_USERNAME/quickjs.git
cd quickjs
git remote add upstream https://github.com/quickjs-ng/quickjs.git
Development Tools
Code Generation
If you modify bytecode or built-in modules, regenerate the generated code:Syntax Checking
Verify that generated C code compiles correctly:C++ Compatibility
Test that the codebase compiles as C++:Statistics
View engine statistics and memory usage:Build Options
Amalgamated Build
Create a single-file amalgamated build:quickjs-amalgam.zip containing a single quickjs-amalgam.c file.
Shared Libraries
Build shared libraries instead of static:Examples
Build with examples enabled:Sanitizers
Address Sanitizer (ASan) and Undefined Behavior Sanitizer (UBSan)
Memory Sanitizer (MSan)
CI/CD
QuickJS-ng uses GitHub Actions for continuous integration. The CI pipeline tests:- Multiple platforms: Linux, macOS, Windows, FreeBSD, OpenBSD
- Multiple compilers: GCC, Clang, MSVC, TCC, MinGW
- Multiple architectures: x86, x64, ARM64, RISC-V, s390x
- Sanitizers: ASan, UBSan, MSan
- Special builds: Emscripten, WASI, Android, iOS
- Test262 compliance suite
Coding Guidelines
- Follow the existing code style and conventions
- Write clear, self-documenting code with comments where necessary
- Add tests for new features and bug fixes
- Ensure all tests pass before submitting a pull request
- Keep commits focused and atomic
- Write descriptive commit messages
Getting Help
If you need help or have questions:- Check the project documentation
- Open an issue on GitHub for bugs or feature requests
- Review existing issues and pull requests for similar topics