SlideShare a Scribd company logo
1 of 35
Webpack & Babel Sharing
Blackie.Tsai
Blackie.tsai@xuenn.com
2016/9/20
Agenda
• Modularized Javascript
• Webpack Introduction
• Babel Introdcution
• Visual Studio Setup
• Collaborate with .net MVC
• Web Optimize
Modularized JavaScript
Modularized JavaScript
• Pros
• Encapsulation
• Decoupling
• Organization
• No global scope pollution
• Security
• Re-use
• Cons
• More difficult to release
• Complex dependency
Thinking in React
Webpack Introduction
Webpack - A Module Bundler
• A bundler for javascript and friends. Packs many modules into a few
bundled assets. Code Splitting allows to load parts for the
application on demand. Through "loaders," modules can be
CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript,
LESS, ... and your custom stuff. https://webpack.github.io
• Usage: https://webpack.github.io/docs/tutorials/getting-started/
Features
• Performance
• uses async I/O and has multiple caching levels. This makes webpack fast and
incredibly fast on incremental compilations.
• Loaders
• enables use of loaders to preprocess files. This allows you to bundle any static resource way
beyond JavaScript. You can easily write your own loaders using node.js.
• Module Format (AMD/CommonJS)
• supports both AMD and CommonJS module styles.
• Code Splitting
• allows you to split your codebase into multiple chunks. Chunks are loaded asynchronously at
runtime. This reduces the initial loading time.
• Optimizations
• can do many optimizations to reduce the output size of your JavaScript by deduplicating
frequently used modules, minifying, and giving you full control of what is loaded initially and
what is loaded at runtime through code splitting.
Webpack flow
ReactJS+Webpack Structure
Babel Introdcution
Babel - A Tool to convert ES6 to ES5
• A Tool to convert ES6 to ES5
• Babel is the most popular tool used to convert ES6 to ES5. It has
various interfaces like a CLI, Node-module and also an online
converter. I use the node module for my apps and use theonline
version to quickly see the differences.
• Why ES6
• 5 JavaScript “Bad” Parts That Are Fixed In ES6
• Modularized for React, Babel can convert JSX syntax and strip out type
annotations.
Environment Setup
Visual Studio 2015 with latest update
• https://blogs.msdn.microsoft.com/visualstudio/2015/06/10/javas
cript-editor-improvements-in-visual-studio-2015/
• https://www.visualstudio.com/en-us/news/vs2015-update1-
vs.aspx
• React's JSX is now natively supported
• ECMAScript 2015 (formerly ECMAScript 6) support
WebPack Task Runner
• https://visualstudiogallery.msdn.microsoft.com/5497fd10-b1ba-
474c-8991-1438ae47012a
React Snippet Pack
• https://visualstudiogallery.msdn.microsoft.com/234d79e9-f0fd-
41e1-a926-850da8e8c7d7
NodeJS
• Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript
engine. Node.js uses an event-driven, non-blocking I/O model that
makes it lightweight and efficient.
• Node.js' package ecosystem, npm, is the largest ecosystem of open
source libraries in the world.
• https://nodejs.org/dist/v4.5.0/node-v4.5.0-x64.msi
• https://nodejs.org/dist/v6.6.0/node-v6.6.0-x64.msi
[NPM]Webpack
• https://www.npmjs.com/package/webpack
• Project: npm install webpack --save-dev
• Global: npm install webpack –g
[NPM]webpack-notifier
• https://www.npmjs.com/package/webpack-notifier
• npm install --save-dev webpack-notifier
Webpack+Babel+React
Grunt/Gulp for React
• Not all browsers are supporting ES6 yet, so we're going to have to
transpile our ES6 code, turning it into ES5. We're also going to have
to handle 'JSX', the special Javascript that we can use for React. We
also need to play well with existing code.
Webpack for React
• Webpack is a bundler. It'll take a bunch of loose Javascript files and
build a single file from the lot
Webpack+Babel for React
• Even better, we can configure webpack to run files that match a
certain pattern to go through other 'loaders', which can process the
files further.
• We can use the Babel transpiler to turn an ES6 file to ES5. We just
need the glue to let Webpack use Babel as a loader. That comes in
the form of the Babel Loader:
Babel-loader
• This package allows transpiling JavaScript files using Babel and
webpack. https://github.com/babel/babel-loader
Dependency
• React uses JSX as the XML-like syntax extension over JavaScript to
specify component tree structure, data flow, and event handlers. JSX
is processed by Webpack module bundler using specific loaders or
convertors.
Collaborate with .net
MVC
• Demo Download
• Original post : detail of how to setup up front-end in asp.net core
and MVC5, sample is clone from AspNetReactSamples
• Setup
• Install node and NPM
• Go to root directory and use NPM to install js dependency
• npm install
• Build with install nuget dependency
• Run App
Demo
Project Structure
package.json
Layout and View
ES6 to ES5(using Babel)
Advance Webpack
Reference
• 設定開發React的環境
• 設定開發React的環境 - React Hot Loader
• Production optimization with React and Webpack
Q & A
11F., No.399, Ruiguang Rd., Neihu Dist., Taipei City 114, Taiwan
TEL: +886 2 2798 8529 Fax: +886 2 2798 8531 Website : www.xuenn.com
THANK YOU!

