All Projects → vincentdchan → Jetpack.js

vincentdchan / Jetpack.js

Licence: mit
A ECMAScript bundler and minifier implemented in C++ aimed at excellent performance.

Programming Languages

javascript
184084 projects - #8 most used programming language
cpp
1120 projects
ecmascript
72 projects

Projects that are alternatives of or similar to Jetpack.js

Cppast.codegen
An extensible library providing C# PInvoke codegen from C/C++ files for .NET
Stars: ✭ 65 (-13.33%)
Mutual labels:  parser
Solid
Liquid template engine in Elixir
Stars: ✭ 68 (-9.33%)
Mutual labels:  parser
Xmlparser
A low-level, pull-based, zero-allocation XML 1.0 parser.
Stars: ✭ 73 (-2.67%)
Mutual labels:  parser
Charly Vm
Fibers, Closures, C-Module System | NaN-boxing, bytecode-VM written in C++
Stars: ✭ 66 (-12%)
Mutual labels:  parser
Php Svg Lib
SVG file parsing / rendering library
Stars: ✭ 1,146 (+1428%)
Mutual labels:  parser
To.ml
OCaml library for TOML
Stars: ✭ 68 (-9.33%)
Mutual labels:  parser
Jekyll Minibundle
A minimalistic asset bundling plugin for Jekyll
Stars: ✭ 65 (-13.33%)
Mutual labels:  bundler
Sequential
An environment to visualize JavaScript code execution in a browser
Stars: ✭ 74 (-1.33%)
Mutual labels:  parser
Oga
Read-only mirror of https://gitlab.com/yorickpeterse/oga
Stars: ✭ 1,147 (+1429.33%)
Mutual labels:  parser
Gw2 Elite Insights Parser
Binary parser for the .evtc files that arcdps generates after a boss encounter. This will generate a .html file where the results can be easily reviewed.
Stars: ✭ 73 (-2.67%)
Mutual labels:  parser
Neuron.js
A Full Feature CommonJS Module Manager, Dependency Graph Handler and Loader for Browsers
Stars: ✭ 66 (-12%)
Mutual labels:  bundler
Atoma
Atom, RSS and JSON feed parser for Python 3
Stars: ✭ 67 (-10.67%)
Mutual labels:  parser
Ret.js
Tokenizes a string that represents a regular expression.
Stars: ✭ 70 (-6.67%)
Mutual labels:  parser
Parser Javascript
Browser sniffing gone too far — A useragent parser library for JavaScript
Stars: ✭ 66 (-12%)
Mutual labels:  parser
Method log
Trace the history of an individual method in a git repository (experimental)
Stars: ✭ 73 (-2.67%)
Mutual labels:  parser
Csvparser
C++ parser for CSV file format
Stars: ✭ 65 (-13.33%)
Mutual labels:  parser
Anglesharp.js
👼 Extends AngleSharp with a .NET-based JavaScript engine.
Stars: ✭ 68 (-9.33%)
Mutual labels:  parser
Any23
Apache Anything To Triples (Any23) is a library, a web service and a command line tool that extracts structured data in RDF format from a variety of Web documents.
Stars: ✭ 74 (-1.33%)
Mutual labels:  parser
Parser
Generate a JSON documentation for a SFC Vue component. Contribute: https://gitlab.com/vuedoc/parser#contribute
Stars: ✭ 74 (-1.33%)
Mutual labels:  parser
Parsing With Haskell Parser Combinators
🔍 A step-by-step guide to parsing using Haskell parser combinators.
Stars: ✭ 72 (-4%)
Mutual labels:  parser

Jetpack++

jetpack.js is an extremely fast js bundler and minifier.

jetpack.js a well designed tool. It's modulize into parser and bundler. The parser can be used as a library independently.

Why

Several months ago, I wrote a js parser in C++. Many parsers embedded in other js engine have a lot of dependencies on their runtime. It's very hard to separate them. So I decided to write my own parser. After I finished, I found my parser is almost 10x faster than the common parsers running on Node.js (without heating). But I didn't move on after that. This year(2020), Evan Wallace's project esbuild inspires me. So I decided to write a bundler in C++.

Features

Parser

  • Can be used standalone
  • Implemented in C++ with excellent performance
  • Full support for ECMAScript 2017(ECMA-262 8th Edition)
  • JSON output of sensible syntax tree format as standardized by ESTree project
  • Experimental support for JSX, a syntax extension for React
  • Syntax node location (index-based and line-column)
  • Friendly error message

Bundler

  • Module resolution.
  • Bundle a ES project into a single file.
  • Scope hoisting.
  • Contant folding.
  • Minify the code.

Installation

npm install -g jetpackpp

Or

yarn global add jetpackpp

Usage

Use command line to bundle a js module.

jetpack main.js --out bundle.js

Help command:

$ jetpackpp --help

$ Jetpack++ command line
Usage:
  Jetpack++ [OPTION...] positional parameters

      --tolerant            tolerant parsing error
      --jsx                 support jsx syntax
      --help                produce help message
      --analyze-module arg  analyze a module and print result
      --no-trace            do not trace ref file when analyze module
      --minify              minify the code
      --out arg             output filename of bundle

Use the parser as a standalone library

jetpack.js is built with CMake, so it can be easily integrated to your project.

add_subdirectory(js-parser)
target_include_directories(${PROJECT_NAME} ./js-parser/src)
target_link_libraries(${PROJECT_NAME} PUBLIC js-parser)

Performance

I do the same benchmark provided by esbuild.

My main benchmark approximates a large codebase by duplicating the three.js library 10 times and building a single bundle from scratch, without any caches. For this benchmark, esbuild is 10-100x faster than the other JavaScript bundlers I tested (Webpack, Rollup, Parcel, and FuseBox). The benchmark can be run with make bench-three.

The tests were done on a 6-core 2018 MacBook Pro with 16GB of RAM (similar to esbuild).

Architecture

The code are well commented, please read the code.

Platform

jetpack.js supports all popular system including:

  • macOS
  • Windows 64bit
  • Linux 64bit
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].