SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Template designed by
Javascript Task Automation
Antonio Turibbio Liccardi
@turibbio
http://codingbad.net
Full-stack developer @ blexin
Co-founder di DotNetCampania
Contributor su GetLatestVersion.it
chi sono
Perché automatizzare?
I framework Javascript per automatizzare
Tutto su Gulp!
agenda
Perché automatizzare?
Modern Times – Charlie Chaplin (1936)
Dev
• Project setup
• Css Manipulation (Sass/Less)
• JS Lint
• Live Reload
• Watch for changed files
• Code Analysis
Release
• Compile
• Unit Testing
• Integration Testing
• Concatenation, Minification,
Vendoring
• Image minification
• Deployment
Cosa automatizzare?
Possiamo guadagnare tempo
automatizzando task ripetitivi?
Usiamo un task runner!
Task runners
Grunt vs Gulp
Grunt
• Configuration over code
(json)
• File based
• >4000 plugins
Gulp
• Code over configuration
• Stream based
• >2000 plugins
Grunt
Gulp
Primi passi con Gulp.js
src
dest
watch
task
Gulp Cheatsheet
gulp.task()
Consente di definire un task tramite l’uso di una funzione. Si
possono dichiarare anche delle dipendenze, che vengono
eseguite prima dell’esecuzione del task in parallelo
gulp.src()
Consente di specificare i file di input per l’intera stream pipeline
Gulp API
gulp.dest()
Consente di specificare l’output dello stream
gulp.watch()
Consente di osservare dei file e di lanciare un task alla loro
modifica
Gulp API
demo
Hello World
Code analysis
CSS Compilation
HTML Injection
Dev Server
Build
Testing
Cosa possiamo fare realmente?
JSHINT
identifica errori e potenziali problemi
JSCS
Javascript code style checker
Entrambi richiedono un set di regole in JSON (.jshintrc, jscsrc, sono
riconosciuti dagli editor)
Code Analysis
demo
Code Analysis
Con Gulp possiamo automatizzare la compilazione di css
usando Less o Sass, possiamo minificare, offuscare, concatenare
CSS manipulation
demo
CSS Compilation
Iniezione di HTML
HTML Injection
Iniezione degli script tramite
Bower
HTML Injection
demo
HTML Injection
Tramite l’uso di nodemon
possiamo, a seguito di una
modifica a determinati files,
fare il restart del server node
Auto-Update Dev Server
demo
Auto-Update Dev Server
Con l’uso di Gulp possiamo automatizzare il processo di
preparazione del pacchetto per la nostra build.
Per questo scopo facciamo
uso di useref
Build
demo
Build
Con Gulp è possibile
automatizzare il testing del
nostro codice javascript
Faremo uso di karma
Testing
demo
Testing
Perché automatizzare?
Gulp e Grunt
Come automatizzare
Riepilogo
Grazie a tutti per la partecipazione
Riceverete il link per il download a slide e demo via email nei
prossimi giorni
Per contattarmi
codingbad.net
@turibbio
Grazie

Weitere ähnliche Inhalte

Was ist angesagt?

Web Api – The HTTP Way
Web Api – The HTTP WayWeb Api – The HTTP Way
Web Api – The HTTP Way
Luca Milan
 
Architetttura Della Soluzione
Architetttura Della SoluzioneArchitetttura Della Soluzione
Architetttura Della Soluzione
Luca Milan
 
Dot netcampus2015 green-template
Dot netcampus2015 green-templateDot netcampus2015 green-template
Dot netcampus2015 green-template
DotNetCampus
 

Was ist angesagt? (20)

Async/Await: make it simple!!
Async/Await: make it simple!!Async/Await: make it simple!!
Async/Await: make it simple!!
 
ASP.NET MVC 6 - uno sguardo al futuro
ASP.NET MVC 6 - uno sguardo al futuroASP.NET MVC 6 - uno sguardo al futuro
ASP.NET MVC 6 - uno sguardo al futuro
 
Xamarin.Forms Performance Tips & Tricks - Francesco Bonacci - Codemotion Rome...
Xamarin.Forms Performance Tips & Tricks - Francesco Bonacci - Codemotion Rome...Xamarin.Forms Performance Tips & Tricks - Francesco Bonacci - Codemotion Rome...
Xamarin.Forms Performance Tips & Tricks - Francesco Bonacci - Codemotion Rome...
 
Windows azure - abbattere tempi e costi di sviluppo
Windows azure - abbattere tempi e costi di sviluppoWindows azure - abbattere tempi e costi di sviluppo
Windows azure - abbattere tempi e costi di sviluppo
 
Web Api – The HTTP Way
Web Api – The HTTP WayWeb Api – The HTTP Way
Web Api – The HTTP Way
 
ASP.NET Core - dove siamo arrivati
ASP.NET Core - dove siamo arrivatiASP.NET Core - dove siamo arrivati
ASP.NET Core - dove siamo arrivati
 