More Related Content

What's hot

CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton Araf Karsh Hamid
 
DevOps and APIs: Great Alone, Better Together
DevOps and APIs: Great Alone, Better Together DevOps and APIs: Great Alone, Better Together
DevOps and APIs: Great Alone, Better Together MuleSoft
 
Designing Microservices
Designing MicroservicesDesigning Microservices
Designing MicroservicesDavid Chou
 
NgRx 101 Connect.Tech 2019
NgRx 101   Connect.Tech 2019NgRx 101   Connect.Tech 2019
NgRx 101 Connect.Tech 2019Sergio Brito
 
Ambiente de CI/CD com Google Cloud
Ambiente de CI/CD com Google CloudAmbiente de CI/CD com Google Cloud
Ambiente de CI/CD com Google CloudAlvaro Viebrantz
 
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017Amazon Web Services Korea
 
AEM 6.1 User Interface Customization
AEM 6.1 User Interface CustomizationAEM 6.1 User Interface Customization
AEM 6.1 User Interface CustomizationChristian Meyer
 
12 factor app an introduction
12 factor app an introduction12 factor app an introduction
12 factor app an introductionKrishna-Kumar
 
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxUnit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxMalla Reddy University
 
Service discovery with Eureka and Spring Cloud
Service discovery with Eureka and Spring CloudService discovery with Eureka and Spring Cloud
Service discovery with Eureka and Spring CloudMarcelo Serpa
 
DevOps - Interview Question.pdf
DevOps - Interview Question.pdfDevOps - Interview Question.pdf
DevOps - Interview Question.pdfMinhTrnNht7
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMiki Lombardi
 

What's hot (20)

CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton CI-CD Jenkins, GitHub Actions, Tekton
CI-CD Jenkins, GitHub Actions, Tekton
 
DevOps and APIs: Great Alone, Better Together
DevOps and APIs: Great Alone, Better Together DevOps and APIs: Great Alone, Better Together
DevOps and APIs: Great Alone, Better Together
 
Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Tosca explained
Tosca explainedTosca explained
Tosca explained
 
Designing Microservices
Designing MicroservicesDesigning Microservices
Designing Microservices
 
NgRx 101 Connect.Tech 2019
NgRx 101   Connect.Tech 2019NgRx 101   Connect.Tech 2019
NgRx 101 Connect.Tech 2019
 
Ambiente de CI/CD com Google Cloud
Ambiente de CI/CD com Google CloudAmbiente de CI/CD com Google Cloud
Ambiente de CI/CD com Google Cloud
 
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
 
