SlideShare a Scribd company logo
1 of 11
Babel Compiler
S.B.S.Younus, M.Sc., M.Phil., NET.,
Assistant Professor,
Department of Information Technology,
Sadakathullah Appa College,
Rahmath Nagar, Tirunelveli - 627 011.
Youtube: SBS Digital Learning.
What is Babel
• Babel is a JavaScript compiler.
• Babel is a toolchain that is mainly used to convert
ECMAScript 2015+ code into a backwards compatible
version of JavaScript in current and older browsers.
Example
// Babel Input: ES2015 arrow function
[1, 2, 3].map(n => n + 1);
// Babel Output: ES5 equivalent
[1, 2, 3].map(function(n)
{
return n + 1;
});
Transpiler and Polyfill
• Babel transpiler converts the syntax of modern JavaScript
into a form, which can be easily understood by older
browsers.
• A Polyfill is a piece of code (usually JavaScript on the
Web) used to provide modern functionality on older
browsers that do not natively support it.
Why Babel?
• JavaScript is the language that the browser understands.
• We use different browsers to run our applications such as
Chrome, Firefox, etc.
• It is now uncertain when it will be possible for all
browsers to be compatible with all the ES versions that
released.
• ECMA Script is the JavaScript language specification.
• After ES5, we have had ES6, ES7, and ES8. ES6
released with a lot of new features which are not fully
supported by all browsers.
• If we want to use new features of ECMA Script in our
code and want to run it on all possible browsers available,
we need a tool called Babel that will compile our final
code in ES5.
Features of Babel
• Babel-plugins
• Babel-presets
• Babel-polyfills
Advantages of Babel
• BabelJS provides backward compatibility to all the newly
added features to JavaScript and can be used in any
browsers.
• BabelJS has the ability to transpile to take the next
upcoming version of JavaScript - ES6, ES7, ESNext, etc.
• BabelJS can be used along with gulp, webpack, flow,
react, typescript, etc. making it very powerful and can be
used with big project making developer’s life easy.
Advantages of Babel
• BabelJS also works along with react JSX syntax and can
be compiled in JSX form.
• BabelJS has support for plugins, polyfills, babel-cli that
makes it easy to work with big projects.
Disadvantages of Babel
• BabelJS code changes the syntax while transpiling which
makes the code difficult to understand when released on
production.
• The code transpiled is more in size when compared to the
original code.
Thank You

More Related Content

Similar to Babel Compiler - Transforming JavaScript for All Browsers.pptx

Ten Compelling Reasons to Go the Scala Development Way - Metadesign Solutions
Ten Compelling Reasons to Go the Scala Development Way - Metadesign SolutionsTen Compelling Reasons to Go the Scala Development Way - Metadesign Solutions
Ten Compelling Reasons to Go the Scala Development Way - Metadesign SolutionsMetaDesign Solutions
 
Accelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentAccelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentMicro Focus
 
Swift programming language
Swift programming languageSwift programming language
Swift programming languageNijo Job
 
Accelerating time to delivery - Modern tools for COBOL development
Accelerating time to delivery - Modern tools for COBOL developmentAccelerating time to delivery - Modern tools for COBOL development
Accelerating time to delivery - Modern tools for COBOL developmentMicro Focus
 
Eclipsist2009 Rich Client Roundup
Eclipsist2009 Rich Client RoundupEclipsist2009 Rich Client Roundup
Eclipsist2009 Rich Client RoundupMurat Yener
 
DSpace UI prototype dsember
DSpace UI prototype dsemberDSpace UI prototype dsember
DSpace UI prototype dsemberBram Luyten
 
C# vs Java What are The Differences.pdf
C# vs Java What are The Differences.pdfC# vs Java What are The Differences.pdf
C# vs Java What are The Differences.pdfchristiemarie4
 
Boilerplates: Step up your Web Development Process
Boilerplates: Step up your Web Development ProcessBoilerplates: Step up your Web Development Process
Boilerplates: Step up your Web Development ProcessFibonalabs
 
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE abile technologies
 
