fast javascript bundler :package:

Overview

Fast JavaScript Bundler

Compile and test https://fjbundler.com

What?

It is what it says it is.
However, this bundler aims to be a monolithic does-it-all type of bundler; with zero configuration needed. (however, optional configuration will be supported)

Philosophy

  1. A bundler should not need excessive attention.
  2. A bundler should not get in the way of a developers workflow.
  3. A bundler should be fast.
  4. A bundler should not be written in JavaScript / Node.
  5. Commonly used features among JS developers should be supported out of the box.
  6. The output of the bundler should work everywhere. (to an extent which is possible of course)

More About the Philosophy

Output formats

Most bundlers allows you to select an output format of the code, such as:

"CommonJS", "AMD", "System", "UMD", "ES6", "ES2015" or "ESNext"

FJB does not implement this concept.
Instead, FJB adapts the code automatically through static analysis.
FJB aims to generate code that works everywhere (when possible).
A bundler should be smart enough so that the developer can focus on other things. 🧠

How does one use it?

fjb index.js -o dist.js

Features

  • Being fast
  • ES6 module imports / exports
  • Aliased imports
  • Wildcard imports
  • JSX support
  • TypeScript support (currently unstable and under development)
  • Importing JSON
  • Importing CSS
  • Importing & transpiling SCSS
  • Automatic JSX format detection
  • Plugin support
  • Removing dead code (Tree shaking)
  • Supports package.json
  • Watchdog (--watch)

Planned Features

  • Lazy imports

Example

Below is an example of some code that is 100% supported.
(Without any plugins or configuration)

For more examples, have a look at:

Benchmarks πŸš€

To see benchmarks, have a look at benchmarks.md πŸ”₯
You can also view them over at https://fjbundler.com

Installing the easy way

Using apt

The easiest way to install FJB is to head over to releases and download a .deb file that suits you.
Then you can simply run:

sudo apt install ./<filename>.deb

Installing the complicated way

Dependencies

To build fjb you will need the following:

  1. A C compiler (I would suggest gcc)
  2. Git

Steps to Install πŸ”§

Compiling it

  1. Clone down the repository
  2. Run:
./build.sh

This step will generate a fjb.out executable file.
You can start using this right away. 🎩

Installing globally

To continue and install fjb globally: Run:

make install

Also make sure you add $HOME/.local/bin to your PATH.
https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path

Questions and Answers ❓

How fast is it?

Have a look at benchmarks.md πŸ”₯

How serious is this?

Not sure, it's just a hobby project at this point.

Why are you making this?

Frustration, frustration with existing tools.
The existing alternatives are not fast enough, and gets in the way a bit more than they should.

Is it mature enough to use it with React?

You can definitely bundle React apps with FJB.
However, there might be some missing features / bugs since the JSX implementation in FJB is pretty new.
You can see a working React example here

Should I use it?

I will not encourage anyone to use it, but feel free to do it.

Does it work on Linux?

Yes

Does it work on Windows?

Probably not, but feel free to make a pull-request with the required changes for it to work.

Does it work on MacOS?

Probably. I haven't tried it, but I would definitely think so.

Can I contribute?

Yes you can. Simply fork it and start making pull-requests.

How do I create a plugin for it?

Have a look at this guide

Will you add support for writing plugins in JavaScript?

No. I don't think JavaScript belongs in a bundler.
The reason why most bundlers today are slow, is because they are written in JavaScript.

What if I find a bug?

If you find a bug, please report it here: https://github.com/sebbekarlsson/fjb/issues

Does it support TypeScript?

Yes, but this feature is under development... so expect bugs.

How do I change the JSX format?

There's no need to worry about that, FJB knows if you're using React or not, and automatically takes care of it for you.

What license is FJB under?

GPL-3.0, LICENSE.md

I'm having problems installing FJB

Feel free to create an issue here, and I'll be able to help you.

Can I become a collaborator?

I would prefer if you make pull-requests through forking at first.
Once I've seen that you've made valuable contributions, you might be able to be added as a collaborator.

You might also like...
Fast Binary Encoding is ultra fast and universal serialization solution for C++, C#, Go, Java, JavaScript, Kotlin, Python, Ruby, Swift