AEM 6.1 User Interface Customization
AEM 6.1 User Interface CustomizationAEM 6.1 User Interface Customization
AEM 6.1 User Interface Customization
 
Spring Cloud Gateway
Spring Cloud GatewaySpring Cloud Gateway
Spring Cloud Gateway
 
devops
devops devops
devops
 
Algo poo ts
Algo poo tsAlgo poo ts
Algo poo ts
 
12 factor app an introduction
12 factor app an introduction12 factor app an introduction
12 factor app an introduction
 
Historia de java script
Historia de java scriptHistoria de java script
Historia de java script
 
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptxUnit 1 - TypeScript & Introduction to Angular CLI.pptx
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
 
Service discovery with Eureka and Spring Cloud
Service discovery with Eureka and Spring CloudService discovery with Eureka and Spring Cloud
Service discovery with Eureka and Spring Cloud
 
DevOps - Interview Question.pdf
DevOps - Interview Question.pdfDevOps - Interview Question.pdf
DevOps - Interview Question.pdf
 
Micro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - PlansoftMicro Front-End & Microservices - Plansoft
Micro Front-End & Microservices - Plansoft
 
Servicio web soap en java con net beans
Servicio web soap en java con net beansServicio web soap en java con net beans
Servicio web soap en java con net beans
 
Blue green deployment
Blue green deploymentBlue green deployment
Blue green deployment
 

Viewers also liked

2015-11-07 01 Виталий Кравцов. Webpack: человеческий подход к разработке веб ...
2015-11-07 01 Виталий Кравцов. Webpack: человеческий подход к разработке веб ...2015-11-07 01 Виталий Кравцов. Webpack: человеческий подход к разработке веб ...
2015-11-07 01 Виталий Кравцов. Webpack: человеческий подход к разработке веб ...Омские ИТ-субботники
 
Современный фронтенд -- как не утонуть в море хайпа?
Современный фронтенд -- как не утонуть в море хайпа?Современный фронтенд -- как не утонуть в море хайпа?
Современный фронтенд -- как не утонуть в море хайпа?Vladimir Malyk
 
From Hacker to Programmer (w/ Webpack, Babel and React)
From Hacker to Programmer (w/ Webpack, Babel and React)From Hacker to Programmer (w/ Webpack, Babel and React)
From Hacker to Programmer (w/ Webpack, Babel and React)Joseph Chiang
 
Современный фронтенд за 30 минут.
Современный фронтенд за 30 минут.Современный фронтенд за 30 минут.
Современный фронтенд за 30 минут.Vladimir Malyk
 
Webpack integration
Webpack integrationWebpack integration
Webpack integrationIllia Zub
 
"Webpack: 7 бед — один ответ" — Денис Измайлов, MoscowJS 17
"Webpack: 7 бед — один ответ" — Денис Измайлов, MoscowJS 17"Webpack: 7 бед — один ответ" — Денис Измайлов, MoscowJS 17
"Webpack: 7 бед — один ответ" — Денис Измайлов, MoscowJS 17MoscowJS
 
Как Webpack сделал меня счастливее
Как Webpack сделал меня счастливееКак Webpack сделал меня счастливее
Как Webpack сделал меня счастливееYaroslav Serhieiev
 
Webpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JSWebpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JSEmil Öberg
 
#3 "Webpack и Vue.JS: Создание больших приложений и их расширение" Кирилл Кай...
#3 "Webpack и Vue.JS: Создание больших приложений и их расширение" Кирилл Кай...#3 "Webpack и Vue.JS: Создание больших приложений и их расширение" Кирилл Кай...
#3 "Webpack и Vue.JS: Создание больших приложений и их расширение" Кирилл Кай...JSib
 
Webpack Introduction
Webpack IntroductionWebpack Introduction
Webpack IntroductionAnjali Chawla
 
