MOdern Java(Script) Server Stack

Similar documents
JavaScript on the Command Line & PRATIK PATEL CTO TripLingo Labs

Tools. SWE 432, Fall Design and Implementation of Software for the Web

npm install [<name> [<name>...]] [--save --save-dev --save-optional]

Chapter 1 - Development Setup of Angular

Introduction to Using NPM scripts as a Build Tool. 1. 1

Webpack 2 The last bundler you would need in Vijay Dharap, Principal Architect, Infosys

DrupalCon Barcelona Preston So September 22, 2015

Web Development for Dinosaurs An Introduction to Modern Web Development

Webpack. What is Webpack? APPENDIX A. n n n

Serverless in the Java ecosystem

J, K, L. Node.js require() method, 403 package.json, 401 streams functionality, 401 task() method, 401 use strict statement, 403

RequireJS Javascript Modules for the Browser. By Ben Keith Quoin, Inc.

Catbook Workshop: Intro to NodeJS. Monde Duinkharjav

Module 6 Node.js and Socket.IO

Angular 2 Programming

NODE.JS MOCK TEST NODE.JS MOCK TEST I

Making Sling Grunt Or How to Integrate Modern Front-End Development with Sling. Philip Hornig (Publicis Pixelpark), Michael Sunaric (Netcentric)

MEAN February. techdt.la

Index. Elad Elrom 2016 E. Elrom, Pro MEAN Stack Development, DOI /

Node.js. Node.js Overview. CS144: Web Applications

Full Stack boot camp

Grunt Cookbook. Effective Recipes To Master Grunt. Matt Goldspink. This book is for sale at

Server-Side JavaScript auf der JVM. Peter Doschkinow Senior Java Architect

welcome to BOILERCAMP HOW TO WEB DEV

Corey Clark PhD Daniel Montgomery

This tutorial has been prepared for beginners to help them understand the basic functionalities of Gulp.

Enterprise Web Development

Microservices with Node.js

Advance Mobile& Web Application development using Angular and Native Script

Arjen de Blok. Senior Technical Consultant bij ICT Groep ( sinds 1995 Programmeren sinds 1990 Technologiën. Links

END-TO-END JAVASCRIPT WEB APPS

A practical introduction

Java vs JavaScript. For Enterprise Web Applications. Chris Bailey IBM Runtime Technologies IBM Corporation

Getting started with Tabris.js Tutorial Ebook

Frontend UI Training. Whats App :

Backend Development. SWE 432, Fall Web Application Development

Comet and WebSocket Web Applications How to Scale Server-Side Event-Driven Scenarios

Learn Gulp. Jonathan Birkholz. This book is for sale at This version was published on

Evolution of the "Web

Vue.js Developer friendly, Fast and Versatile

PWA s are the future!

High Performance Single Page Application with Vue.js

Web Application Development

JavaScript Web Tools with Visual Studio 2015 and ASP.NET 5. April 2015.

Cisco Spark Widgets Technical drill down

WebStorm, intelligent IDE for JavaScript development

A JavaScript Framework for Presentations and Animations on Computer Science

Advanced Express Web Application Development

5th April Installation Manual. Department of Computing and Networking Software Development Degree

Modern Web Application Development. Sam Hogarth

webpack bundle inner structure and optimization Alexey Ivanov, Evil Martians

Tuesday, January 13, Backend III: Node.js with Databases

Uninstall A Apps Windows 8 Programming Using Html5 Jump Start

Project Avatar: Server Side JavaScript on the JVM GeeCon - May David Software Evangelist - Oracle

APACHE SLING & FRIENDS TECH MEETUP SEPTEMBER Integrating a Modern Frontend Setup with AEM Natalia Venditto, Netcentric

Putting A Spark in Web Apps

Finally JavaScript Is Easy, with Oracle JET! Geertjan Wielenga Product Manager Oracle Developer Tools

Stencil: The Time for Vanilla Web Components has Arrived

P a g e 1. Danish Technological Institute. Scripting and Web Languages Online Course k Scripting and Web Languages

The course is supplemented by numerous hands-on labs that help attendees reinforce their theoretical knowledge of the learned material.

Automate with Grunt. Extracted from: The Build Tool for JavaScript. The Pragmatic Bookshelf

ReactJS and Webpack for Rails

Comprehensive AngularJS Programming (5 Days)

GAVIN KING RED HAT CEYLON SWARM

The paper shows how to realize write-once-run-anywhere for such apps, and what are important lessons learned from our experience.

node.js A quick tour (v4)

INF5750. Introduction to JavaScript and Node.js

August, HPE Propel Microservices & Jumpstart

Lab 6: Testing. Software Studio DataLab, CS, NTHU

Practical Node.js. Building Real-World Scalable Web Apps. Apress* Azat Mardan

Debugging and optimization your RhoMobile Application Raghavendra KC

Functional Programming and the Web

Salvatore Rinzivillo VISUAL ANALYTICS

LeanJS Documentation. Release Romain Dorgueil

NODE.JS SERVER SIDE JAVASCRIPT. Introduc)on Node.js