Fast Binary Encoding (FBE) Fast Binary Encoding allows to describe any domain models, business objects, complex data structures, client/server request

Spack is a package manager, and package managers should be trivial to install.

πŸ”‹ Spack with batteries included (linux/x86_64) Spack is a package manager, and package managers should be trivial to install. This repo offers a sing

BakePKG is a package archive that can install itself without without a package manager.

BakePKG A bad way of packaging applications. Introduction BakePKG is a package archive that can install itself without without a package manager. The

A fast algorithm for finding the pole of inaccessibility of a polygon (in JavaScript and C++)
A fast algorithm for finding the pole of inaccessibility of a polygon (in JavaScript and C++)

A fast algorithm for finding polygon pole of inaccessibility, the most distant internal point from the polygon outline (not to be confused with centroid), implemented as a JavaScript library. Useful for optimal placement of a text label on a polygon.

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more

Apache MXNet (incubating) for Deep Learning Apache MXNet is a deep learning framework designed for both efficiency and flexibility. It allows you to m

C++ promise/A+ library in Javascript style.

C++ promise/A+ library in Javascript style. C++ promise/A+ library in Javascript style. What is promise-cpp ? Examples Examples list Compiler required

🎡 Music notation engraving library for MEI with MusicXML and Humdrum support and various toolkits (JavaScript, Python)
🎡 Music notation engraving library for MEI with MusicXML and Humdrum support and various toolkits (JavaScript, Python)

Verovio is a fast, portable and lightweight library for engraving Music Encoding Initiative (MEI) digital scores into SVG images. Verovio also contain

Comprehensive RPC framework with support for C++, C#, Java, JavaScript, Python and more.

Ice - Comprehensive RPC Framework Ice helps you network your software with minimal effort. By taking care of all interactions with low-level network p

Duktape - embeddable Javascript engine with a focus on portability and compact footprint

Duktape ⚠️ Master branch is undergoing incompatible changes for Duktape 3.x. To track Duktape 2.x, follow the v2-maintenance branch. Introduction Dukt

:sparkles: Magical headers that make your C++ library accessible from JavaScript :rocket:
:sparkles: Magical headers that make your C++ library accessible from JavaScript :rocket:

Quick start | Requirements | Features | User guide | Contributing | License nbind is a set of headers that make your C++11 library accessible from Jav

Embedded JavaScript engine for C/C++

V7: Embedded JavaScript engine NOTE: this project is deprecated in favor of https://github.com/cesanta/mjs V7 is the smallest JavaScript engine writte

ChakraCore is an open source Javascript engine with a C API.

ChakraCore ChakraCore is a Javascript engine with a C API you can use to add support for Javascript to any C or C compatible project. It can be compil

CommonMark spec, with reference implementations in C and JavaScript

CommonMark CommonMark is a rationalized version of Markdown syntax, with a spec and BSD-licensed reference implementations in C and JavaScript. Try it

Structy is an irresponsibly dumb and simple struct serialization/deserialization library for C, Python, and vanilla JavaScript.

Structy Structy is an irresponsibly dumb and simple struct serialization/deserialization library for C, Python, and vanilla JavaScript. You can think

πŸ₯‘ ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.
πŸ₯‘ ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.

πŸ₯‘ ArangoDB is a native multi-model database with flexible data models for documents, graphs, and key-values. Build high performance applications using a convenient SQL-like query language or JavaScript extensions.

DeskGap is a framework for building cross-platform desktop apps with web technologies (JavaScript, HTML and CSS).
DeskGap is a framework for building cross-platform desktop apps with web technologies (JavaScript, HTML and CSS).

A cross-platform desktop app framework based on Node.js and the system webview

Alternative LAZ implementation for C++ and JavaScript

What is this? Alternative LAZ implementation. It supports compilation and usage in JavaScript, usage in database contexts such as pgpointcloud and Ora

Elk is a tiny embeddable JavaScript engine that implements a small but usable subset of ES6
Elk is a tiny embeddable JavaScript engine that implements a small but usable subset of ES6

Elk is a tiny embeddable JavaScript engine that implements a small but usable subset of ES6. It is designed for microcontroller development. Instead of writing firmware code in C/C++, Elk allows to develop in JavaScript. Another use case is providing customers with a secure, protected scripting environment for product customisation.