Packing for the Web with Webpack
Packing for the Web with WebpackPacking for the Web with Webpack
Packing for the Web with WebpackThiago Temple
 
Webpack - просто о сложном
Webpack -  просто о сложномWebpack -  просто о сложном
Webpack - просто о сложномTatiana Sakharova
 
webpack: 7 бед - один ответ
webpack: 7 бед - один ответwebpack: 7 бед - один ответ
webpack: 7 бед - один ответDenis Izmaylov
 
Prism Navigation
Prism NavigationPrism Navigation
Prism NavigationEyal Vardi
 
Puzles C#
Puzles C#Puzles C#
Puzles C#lantoli
 
ASP.NET MVC The Begining
ASP.NET MVC The BeginingASP.NET MVC The Begining
ASP.NET MVC The BeginingSimon Huang
 
Thiet ke co so du lieu
Thiet ke co so du lieuThiet ke co so du lieu
Thiet ke co so du lieuma giam gia
 
GraphQL With Relay Part Deux
GraphQL With Relay Part DeuxGraphQL With Relay Part Deux
GraphQL With Relay Part DeuxBrad Pillow
 

Viewers also liked (20)

2015-11-07 01 Виталий Кравцов. Webpack: человеческий подход к разработке веб ...
2015-11-07 01 Виталий Кравцов. Webpack: человеческий подход к разработке веб ...2015-11-07 01 Виталий Кравцов. Webpack: человеческий подход к разработке веб ...
2015-11-07 01 Виталий Кравцов. Webpack: человеческий подход к разработке веб ...
 
Современный фронтенд -- как не утонуть в море хайпа?
Современный фронтенд -- как не утонуть в море хайпа?Современный фронтенд -- как не утонуть в море хайпа?
Современный фронтенд -- как не утонуть в море хайпа?
 
From Hacker to Programmer (w/ Webpack, Babel and React)
From Hacker to Programmer (w/ Webpack, Babel and React)From Hacker to Programmer (w/ Webpack, Babel and React)
From Hacker to Programmer (w/ Webpack, Babel and React)
 
Современный фронтенд за 30 минут.
Современный фронтенд за 30 минут.Современный фронтенд за 30 минут.
Современный фронтенд за 30 минут.
 
Webpack integration
Webpack integrationWebpack integration
Webpack integration
 
"Webpack: 7 бед — один ответ" — Денис Измайлов, MoscowJS 17
"Webpack: 7 бед — один ответ" — Денис Измайлов, MoscowJS 17"Webpack: 7 бед — один ответ" — Денис Измайлов, MoscowJS 17
"Webpack: 7 бед — один ответ" — Денис Измайлов, MoscowJS 17
 
Как Webpack сделал меня счастливее
Как Webpack сделал меня счастливееКак Webpack сделал меня счастливее
Как Webpack сделал меня счастливее
 
Webpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JSWebpack Tutorial, Uppsala JS
Webpack Tutorial, Uppsala JS
 
#3 "Webpack и Vue.JS: Создание больших приложений и их расширение" Кирилл Кай...
#3 "Webpack и Vue.JS: Создание больших приложений и их расширение" Кирилл Кай...#3 "Webpack и Vue.JS: Создание больших приложений и их расширение" Кирилл Кай...
#3 "Webpack и Vue.JS: Создание больших приложений и их расширение" Кирилл Кай...
 
Webpack Introduction
Webpack IntroductionWebpack Introduction
Webpack Introduction
 
Webpack slides
Webpack slidesWebpack slides
Webpack slides
 
Packing for the Web with Webpack
Packing for the Web with WebpackPacking for the Web with Webpack
Packing for the Web with Webpack
 
Webpack - просто о сложном
Webpack -  просто о сложномWebpack -  просто о сложном
Webpack - просто о сложном
 
webpack: 7 бед - один ответ
webpack: 7 бед - один ответwebpack: 7 бед - один ответ
webpack: 7 бед - один ответ
 
