• Stars
    star
    103
  • Rank 333,046 (Top 7 %)
  • Language
    C
  • License
    GNU General Publi...
  • Created almost 4 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

fast javascript bundler ๐Ÿ“ฆ

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.

More Repositories

1

tac

tac x86 compiler
C
77
star
2

i3

i3 config
Shell
45
star
3

hello

For youtube
C
42
star
4

glms

Generalized Linear Model Script
C
42
star
5

gpp

General PreProcessor
C
27
star
6

NINAGE-Engine

๐Ÿ’ฟ Engine for interactive media & games
C++
21
star
7

typescript

typescript to C compiler
Python
16
star
8

PHPFlask

๐Ÿถ Flask for PHP
PHP
16
star
9

tscc

Typescript to C compiler (TSCC)
C
14
star
10

vpm

ViM Plugin Manager (like apt, npm, pacman, etc ... )
C
14
star
11

wscript

a complete rewrite of wscript.exe, for *NIX
C++
9
star
12

cengine

Game Engine Framework in C
C
8
star
13

fastjson

Fast JSON parsing library written in C
C
8
star
14

css

css parser (C)
CSS
6
star
15

ResourceManager

๐Ÿ‘œ C++ Resource Manager
C++
5
star
16

liblist

dynamic list for C
C
4
star
17

cellma

cell-based texteditor
C++
4
star
18

simple-pipe

๐Ÿšฟ Function Composition for Python
Python
4
star
19

paste-cms

https://github.com/sebbekarlsson/nilms
CSS
3
star
20

sjs

JS with superpowers
C
3
star
21

tinygl

Tiny OpenGL Example
C
3
star
22

lex

Simple lexer written in C
C
3
star
23

libjson

Simple C implementation of JSON, parse JSON in C.
C
3
star
24

b64

base64 encode / decode library for C
C
3
star
25

framescript

language that compiles to javascript with a built-in react-like framework
Python
3
star
26

plot

C++ plot library
C++
3
star
27

systemctl

โžฐ Lightweight systemctl clone
Python
3
star
28

cola

component language (component-based programming language)
C
3
star
29

rvfs

Read-only virtual file system
C
3
star
30

me

My website
HTML
2
star
31

demo-website

Python
2
star
32

state0

ignorant state management library
TypeScript
2
star
33

tictac

Tic Tac Toe HTML canvas game
TypeScript
2
star
34

new-flask-app

create a new flask application with this simple command
Python
2
star
35

assembly

Sharpening my assembly skills
Assembly
2
star
36

HCV

Create native windows and popup messages using HTML and CSS
C++
2
star
37

css-grid-piano

For students
CSS
2
star
38

download-website

download a whole website into a single directory
Shell
2
star
39

quickfind

Find files based on the name & content
C
2
star
40

EthelEngine

Game engine for Java using LWJGL
Java
2
star
41

Seaviver

Game Engine
Java
2
star
42

SpaceSpace

Game
Java
2
star
43

maze-generator

Maze generator in Python
Python
2
star
44

nilms

๐Ÿ“ A content management system with built-in on-sight page editing
CSS
2
star
45

stockholm-subway-samplepack

Samples from the Stockholm subway
2
star
46

hashmap

Generic hashmap
C
2
star
47

hemsida

en exempel-hemsida
HTML
2
star
48

stepzation

Javascript library for creating stepable guides, instructions and installations.
CSS
2
star
49

voxel

Voxel engine in C
C
2
star
50

BAD_DONT_USE_VBScript

(DEAD PROJECT) VBScript ported to GNU / Linux & other Unix-like systems
C++
2
star
51

physica

Physics simulation in C
C
1
star
52

smap

Source map parser in C
C
1
star
53

ianertson-emacs

my emacs config
Emacs Lisp
1
star
54

advent-of-code-2018

My advent of code submits
C
1
star
55

spreadsheet

Simple React Spreadsheet webapp
TypeScript
1
star
56

matrix

tiny matrix translation library for C
C
1
star
57

css-minmax-grid

For students
HTML
1
star
58

progress-tis

Terminal Based System for progress.thorengruppen.se
Python
1
star
59

zembez

A scary game
Java
1
star
60

CraftSource

CraftSource
Java
1
star
61

mirrnum

The Peculiar Effect Of Subtracting Mirrored Numbers
Python
1
star
62

BlockBlocks

Minecraft Clone
Java
1
star
63

fathersfarm

Farming Game
Java
1
star
64

OperatingSystem

java operating system
Java
1
star
65

RougeGame

A rouge like game
Java
1
star
66

biblehash

A hash function that uses the bible
Python
1
star
67

webpack-tl-loader

Nunjucks templating language pre-processor for your bundle
TypeScript
1
star
68

python-cantor-compression

for students
Python
1
star
69

state0-react-example

state0-react-example
TypeScript
1
star
70

easystr

C string library
C
1
star
71

fuex

Functional Expressions - an alternative to RegEx
C++
1
star
72

i3-volume-ctrl

Graphical volume controller for the i3 window manager
Shell
1
star
73

jupicer

image sharing website
PHP
1
star
74

vol

simple command line volume tool
C
1
star
75

pymplay

Play music with Python (wrapper for sox)
Python
1
star
76

glms-mode

major mode for GLMS lang
Emacs Lisp
1
star
77

BAD_DONT_USE_PIVBS

(DEAD PROJECT) Platform Independent Visual Basic Script
C++
1
star
78

scrape.host

project board for scrape.host
1
star
79

CPP_SDLOpenGL

Quick boilerplate class for rendering OpenGL with SDL (C++)
C++
1
star
80

FarmingGame

Farming Game
Java
1
star
81

bigspace

Big space game
Java
1
star
82

hermes-vim

Hermes syntax highlighting for ViM
Vim Script
1
star
83

WebClient

The web client for the systen
Java
1
star
84

apollon

Graphical User Interface for Coelum
C
1
star
85

dinfo

Show information about current directory / project
Python
1
star
86

Segmengine

Just me, messing around with OpenGL
Java
1
star
87

kdenlive-nvenc

Kdenlive profile settings for GPU acceleration
1
star
88

RPGGAME

Game
Java
1
star
89

css-animations-example

For students
1
star
90

WallpaperGenerator

Genetic Paintings
Java
1
star
91

duvasheetcalc

Calculate my work-hours.
Python
1
star
92

nfc-chip-implant-example

how to trigger an action when the implant is nearby
Python
1
star
93

TowerDefence

A tower defence game in Java
Java
1
star
94

invaders

Space game
C
1
star
95

boot_sector

A simple boot sector for an operating system
Assembly
1
star
96

react-up

Single bash script to setup a React project with Typescript
Shell
1
star
97

bmp

C++ library for writing bmp files
C++
1
star
98

calledio

๐ŸŒ A command-line chat application where the client owns the data
Python
1
star
99

spr

Simple Sprite Format
C
1
star
100

ElemenTailor

Javascript library for creating elements with ease.
JavaScript
1
star