Dependency injection questa sconosciuta
Dependency injection questa sconosciutaDependency injection questa sconosciuta
Dependency injection questa sconosciuta
 
Architetttura Della Soluzione
Architetttura Della SoluzioneArchitetttura Della Soluzione
Architetttura Della Soluzione
 
Dal RenderFragment ai Generics, tips for Blazor developers
Dal RenderFragment ai Generics, tips for Blazor developersDal RenderFragment ai Generics, tips for Blazor developers
Dal RenderFragment ai Generics, tips for Blazor developers
 
Alla scoperta di gRPC
Alla scoperta di gRPCAlla scoperta di gRPC
Alla scoperta di gRPC
 
Multi-Device Hybrid Apps con Visual Studio e Apache Cordova
Multi-Device Hybrid Apps con Visual Studio e Apache CordovaMulti-Device Hybrid Apps con Visual Studio e Apache Cordova
Multi-Device Hybrid Apps con Visual Studio e Apache Cordova
 
jQuery
jQueryjQuery
jQuery
 
Dot netcampus2015 green-template
Dot netcampus2015 green-templateDot netcampus2015 green-template
Dot netcampus2015 green-template
 
Training Signal Webtrends
Training Signal WebtrendsTraining Signal Webtrends
Training Signal Webtrends
 
Sviluppare Azure Web Apps
Sviluppare Azure Web AppsSviluppare Azure Web Apps
Sviluppare Azure Web Apps
 
ASP.NET 4.6 e ASP.NET 5...l'evoluzione del web
ASP.NET 4.6 e ASP.NET 5...l'evoluzione del webASP.NET 4.6 e ASP.NET 5...l'evoluzione del web
ASP.NET 4.6 e ASP.NET 5...l'evoluzione del web
 
Introduzione a Service Fabric e Actor Model
Introduzione a Service Fabric e Actor ModelIntroduzione a Service Fabric e Actor Model
Introduzione a Service Fabric e Actor Model
 
Actions on Google e Alexa skills per .NET lovers
Actions on Google e Alexa skills per .NET loversActions on Google e Alexa skills per .NET lovers
Actions on Google e Alexa skills per .NET lovers
 
Async: scalabilità e responsiveness senza pari! @ CDays
Async: scalabilità e responsiveness senza pari! @ CDaysAsync: scalabilità e responsiveness senza pari! @ CDays
Async: scalabilità e responsiveness senza pari! @ CDays
 
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente
 

Ähnlich wie Javascript task automation

Ähnlich wie Javascript task automation (20)

Working between the clouds (versione completa)
Working between the clouds (versione completa)Working between the clouds (versione completa)
Working between the clouds (versione completa)
 
Working between the clouds
Working between the cloudsWorking between the clouds
Working between the clouds
 
Single Page Applications
Single Page ApplicationsSingle Page Applications
Single Page Applications
 
Perché è così difficile il deploy dei database - DevCast DevOps Serie
Perché è così difficile il deploy dei database  - DevCast DevOps SeriePerché è così difficile il deploy dei database  - DevCast DevOps Serie
Perché è così difficile il deploy dei database - DevCast DevOps Serie
 
Niccolò Becchi: Introduzione a GWT
Niccolò Becchi: Introduzione a GWTNiccolò Becchi: Introduzione a GWT
Niccolò Becchi: Introduzione a GWT
 
Applicazioni HTML5 Superveloci - Salvatore Romeo
Applicazioni HTML5 Superveloci - Salvatore RomeoApplicazioni HTML5 Superveloci - Salvatore Romeo
Applicazioni HTML5 Superveloci - Salvatore Romeo
 
Database Project in Visual Studio 2010
Database Project in Visual Studio 2010Database Project in Visual Studio 2010
Database Project in Visual Studio 2010
 
Novità di Asp.Net 4.0
Novità di Asp.Net 4.0Novità di Asp.Net 4.0
Novità di Asp.Net 4.0
 
PASS Virtual Chapter - SQL Server Continuous Integration
PASS Virtual Chapter - SQL Server Continuous IntegrationPASS Virtual Chapter - SQL Server Continuous Integration
PASS Virtual Chapter - SQL Server Continuous Integration
 
Integrazione continua con TFS Build
Integrazione continua con TFS BuildIntegrazione continua con TFS Build
Integrazione continua con TFS Build
 
Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0
 
CONTINUOUS INTEGRATION CON SQL SERVER
CONTINUOUS INTEGRATION CON SQL SERVERCONTINUOUS INTEGRATION CON SQL SERVER
CONTINUOUS INTEGRATION CON SQL SERVER
 
Agileday2013 pratiche agili applicate all'infrastruttura
Agileday2013 pratiche agili applicate all'infrastrutturaAgileday2013 pratiche agili applicate all'infrastruttura
Agileday2013 pratiche agili applicate all'infrastruttura
 