Prism Navigation
Prism NavigationPrism Navigation
Prism Navigation
 
Puzles C#
Puzles C#Puzles C#
Puzles C#
 
ASP.NET MVC The Begining
ASP.NET MVC The BeginingASP.NET MVC The Begining
ASP.NET MVC The Begining
 
Models
ModelsModels
Models
 
Thiet ke co so du lieu
Thiet ke co so du lieuThiet ke co so du lieu
Thiet ke co so du lieu
 
GraphQL With Relay Part Deux
GraphQL With Relay Part DeuxGraphQL With Relay Part Deux
GraphQL With Relay Part Deux
 

Similar to DotNet MVC and webpack + Babel + react

Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Conference
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with WebpackJake Peyser
 
Installing Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdfInstalling Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdfSufalam Technologies
 
Comparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksComparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksAngelin R
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance OptimizationChen-Tien Tsai
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxYounusS2
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5mbaric
 
NA Developer Day - Taking your COBOL apps to Net & JVM
NA Developer Day - Taking your COBOL apps to Net & JVM NA Developer Day - Taking your COBOL apps to Net & JVM
NA Developer Day - Taking your COBOL apps to Net & JVM Micro Focus
 
Webpack 살펴보기
Webpack 살펴보기Webpack 살펴보기
Webpack 살펴보기Sangwon Lee
 
Java in a world of containers
Java in a world of containersJava in a world of containers
Java in a world of containersDocker, Inc.
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Arun Gupta
 
001. Introduction about React
001. Introduction about React001. Introduction about React
001. Introduction about ReactBinh Quan Duc
 
React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016Justin Gordon
 
JBoss, Rails and the cloud
JBoss, Rails and the cloudJBoss, Rails and the cloud
JBoss, Rails and the cloudelliando dias
 
Full-Stack Development with Spring Boot and VueJS
Full-Stack Development with Spring Boot and VueJSFull-Stack Development with Spring Boot and VueJS
Full-Stack Development with Spring Boot and VueJSVMware Tanzu
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptKalsoomTahir2
 

Similar to DotNet MVC and webpack + Babel + react (20)

Agile sites2
Agile sites2Agile sites2
Agile sites2
 
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
Shift Remote: JS - Javascript Build Tools: Past & Beyond - Shedrack Akintayo
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with Webpack
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
Installing Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdfInstalling Webpack with React JS from Scratch.pdf
Installing Webpack with React JS from Scratch.pdf
 
Comparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksComparison of Java Web Application Frameworks
Comparison of Java Web Application Frameworks
 
Webpack and Web Performance Optimization
Webpack and Web Performance OptimizationWebpack and Web Performance Optimization
Webpack and Web Performance Optimization
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptx
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
 
NA Developer Day - Taking your COBOL apps to Net & JVM
NA Developer Day - Taking your COBOL apps to Net & JVM NA Developer Day - Taking your COBOL apps to Net & JVM
NA Developer Day - Taking your COBOL apps to Net & JVM
 
Webpack 살펴보기
Webpack 살펴보기Webpack 살펴보기
Webpack 살펴보기
 
Java in a world of containers
Java in a world of containersJava in a world of containers
Java in a world of containers
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018
 
001. Introduction about React
001. Introduction about React001. Introduction about React
001. Introduction about React
 
React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016React on rails v6.1 at LA Ruby, November 2016
React on rails v6.1 at LA Ruby, November 2016
 
ReactJS Workflows
ReactJS WorkflowsReactJS Workflows
ReactJS Workflows
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
 
JBoss, Rails and the cloud
JBoss, Rails and the cloudJBoss, Rails and the cloud
JBoss, Rails and the cloud
 