Multilingual Vue Apps without a plugin
Multilingual Vue Apps without a pluginMultilingual Vue Apps without a plugin
Multilingual Vue Apps without a pluginKatia Smet
 
Introduction_to_NET.ppt
Introduction_to_NET.pptIntroduction_to_NET.ppt
Introduction_to_NET.pptDarwin Terraza
 

Similar to Babel Compiler - Transforming JavaScript for All Browsers.pptx (20)

Java.pptx
Java.pptxJava.pptx
Java.pptx
 
Ten Compelling Reasons to Go the Scala Development Way - Metadesign Solutions
Ten Compelling Reasons to Go the Scala Development Way - Metadesign SolutionsTen Compelling Reasons to Go the Scala Development Way - Metadesign Solutions
Ten Compelling Reasons to Go the Scala Development Way - Metadesign Solutions
 
Accelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol developmentAccelerating time to delivery modern tools for cobol development
Accelerating time to delivery modern tools for cobol development
 
Swift programming language
Swift programming languageSwift programming language
Swift programming language
 
java full 1 (Recovered).docx
java full 1 (Recovered).docxjava full 1 (Recovered).docx
java full 1 (Recovered).docx
 
java completed units.docx
java completed units.docxjava completed units.docx
java completed units.docx
 
java full 1.docx
java full 1.docxjava full 1.docx
java full 1.docx
 
java full.docx
java full.docxjava full.docx
java full.docx
 
Java (1)
Java (1)Java (1)
Java (1)
 
Analysis
AnalysisAnalysis
Analysis
 
Accelerating time to delivery - Modern tools for COBOL development
Accelerating time to delivery - Modern tools for COBOL developmentAccelerating time to delivery - Modern tools for COBOL development
Accelerating time to delivery - Modern tools for COBOL development
 
Ionic in 30
Ionic in 30Ionic in 30
Ionic in 30
 
Eclipsist2009 Rich Client Roundup
Eclipsist2009 Rich Client RoundupEclipsist2009 Rich Client Roundup
Eclipsist2009 Rich Client Roundup
 
DSpace UI prototype dsember
DSpace UI prototype dsemberDSpace UI prototype dsember
DSpace UI prototype dsember
 
C# vs Java What are The Differences.pdf
C# vs Java What are The Differences.pdfC# vs Java What are The Differences.pdf
C# vs Java What are The Differences.pdf
 
Boilerplates: Step up your Web Development Process
Boilerplates: Step up your Web Development ProcessBoilerplates: Step up your Web Development Process
Boilerplates: Step up your Web Development Process
 
1.Intro--Why Java.pptx
1.Intro--Why Java.pptx1.Intro--Why Java.pptx
1.Intro--Why Java.pptx
 
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
JAVA J2EE Training in Coimbatore - Fundamentals of Java J2EE
 
Multilingual Vue Apps without a plugin
Multilingual Vue Apps without a pluginMultilingual Vue Apps without a plugin
Multilingual Vue Apps without a plugin
 
Introduction_to_NET.ppt
Introduction_to_NET.pptIntroduction_to_NET.ppt
Introduction_to_NET.ppt
 

More from YounusS2

Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
Normalization in RDBMS.pptx
Normalization in RDBMS.pptxNormalization in RDBMS.pptx
Normalization in RDBMS.pptxYounusS2
 
Contextual Classes SBS.pptx
Contextual Classes SBS.pptxContextual Classes SBS.pptx
Contextual Classes SBS.pptxYounusS2
 
Topology by SBS.pptx
Topology by SBS.pptxTopology by SBS.pptx
Topology by SBS.pptxYounusS2
 
Bootstrap by SBS.pptx
Bootstrap by SBS.pptxBootstrap by SBS.pptx
Bootstrap by SBS.pptxYounusS2
 
Cloud by SBS.pptx
Cloud by SBS.pptxCloud by SBS.pptx
Cloud by SBS.pptxYounusS2
 
Html events with javascript
Html events with javascriptHtml events with javascript
Html events with javascriptYounusS2
 