Il PaaS di Google
Il PaaS di GoogleIl PaaS di Google
Il PaaS di Google
 
Node.js - Server Side Javascript
Node.js - Server Side JavascriptNode.js - Server Side Javascript
Node.js - Server Side Javascript
 
Introduzione a node.js
Introduzione a node.jsIntroduzione a node.js
Introduzione a node.js
 
Introduzione a Node.js
Introduzione a Node.jsIntroduzione a Node.js
Introduzione a Node.js
 
WPO: Ottimizzazione step-by-step del front-end di un e-commerce
WPO: Ottimizzazione step-by-step del front-end di un e-commerceWPO: Ottimizzazione step-by-step del front-end di un e-commerce
WPO: Ottimizzazione step-by-step del front-end di un e-commerce
 
Guarda, senza mani! Automatizzare build e rilasci con Powershell senza farsi ...
Guarda, senza mani! Automatizzare build e rilasci con Powershell senza farsi ...Guarda, senza mani! Automatizzare build e rilasci con Powershell senza farsi ...
Guarda, senza mani! Automatizzare build e rilasci con Powershell senza farsi ...
 
Web frameworks
Web frameworksWeb frameworks
Web frameworks
 

Mehr von Antonio Liccardi

Vs03 – migliorare la qualità del codice con vs 2013
Vs03 – migliorare la qualità del codice con vs 2013Vs03 – migliorare la qualità del codice con vs 2013
Vs03 – migliorare la qualità del codice con vs 2013
Antonio Liccardi
 

Mehr von Antonio Liccardi (16)

DevOpsConf2021 - GitOps and best practices for cloud native CI/CD
DevOpsConf2021 - GitOps and best practices for cloud native CI/CDDevOpsConf2021 - GitOps and best practices for cloud native CI/CD
DevOpsConf2021 - GitOps and best practices for cloud native CI/CD
 
Delivering code with git hub actions
Delivering code with git hub actionsDelivering code with git hub actions
Delivering code with git hub actions
 
Cloud native CI/CD with GitOps
Cloud native CI/CD with GitOpsCloud native CI/CD with GitOps
Cloud native CI/CD with GitOps
 
GitOps and Best Practices for Cloud Native CI/CD
GitOps and Best Practices for Cloud Native CI/CDGitOps and Best Practices for Cloud Native CI/CD
GitOps and Best Practices for Cloud Native CI/CD
 
Microservizi & DevOps
Microservizi & DevOpsMicroservizi & DevOps
Microservizi & DevOps
 
DevOps in a Microservices World
DevOps in a Microservices WorldDevOps in a Microservices World
DevOps in a Microservices World
 
DevDay Salerno - Mobile DevOps con Xamarin
DevDay Salerno - Mobile DevOps con XamarinDevDay Salerno - Mobile DevOps con Xamarin
DevDay Salerno - Mobile DevOps con Xamarin
 
DevDay Salerno - Introduzione a Xamarin
DevDay Salerno - Introduzione a XamarinDevDay Salerno - Introduzione a Xamarin
DevDay Salerno - Introduzione a Xamarin
 
SonarQube e il debito tecnico - Matteo Emili
SonarQube e il debito tecnico - Matteo EmiliSonarQube e il debito tecnico - Matteo Emili
SonarQube e il debito tecnico - Matteo Emili
 
Continuous integration per sviluppatori mobile
Continuous integration per sviluppatori mobileContinuous integration per sviluppatori mobile
Continuous integration per sviluppatori mobile
 
Introduzione a docker
Introduzione a dockerIntroduzione a docker
Introduzione a docker
 
Continuous integration per le tue applicazioni mobile
Continuous integration per le tue applicazioni mobileContinuous integration per le tue applicazioni mobile
Continuous integration per le tue applicazioni mobile
 
Vs04 - DevOps: Continuous Deployment con Windows Azure
Vs04 - DevOps: Continuous Deployment con Windows AzureVs04 - DevOps: Continuous Deployment con Windows Azure
Vs04 - DevOps: Continuous Deployment con Windows Azure
 
Vs03 – migliorare la qualità del codice con vs 2013
Vs03 – migliorare la qualità del codice con vs 2013Vs03 – migliorare la qualità del codice con vs 2013
Vs03 – migliorare la qualità del codice con vs 2013
 
Le novita' su diagnostica e qualita' del codice con visual studio 2013
Le novita' su diagnostica e qualita' del codice con visual studio 2013Le novita' su diagnostica e qualita' del codice con visual studio 2013
Le novita' su diagnostica e qualita' del codice con visual studio 2013
 
Le novità di team foundation server 2012
Le novità di team foundation server 2012Le novità di team foundation server 2012
Le novità di team foundation server 2012
 

Javascript task automation

Hinweis der Redaktion

  1. Aggiungere grafici
  2. Esempio todo-mvc