SlideShare a Scribd company logo
Rollup.jsRollup.js
/me/me
Mathieu BretonMathieu Breton
CTO at @jsrepublic
What ?What ?
A some kind of JS packagerA some kind of JS packager
coming from the Future ...coming from the Future ...
By Bogdan Chadkin
and Oskar Segersvärd
State of artState of art
 
All packagers bundle entirely the code base, and
does not remove the dead code
FeaturesFeatures
Package Node lib and
JavaScript Front asset
 
Output types : UMD, AMD,
CommonJS, ES2015, Global
 
Produce smaller bundle
than anyone
JS API, Tools integration,
Command line interface
 
Design to work with the
next standard
 
Handle Cyclic
dependency
LimitationsLimitations
Handle only JavaScript assets
 
Works with ES2015 and CommonJS only
 
Needs a ES2015 transpiler (Ex: Babel)
How ?How ?
Based on ES2015 and its modules
// api.js
export function getJson(url) { ... }
// main.js
import {getJson} from "./api";
Remove Dead code with Tree-Shaking
RollupJs
Is it efficient ?Is it efficient ?
Yes! Minified and gzipped, D3 weighs around
58kB  weighs just 8kB,
including the code itself. Depending on which of
d3's functions you're actually using, the savings can
be even more dramatic.
 
Voronoi Tesselation example
Source
For commonJSFor commonJS
NPM : rollup­plugin­commonjs
// importer.js
import { named } from './exporter.js';
// exporter.js
module.exports = { named: 42 };
// importer.js
const named = require("./exporter").named;
// exporter.js
module.exports = { named: 42 };
But prefer ES2015 modulesBut prefer ES2015 modules
{
"name": "my-package",
"version": "0.1.0",
"main": "dist/my-package.umd.js",
"jsnext:main": "dist/my-package.es2015.js"
}
jsnext:mainjsnext:main
In practiceIn practice
github.com/js-republic/rollup-sample
ConclusionConclusion
Not yet production ready ...
Bugs
Npm ecosystem needs to evolve
Handle only ES2015 modules et CommonJS
It is the future
Thank youThank you
@MatBreton@MatBreton
Rollupjs.org

More Related Content

PDF
Brig:Node.js + QML 華麗大冒險
PDF
Enjoy Writing Modern Desktop Application in JavaScript
PDF
Assembly thy Web
PDF
Web technologies for desktop development
PDF
ASP.NET MVC - jQuery, Minification, Json
PPTX
NodeJS
PDF
RDBMS with Node.js
PPTX
Microsoft, java and you!
Brig:Node.js + QML 華麗大冒險
Enjoy Writing Modern Desktop Application in JavaScript
Assembly thy Web
Web technologies for desktop development
ASP.NET MVC - jQuery, Minification, Json
NodeJS
RDBMS with Node.js
Microsoft, java and you!

Similar to Rollup.js (20)

PDF
Modular JavaScript in an OSGi World - S Mak
DOCX
Brad Enterprise Solution Architect
PDF
The Java alternative to Javascript
KEY
Modules and EmbedJS
PDF
Browser and Cloud - The Future of IDEs?
PDF
Modular JavaScript
PPT
Google Dev Day2007
PDF
React native bridge for iOS and android
ODP
Jalimo Slides Linuxtag2007 (English)
PDF
GWT - AppDays - (25 aprile 2014, pordenone)
PPT
Pragmatic Model Driven Development using openArchitectureWare
PDF
Web polyglot programming
PDF
Javascript as a target language - GWT KickOff - Part 2/2
PDF
IOC + Javascript
PPTX
Intro to OSGi
PDF
Advanced Node.JS Meetup
PDF
Angular 2: What's New?
KEY
Introduction to EclipseRT (JAX 2010)
PPTX
Basic Concept of Node.js & NPM
PPTX
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Modular JavaScript in an OSGi World - S Mak
Brad Enterprise Solution Architect
The Java alternative to Javascript
Modules and EmbedJS
Browser and Cloud - The Future of IDEs?
Modular JavaScript
Google Dev Day2007
React native bridge for iOS and android
Jalimo Slides Linuxtag2007 (English)
GWT - AppDays - (25 aprile 2014, pordenone)
Pragmatic Model Driven Development using openArchitectureWare
Web polyglot programming
Javascript as a target language - GWT KickOff - Part 2/2
IOC + Javascript
Intro to OSGi
Advanced Node.JS Meetup
Angular 2: What's New?
Introduction to EclipseRT (JAX 2010)
Basic Concept of Node.js & NPM
Challenges of angular in production (Tasos Bekos) - GreeceJS #17
Ad

More from Mathieu Breton (8)

PDF
TDD in Javascript
PDF
Meet VueJs
PDF
FalcorJS
PDF
BDD in Javascript
PDF
NodeJS Spring style Inversifyjs
PDF
Clean code in JavaScript
PDF
Présentation de Dart
PDF
JavaScript the-next-big...bytecode
TDD in Javascript
Meet VueJs
FalcorJS
BDD in Javascript
NodeJS Spring style Inversifyjs
Clean code in JavaScript
Présentation de Dart
JavaScript the-next-big...bytecode
Ad

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
August Patch Tuesday
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Chapter 5: Probability Theory and Statistics
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Hybrid model detection and classification of lung cancer
PDF
Getting Started with Data Integration: FME Form 101
PDF
project resource management chapter-09.pdf
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
DP Operators-handbook-extract for the Mautical Institute
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
August Patch Tuesday
MIND Revenue Release Quarter 2 2025 Press Release
Chapter 5: Probability Theory and Statistics
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Encapsulation theory and applications.pdf
Hybrid model detection and classification of lung cancer
Getting Started with Data Integration: FME Form 101
project resource management chapter-09.pdf
Heart disease approach using modified random forest and particle swarm optimi...
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Enhancing emotion recognition model for a student engagement use case through...
NewMind AI Weekly Chronicles - August'25-Week II
Assigned Numbers - 2025 - Bluetooth® Document
Programs and apps: productivity, graphics, security and other tools
DP Operators-handbook-extract for the Mautical Institute
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
OMC Textile Division Presentation 2021.pptx
1. Introduction to Computer Programming.pptx
Group 1 Presentation -Planning and Decision Making .pptx

Rollup.js