Digital twin
Digital twinDigital twin
Digital twinYounusS2
 
Education Definitions
Education DefinitionsEducation Definitions
Education DefinitionsYounusS2
 
Python & Data Science
Python & Data SciencePython & Data Science
Python & Data ScienceYounusS2
 
Deep learning: Mathematical Perspective
Deep learning: Mathematical PerspectiveDeep learning: Mathematical Perspective
Deep learning: Mathematical PerspectiveYounusS2
 

More from YounusS2 (12)

Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
Normalization in RDBMS.pptx
Normalization in RDBMS.pptxNormalization in RDBMS.pptx
Normalization in RDBMS.pptx
 
Contextual Classes SBS.pptx
Contextual Classes SBS.pptxContextual Classes SBS.pptx
Contextual Classes SBS.pptx
 
Topology by SBS.pptx
Topology by SBS.pptxTopology by SBS.pptx
Topology by SBS.pptx
 
Bootstrap by SBS.pptx
Bootstrap by SBS.pptxBootstrap by SBS.pptx
Bootstrap by SBS.pptx
 
Cloud by SBS.pptx
Cloud by SBS.pptxCloud by SBS.pptx
Cloud by SBS.pptx
 
Html events with javascript
Html events with javascriptHtml events with javascript
Html events with javascript
 
Digital twin
Digital twinDigital twin
Digital twin
 
Education Definitions
Education DefinitionsEducation Definitions
Education Definitions
 
Education
EducationEducation
Education
 
Python & Data Science
Python & Data SciencePython & Data Science
Python & Data Science
 
Deep learning: Mathematical Perspective
Deep learning: Mathematical PerspectiveDeep learning: Mathematical Perspective
Deep learning: Mathematical Perspective
 

Recently uploaded

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Babel Compiler - Transforming JavaScript for All Browsers.pptx

  • 1. Babel Compiler S.B.S.Younus, M.Sc., M.Phil., NET., Assistant Professor, Department of Information Technology, Sadakathullah Appa College, Rahmath Nagar, Tirunelveli - 627 011. Youtube: SBS Digital Learning.
  • 2. What is Babel • Babel is a JavaScript compiler. • Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers.
  • 3. Example // Babel Input: ES2015 arrow function [1, 2, 3].map(n => n + 1); // Babel Output: ES5 equivalent [1, 2, 3].map(function(n) { return n + 1; });
  • 4. Transpiler and Polyfill • Babel transpiler converts the syntax of modern JavaScript into a form, which can be easily understood by older browsers. • A Polyfill is a piece of code (usually JavaScript on the Web) used to provide modern functionality on older browsers that do not natively support it.
  • 5. Why Babel? • JavaScript is the language that the browser understands. • We use different browsers to run our applications such as Chrome, Firefox, etc. • It is now uncertain when it will be possible for all browsers to be compatible with all the ES versions that released.
  • 6. • ECMA Script is the JavaScript language specification. • After ES5, we have had ES6, ES7, and ES8. ES6 released with a lot of new features which are not fully supported by all browsers. • If we want to use new features of ECMA Script in our code and want to run it on all possible browsers available, we need a tool called Babel that will compile our final code in ES5.
  • 7. Features of Babel • Babel-plugins • Babel-presets • Babel-polyfills
  • 8. Advantages of Babel • BabelJS provides backward compatibility to all the newly added features to JavaScript and can be used in any browsers. • BabelJS has the ability to transpile to take the next upcoming version of JavaScript - ES6, ES7, ESNext, etc. • BabelJS can be used along with gulp, webpack, flow, react, typescript, etc. making it very powerful and can be used with big project making developer’s life easy.
  • 9. Advantages of Babel • BabelJS also works along with react JSX syntax and can be compiled in JSX form. • BabelJS has support for plugins, polyfills, babel-cli that makes it easy to work with big projects.
  • 10. Disadvantages of Babel • BabelJS code changes the syntax while transpiling which makes the code difficult to understand when released on production. • The code transpiled is more in size when compared to the original code.