LLVM bindings for Node.js/JavaScript/TypeScript

llvm-bindings LLVM bindings for Node.js/JavaScript/TypeScript Supported OS macOS Ubuntu Windows Supported LLVM methods listed in the TypeScript defini

Comments
  • Noticed is slower when importing a library

    Noticed is slower when importing a library

    https://github.com/sebbekarlsson/fjb/blame/master/benchmarks.md#L436

    Could you explain why this would not be a draw back?

    Wouldn't importing be something most people would be doing?

    opened by nrgapple 3
  • Be able to change JSX format

    Be able to change JSX format

    Right now, the JSX is transpiled into native DOM createElement calls. We should implement an option for the bundler to use, react-jsx instead for example.

    feature 
    opened by sebbekarlsson 3
  • Add support for custom JSX tags

    Add support for custom JSX tags

    This does currently not work.

    const mycustom = (name) => <p>{name}</p>;
    
    const card = (name) => (
      <div style={style} title={name}>
        <mycustom name={name}/>
      </div>
    );
    
    feature 
    opened by sebbekarlsson 1
  • add support for classes

    add support for classes

    [email protected]:~/workspace/fjb$ cat test.js
    class Hello {
      constructor() {
        console.log(123);
      }
    }
    [email protected]:~/workspace/fjb$ ./fjb.out test.js
    /* IMPORTED FROM `test.js` */
    class;Hello;/*scope*/{constructor();/*scope*/{console . log(123);}}
    

    Pretty broken right now

    opened by sebbekarlsson 1
Releases(fjb_0.1-0-amd64-linux)
Owner
Sebastian Karlsson
Sebastian Karlsson
raylib Nuget package

raylib Nuget package This is a Nuget package for the popular raylib video game programming library. Resources used to create this package are as follo

Samuel Gomes 6 Dec 5, 2022
Standards compliant, fast, secure markdown processing library in C

Hoedown Hoedown is a revived fork of Sundown, the Markdown parser based on the original code of the Upskirt library by Natacha PortΓ©. Features Fully s

Hoedown 923 Dec 27, 2022
Fast comparison-based sort algorithm

nanosort Algorithm nanosort aims to be a fast comparison-based sorting algorithm, tuned for POD types of reasonably small sizes. nanosort implements a

Arseny Kapoulkine 40 Dec 29, 2022
A fast phone number lib for Ruby (binds to Google's C++ libphonenumber)

MiniPhone A Ruby gem which plugs directly into Google's native C++ libphonenumber for extremely fast and robust phone number parsing, validation, and

Ian Ker-Seymer 148 Dec 28, 2022
A fast image processing library with low memory needs.

libvips : an image processing library Introduction libvips is a demand-driven, horizontally threaded image processing library. Compared to similar lib

libvips 7.5k Dec 29, 2022
Tau is a fast syntax highlighter capable of emitting HTML.

tau - a reasonably fast (wip) syntax highlighter. Tau is a fast syntax highlighter capable of emitting HTML. It highlights the following languages: py

Palaiologos 12 Nov 16, 2022
A fast character conversion and transliteration library based on the scheme defined for Japan National Tax Agency (ε›½η¨ŽεΊ) 's corporate number (法人η•ͺ号) system.

jntajis-python Documentation: https://jntajis-python.readthedocs.io/ What's JNTAJIS-python? JNTAJIS-python is a transliteration library, specifically

Open Collector, Inc. 15 Nov 12, 2022
Very fast Markdown parser and HTML generator implemented in WebAssembly, based on md4c

Very fast Markdown parser and HTML generator implemented in WebAssembly, based on md4c

Rasmus 1.3k Dec 24, 2022
The goal of insidesp is to do fast point in polygon classification, the sp way.

insidesp The goal of insidesp is to do fast point in polygon classification, the sp way. We are comparing a few ways of implementing this, essentially

diminutive 2 Nov 12, 2021
Fast regular expression grep for source code with incremental index updates

Fast regular expression grep for source code with incremental index updates

Arseny Kapoulkine 261 Dec 28, 2022