Full-Stack Development with Spring Boot and VueJS
Full-Stack Development with Spring Boot and VueJSFull-Stack Development with Spring Boot and VueJS
Full-Stack Development with Spring Boot and VueJS
 
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.pptLecture 19 - Dynamic Web - JAVA - Part 1.ppt
Lecture 19 - Dynamic Web - JAVA - Part 1.ppt
 

More from Chen-Tien Tsai

關於軟體工程師職涯的那些事
關於軟體工程師職涯的那些事關於軟體工程師職涯的那些事
關於軟體工程師職涯的那些事Chen-Tien Tsai
 
Artifacts management with CI and CD
Artifacts management with CI and CDArtifacts management with CI and CD
Artifacts management with CI and CDChen-Tien Tsai
 
.NET Security Application/Web Development - Part IV
.NET Security Application/Web Development - Part IV.NET Security Application/Web Development - Part IV
.NET Security Application/Web Development - Part IVChen-Tien Tsai
 
.NET Security Application/Web Development - Part III
.NET Security Application/Web Development - Part III.NET Security Application/Web Development - Part III
.NET Security Application/Web Development - Part IIIChen-Tien Tsai
 
.NET Security Application/Web Development - Part II
.NET Security Application/Web Development - Part II.NET Security Application/Web Development - Part II
.NET Security Application/Web Development - Part IIChen-Tien Tsai
 
.NET Security Application/Web Development - Part I
.NET Security Application/Web Development - Part I.NET Security Application/Web Development - Part I
.NET Security Application/Web Development - Part IChen-Tien Tsai
 
.NET Security Application/Web Development - Overview
.NET Security Application/Web Development - Overview.NET Security Application/Web Development - Overview
.NET Security Application/Web Development - OverviewChen-Tien Tsai
 
Designing distributedsystems cht6
Designing distributedsystems cht6Designing distributedsystems cht6
Designing distributedsystems cht6Chen-Tien Tsai
 
Reactive application with akka.NET & .NET Core
Reactive application with akka.NET & .NET CoreReactive application with akka.NET & .NET Core
Reactive application with akka.NET & .NET CoreChen-Tien Tsai
 
The Cloud - What's different
The Cloud - What's differentThe Cloud - What's different
The Cloud - What's differentChen-Tien Tsai
 
How to be a professional speaker
How to be a professional speakerHow to be a professional speaker
How to be a professional speakerChen-Tien Tsai
 
響應式程式開發之 .NET Core 應用 
響應式程式開發之 .NET Core 應用 響應式程式開發之 .NET Core 應用 
響應式程式開發之 .NET Core 應用 Chen-Tien Tsai
 
Artifacts management with DevOps
Artifacts management with DevOpsArtifacts management with DevOps
Artifacts management with DevOpsChen-Tien Tsai
 
Web optimization with service woker
Web optimization with service wokerWeb optimization with service woker
Web optimization with service wokerChen-Tien Tsai
 
GCPUG.TW Meetup #25 - ASP.NET Core with GCP
GCPUG.TW Meetup #25 - ASP.NET Core with GCPGCPUG.TW Meetup #25 - ASP.NET Core with GCP
GCPUG.TW Meetup #25 - ASP.NET Core with GCPChen-Tien Tsai
 
.NET Study Group - ASP.NET Core with GCP
.NET Study Group - ASP.NET Core with GCP.NET Study Group - ASP.NET Core with GCP
.NET Study Group - ASP.NET Core with GCPChen-Tien Tsai
 
Website Auto scraping with Autoit and .Net HttpRequest
Website Auto scraping with Autoit and .Net HttpRequestWebsite Auto scraping with Autoit and .Net HttpRequest
Website Auto scraping with Autoit and .Net HttpRequestChen-Tien Tsai
 
C# 2 to 5 short Introduction
C# 2 to 5 short IntroductionC# 2 to 5 short Introduction
C# 2 to 5 short IntroductionChen-Tien Tsai
 

More from Chen-Tien Tsai (20)

