Web Packagers
🏛️ History
- 1995: Born
JavaScript
in the war between Microsoft and NetScape for the internet market - 2009: Born
Node.js
a runtime of JavaScript in the server side - 2009: Release of
npm
a packager for Node and JavaScript - 2011:
Browserify
the tool for packaging arrives to JavaScript environment - 2013:
Gulp
show a new way for work with our JavaScript apps - 2014:
Babel
a JavaScript compiler
📁 What is a module?
Is just a file with code that we can call from the other files in the same way as we can import other modules to our file
What is IIFE?
Is a way in JavaScript for invoking a function immediately and stand for Immediately Invoked Function Expression
Example
(function () {
console.log('Hi from IIFE')
})()
What is CommonJS (CJS)?
Is a alternative for create modules in JavaScript that born with Node.js in 2009
What is AMD (Asynchronous Module Definition)?
Is a propose for solve some limitations that has CJS for load modules in the client side
What is ES Modules (ESM)?
Is the native way implemented with Ecmascript6+ that allows you use export
and import
for can works with modules in an easy way
Web packager
It’s a piece software that allows have all the items (code, images, fonts, etc) in a single file, this is useful to reduce the size of the code.
✨ Most popular packagers
<h5>Webpack</h5>- Dependecies managment
- Tasks execution
- Format convertion
- Development server
- Dependecies management
- Tasks execution
- Development server
- Implementation diagnostic
- Tree shaking (delete code pieces that don’t be used)
- High performance
- Tasks execution
- Tree shaking
- Support for ES6 and CommonJS
- Easy Dependencies Management
- Task execution
- Tree shaking
- Support for ES6 and CommonJS
- Just the new fucking rockstar in the neighborhood!
¿Quieres ver más aportes, preguntas y respuestas de la comunidad?