Brunch Documentation. Release Brunch team

Welcome. Quick Introductions

JS Event Loop, Promises, Async Await etc. Slava Kim

Extending Blue Ocean Keith Zantow

Networking & The Web. HCID 520 User Interface Software & Technology

JavaScript and MVC Frameworks FRONT-END ENGINEERING

Who am I? Weibo:

HTML5 Evolution and Development. Matt Spencer UI & Browser Marketing Manager

Pro JavaScript. Development. Coding, Capabilities, and Tooling. Den Odell. Apress"

Web Performance in

Oracle Real-Time Scheduler

Front End. Presentation Layer. UI (User Interface) User <==> Data access layer

Introduction to Genero Enterprise

Heroku. Rimantas Kybartas

Ionic Tutorial. For Cross Platform Mobile Software Development

A T O O L K I T T O B U I L D D I S T R I B U T E D R E A C T I V E S Y S T E M S

"Charting the Course... Comprehensive Angular. Course Summary

OpenECOMP SDC Developer Guide

How to Install (then Test) the NetBeans Bundle

JavaScript: the Big Picture

By Stephen Cavell, Kerry Ellwanger, and Jack Livingston

IDWedgeKB Serial Port and NodeJS

Quick Desktop Application Development Using Electron

Java with Node.js Powering the Next Generation of Web Applications

IN4MATX 133: User Interface Software

Transcription:

MOdern Java(Script) Server Stack Pratik Patel

Pratik Patel CTO Triplingo JAVA CHAMPION PRESIDENT ATLANTA JUG

POLYGLOT

apple mac vintage 5" screen TURTLE MY FIRST PROGRAM

TURING MY FIRST REAL PROGRAM

JAVASCRIPT JAVA GROOVY RUBY ANDROID IOS

MANY HATS

java STACK

java THREAD MODEL

JAVASCRIPT

WHY? ECOSYSTEM TOOLS

Yesterday s Javascript

TODAY s Javascript

WHAT s CHANGED?

JS IS the same Language it was 2 0 y e a rs a g o NO CHANGE (UNTIL RECENTLY)!

best practices TOOLING MUCH BETTER RUNTIMES We ve changed

WHAT HASN T CHANGED JS Still has BAD PARTS ASYNC, EVENT-DRIVEN EVERY BROWSER SUPPORT

JS OUTSIDE THE BROWSER?

Super fast JS runtime included in chrome RUNS on CLI/server V8

NODE.js

BUILT INTO JVM FOR YEARS rhino (current) Nashorn (next gen) WHAT ABOUT THE JVM?

WHY JAVASCRIPT ON THE SERVER?

SINGLE LANG FOR BROWSER & SERVER FAS T SCALABLE WHY JS?

ISOMORPHIC APPS

code can run either on browser or server! isomorphic apps

Traditional Webapp

Isomorphic

flexibility performance why isomorphic?

WHY DO WE CARE ABOUT NODE.JS?

Bevy of tools for webdev ISOMORPHIC APPS SCALABLE SOLUTIONS WHY node?

SOURCE CODE QUALITY BUNDLING / development server-side JS WHY node?

express, grunt, gulp, webpack, jasmine, BROWSERSYNC, etc modules

SCALABLE

NOT SCALABLE

SCALABLE

PERFORMANCE NUMBERS

NODE - ~10k REQ / second WHAT ABOUT JAVA? NODE VS JAVA WEB REQS

VERT.X

RXJAVA

ARCHITECTURE Web Mobile Bots JavaScript Presentation Java Ruby Python Business Logic / API Layer Data Store

ECOSYSTEM

NODE.JS NPM LOTS OF MODULES ecosystem

javascript runtime based on v8 NODE.js

node package manager npm

express, grunt, gulp, webpack, jasmine, etc modules

NODE.JS

Install from nodejs.org install using brew (mac) node.js

run from command-line node.js

NODE.JS $ node test3.js Hello Bangalore! - test3.js: console.log('hello Bangalore!')

PACKAGE.JSON // describes this node project, place in base folder { "name": "hello-world", "descripeon": "hello world test app", "version": "0.0.1", "private": true, "dependencies": { "express": "3.x" } }