關於軟體工程師職涯的那些事
關於軟體工程師職涯的那些事關於軟體工程師職涯的那些事
關於軟體工程師職涯的那些事
 
Artifacts management with CI and CD
Artifacts management with CI and CDArtifacts management with CI and CD
Artifacts management with CI and CD
 
.NET Security Application/Web Development - Part IV
.NET Security Application/Web Development - Part IV.NET Security Application/Web Development - Part IV
.NET Security Application/Web Development - Part IV
 
.NET Security Application/Web Development - Part III
.NET Security Application/Web Development - Part III.NET Security Application/Web Development - Part III
.NET Security Application/Web Development - Part III
 
.NET Security Application/Web Development - Part II
.NET Security Application/Web Development - Part II.NET Security Application/Web Development - Part II
.NET Security Application/Web Development - Part II
 
.NET Security Application/Web Development - Part I
.NET Security Application/Web Development - Part I.NET Security Application/Web Development - Part I
.NET Security Application/Web Development - Part I
 
.NET Security Application/Web Development - Overview
.NET Security Application/Web Development - Overview.NET Security Application/Web Development - Overview
.NET Security Application/Web Development - Overview
 
Designing distributedsystems cht6
Designing distributedsystems cht6Designing distributedsystems cht6
Designing distributedsystems cht6
 
Reactive application with akka.NET & .NET Core
Reactive application with akka.NET & .NET CoreReactive application with akka.NET & .NET Core
Reactive application with akka.NET & .NET Core
 
The Cloud - What's different
The Cloud - What's differentThe Cloud - What's different
The Cloud - What's different
 
How to be a professional speaker
How to be a professional speakerHow to be a professional speaker
How to be a professional speaker
 
Agile tutorial
Agile tutorialAgile tutorial
Agile tutorial
 
響應式程式開發之 .NET Core 應用 
響應式程式開發之 .NET Core 應用 響應式程式開發之 .NET Core 應用 
響應式程式開發之 .NET Core 應用 
 
Artifacts management with DevOps
Artifacts management with DevOpsArtifacts management with DevOps
Artifacts management with DevOps
 
Web optimization with service woker
Web optimization with service wokerWeb optimization with service woker
Web optimization with service woker
 
GCPUG.TW Meetup #25 - ASP.NET Core with GCP
GCPUG.TW Meetup #25 - ASP.NET Core with GCPGCPUG.TW Meetup #25 - ASP.NET Core with GCP
GCPUG.TW Meetup #25 - ASP.NET Core with GCP
 
.NET Study Group - ASP.NET Core with GCP
.NET Study Group - ASP.NET Core with GCP.NET Study Group - ASP.NET Core with GCP
.NET Study Group - ASP.NET Core with GCP
 
Website Auto scraping with Autoit and .Net HttpRequest
Website Auto scraping with Autoit and .Net HttpRequestWebsite Auto scraping with Autoit and .Net HttpRequest
Website Auto scraping with Autoit and .Net HttpRequest
 
C# 2 to 5 short Introduction
C# 2 to 5 short IntroductionC# 2 to 5 short Introduction
C# 2 to 5 short Introduction
 
Docker - fundamental
Docker  - fundamentalDocker  - fundamental
Docker - fundamental
 

Recently uploaded

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 

Recently uploaded (20)

why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 

DotNet MVC and webpack + Babel + react

  • 1. Webpack & Babel Sharing Blackie.Tsai Blackie.tsai@xuenn.com 2016/9/20
  • 2. Agenda • Modularized Javascript • Webpack Introduction • Babel Introdcution • Visual Studio Setup • Collaborate with .net MVC • Web Optimize
  • 4. Modularized JavaScript • Pros • Encapsulation • Decoupling • Organization • No global scope pollution • Security • Re-use • Cons • More difficult to release • Complex dependency
  • 7. Webpack - A Module Bundler • A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows to load parts for the application on demand. Through "loaders," modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff. https://webpack.github.io • Usage: https://webpack.github.io/docs/tutorials/getting-started/
  • 8. Features • Performance • uses async I/O and has multiple caching levels. This makes webpack fast and incredibly fast on incremental compilations. • Loaders • enables use of loaders to preprocess files. This allows you to bundle any static resource way beyond JavaScript. You can easily write your own loaders using node.js. • Module Format (AMD/CommonJS) • supports both AMD and CommonJS module styles. • Code Splitting • allows you to split your codebase into multiple chunks. Chunks are loaded asynchronously at runtime. This reduces the initial loading time. • Optimizations • can do many optimizations to reduce the output size of your JavaScript by deduplicating frequently used modules, minifying, and giving you full control of what is loaded initially and what is loaded at runtime through code splitting.
  • 12. Babel - A Tool to convert ES6 to ES5 • A Tool to convert ES6 to ES5 • Babel is the most popular tool used to convert ES6 to ES5. It has various interfaces like a CLI, Node-module and also an online converter. I use the node module for my apps and use theonline version to quickly see the differences. • Why ES6 • 5 JavaScript “Bad” Parts That Are Fixed In ES6 • Modularized for React, Babel can convert JSX syntax and strip out type annotations.
  • 14. Visual Studio 2015 with latest update • https://blogs.msdn.microsoft.com/visualstudio/2015/06/10/javas cript-editor-improvements-in-visual-studio-2015/ • https://www.visualstudio.com/en-us/news/vs2015-update1- vs.aspx • React's JSX is now natively supported • ECMAScript 2015 (formerly ECMAScript 6) support
  • 15. WebPack Task Runner • https://visualstudiogallery.msdn.microsoft.com/5497fd10-b1ba- 474c-8991-1438ae47012a
  • 16. React Snippet Pack • https://visualstudiogallery.msdn.microsoft.com/234d79e9-f0fd- 41e1-a926-850da8e8c7d7
  • 17. NodeJS • Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. • Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. • https://nodejs.org/dist/v4.5.0/node-v4.5.0-x64.msi • https://nodejs.org/dist/v6.6.0/node-v6.6.0-x64.msi
  • 18. [NPM]Webpack • https://www.npmjs.com/package/webpack • Project: npm install webpack --save-dev • Global: npm install webpack –g
  • 21. Grunt/Gulp for React • Not all browsers are supporting ES6 yet, so we're going to have to transpile our ES6 code, turning it into ES5. We're also going to have to handle 'JSX', the special Javascript that we can use for React. We also need to play well with existing code.
  • 22. Webpack for React • Webpack is a bundler. It'll take a bunch of loose Javascript files and build a single file from the lot
  • 23. Webpack+Babel for React • Even better, we can configure webpack to run files that match a certain pattern to go through other 'loaders', which can process the files further. • We can use the Babel transpiler to turn an ES6 file to ES5. We just need the glue to let Webpack use Babel as a loader. That comes in the form of the Babel Loader:
  • 24. Babel-loader • This package allows transpiling JavaScript files using Babel and webpack. https://github.com/babel/babel-loader
  • 25. Dependency • React uses JSX as the XML-like syntax extension over JavaScript to specify component tree structure, data flow, and event handlers. JSX is processed by Webpack module bundler using specific loaders or convertors.
  • 27. • Demo Download • Original post : detail of how to setup up front-end in asp.net core and MVC5, sample is clone from AspNetReactSamples • Setup • Install node and NPM • Go to root directory and use NPM to install js dependency • npm install • Build with install nuget dependency • Run App Demo
  • 33. Reference • 設定開發React的環境 • 設定開發React的環境 - React Hot Loader • Production optimization with React and Webpack
  • 34. Q & A
  • 35. 11F., No.399, Ruiguang Rd., Neihu Dist., Taipei City 114, Taiwan TEL: +886 2 2798 8529 Fax: +886 2 2798 8531 Website : www.xuenn.com THANK YOU!