NPM

BASIC PKG MANAGEMENT COMES WITH NODE.JS NPM

127,000 300k PAC KAG ES i n the NPM REPO NPM

WHAT s CHANGED?

NPM $ npm ls $ npm install lodash -g

EXPRESS

Basic server-side web framework lots of other options: sails, KOA, Geddy, etc EXPRESS

EVENT-LOOP model ASYNC, event-driven super scalable express

$ cat hello-world/package.json { EXPRESS "name": "hello-world", "descripeon": "hello world test app", "version": "0.0.1", "private": true, "dependencies": { "express": "3.x" } } $ npm install $ npm app Express server listening on port 3000

NODE.JS DIFFERENT UNIVERSE THAN WHAT YOU ARE USED TO

ASSEMBLE YOUR OWN framework SMALLER MODULES Server-SIDE JS

NO ONE-WAY to do things OVERLAPPING TOOLS Server-SIDE JS

TOOLS

SOCKET.IO

WEBSOCKET SOCKET.IO

Persistent connection NODE handles it well simple on front& back SOCKET.IO

SERVER io.emit('announce', { }); announcement: announcement

BROWSER socket.on('announce', funceon (data) { self.data.announcement = data; self.displaynewdata(); });

WEBSOCKET IS INCLUDED! HTTP2 SPEC

ARCHITECTURE Web Mobile Bots JavaScript Presentation Java Ruby Python Business Logic / API Layer Data Store

NOT FOR EVERY KIND OF APP ASYNC, EVENT-DRIVEN still maturing CLOSING THOUGHTS

Javascript Fatigue

can be tied into existing build process can use existing db & other infra Server-SIDE JS

References: htp://gulpjs.com/ htps://github.com/kriasou/react-starter-kit htp://webpack.github.io/ htps://twiter.com/sstephenson/status/ 730039913052176384

THANK YOU

java STACK

QUICK WALK- THROUGH

GRUNT

TAS K B AS E D C O M M A N D - L I N E TOOL GRUNT

JavaSCript linting Unit test running minification USES

PACKAGE.JSON "devdependencies": { "grunt": "~0.4.2", "grunt-contrib-jshint": "~0.6.3", "grunt-contrib-nodeunit": "~0.2.0", "grunt-contrib-uglify": "~0.2.2" }

module.exports = funceon (grunt) { GRUNTFILE grunt.initconfig({ jshint: { all: ['Grunbile.js', lib/**/*.js', 'test/**/*.js', 'public/**/*.js', 'routes/*.js', 'routes/**/*.js', 'app.js'] } }); grunt.loadnpmtasks('grunt-contrib-jshint'); grunt.registertask('default', ['jshint']); }; // TesEngJasmine

$ grunt RUNNING Running "jshint:all" (jshint) task Linting app.js...error [L12:C20] W033: Missing semicolon. var app = express() Warning: Task "jshint:all" failed. Use --force to continue. Aborted due to warnings.

TOOLS GALORE PAC KAG I N G, T EST I N G, ETC

GULP WEbpack SOCKET.IO TOOLBOX

GULP

Streaming build tool GULP

Plugin based streaming successor to grunt (?) USES

GULPFILE gulp.task('build', ['clean'], funceon(cb) { }); runsequence(['vendor', 'assets', 'styles', 'bundle'], cb);

gulp.task('assets', funceon() { GULPFILE src.assets = [ 'src/assets/**', 'src/content*/**/*.*', 'src/templates*/**/*.*' ]; return gulp.src(src.assets).pipe($.changed('build')).pipe(gulp.dest('build')).pipe($.size({etle: 'assets'})); });

GULPFILE gulp.task('bundle', funceon(cb) { var started = false; var config = require('./webpack.config.js'); var bundler = webpack(config); }

References: htp://gulpjs.com/ htps://github.com/kriasou/react-starter-kit

WEBPACK

Module builder WEBPACK

suited for large projects CODE SPLITTING STATIC ASSETS webpack

WEBPACK

BROWSER SYNC & LIVE updates WEBPACK

devserver: { historyapifallback: true, LIVE RELOAD hot: false, inline: true, progress: false, noinfo: false, proxy: { '/lunches': { target: 'htp://connect-js.com:3000/', secure: false, } } }

PAGESPEED $ gulp pagespeed [15:48:49] Using gulpfile ~/dev/react/react-starter-kit/gulpfile.js [15:48:49] StarEng pagespeed'... CSS size HTML size Image size JavaScript size 148.13 kb 20.84 kb 54.24 kb 1.72 MB