Save 37% off PRO during our Black Friday Sale! »

Front End Development for Backend Developers - GIDS 2019

Front End Development for Backend Developers - GIDS 2019

Are you a backend developer that's being pushed into front-end development? Are you frustrated with all JavaScript frameworks and build tools you have to learn to be a good UI developer? If so, this session is for you! We'll explore the tools for frontend development and frameworks too!

72a2082c6a4dd79ad68befb3db911616?s=128

Matt Raible
PRO

April 22, 2019
Tweet

Transcript

  1. Front End Development for Back End Developers April 22, 2019

    #gids19 Matt Raible · @mraible Photo by Spiros Vathis https://www.flickr.com/photos/vathis/8649808366
  2. Blogger on raibledesigns.com and developer.okta.com/blog Web Developer and Java Champion

    Father, Skier, Mountain Biker, Whitewater Rafter Open Source Developer + User Who is Matt Raible? Bus Lover Okta Developer Advocate
  3. None
  4. None
  5. None
  6. developer.okta.com

  7. Authentication Standards

  8. What about You? How many consider themselves backend developers? Java,

    .NET, Python, or Node.js? Do you write code for UIs? Do you like JavaScript? What JavaScript Frameworks do you use?
  9. OAuth 2.0 Overview Today’s Agenda JavaScript / TypeScript Build Tools

    JavaScript Frameworks CSS Progressive Web Apps JHipster
  10. My Web Dev Journey

  11. What is modern front end development?

  12. Web Frameworks Over the Years https://github.com/mraible/history-of-web-frameworks-timeline

  13. JSF https://zeroturnaround.com/webframeworksindex ❤

  14. JavaScript Framework Explosion

  15. None
  16. None
  17. Let’s do some learning!

  18. ES6, ES7 and TypeScript ES5: es5.github.io ES6: git.io/es6features ES7: bit.ly/es7features

    TS: www.typescriptlang.org TS ES7 ES6 ES5
  19. http://caniuse.com/#search=es5

  20. http://caniuse.com/#search=es6

  21. TypeScript $ npm install -g typescript function greeter(person: string) {


    return "Hello, " + person;
 }
 
 var user = "Jane User";
 
 document.body.innerHTML = greeter(user); $ tsc greeter.ts https://www.typescriptlang.org/docs/tutorial.html
  22. bus.ts

  23. TypeScript 2.3

  24. “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’s package ecosystem, npm, is the largest ecosystem of open source libraries in the world.” https://nodejs.org https://github.com/creationix/nvm
  25. Front End Build Tools Old School: Gulp New School: SystemJS

    Hip: Webpack Web Dependencies: Old School: Bower New School: npm Hip: yarn
  26. Yeoman The web's scaffolding tool for modern webapps Helps you

    kickstart new projects Promotes the Yeoman workflow yeoman.io
  27. Browsersync browsersync.io

  28. Gulp gulp.task('serve', function() { browserSync.init({ server: './app' }); gulp.watch(['app/**/*.js', 'app/**/*.css',

    'app/**/*.html']) .on('change', browserSync.reload); });
  29. Webpack

  30. Write and Bundle // bar.js export default function bar() {

    // code here } // app.js import bar from './bar'; bar(); // webpack.config.js module.exports = { entry: './app.js', output: { filename: 'bundle.js' } } <!-- index.html --> <html> <head> ... </head> <body> ... <script src="bundle.js"></script> </body> </html>
  31. webpack.config.js module.exports = { entry: './src/app.js', output: { path: __dirname

    + '/src/main/webapp/public', filename: 'bundle.js' }, module: { loaders: [ { test: /.js$/, loader: 'babel', exclude: /node_modules/, query: { presets: ['es2015', 'react'] } } ] } };
  32. webpack.academy

  33. https://xkcd.com/303/

  34. Leading JavaScript Frameworks in 2019 angular.io facebook.github.io/react vuejs.org

  35. None
  36. None
  37. “Angular and React dominate: Nothing else even comes close.”

  38. None
  39. “2018: The Year of React React won the popularity battle

    in 2017.”
  40. None
  41. “React kept a firm grip on its lead in 2018.”

  42. Crunch the Numbers

  43. @spring_io #springio17 Hot Frameworks hotframeworks.com

  44. @spring_io #springio17 Hot Frameworks hotframeworks.com

  45. @spring_io #springio17 Jobs on Indeed (US) April 2019 0 2,500

    5,000 7,500 10,000 Vue React Angular
  46. @spring_io #springio17 Stack Overflow Tags April 2019 0 45,000 90,000

    135,000 180,000 Vue React Angular
  47. @spring_io #springio17 GitHub Stars April 2019 0 35,000 70,000 105,000

    140,000 Angular Backbone Knockout Ember Polymer React Vue
  48. Hello World with Angular import { Component } from '@angular/core';

    @Component({ selector: 'my-app', template: `<h1>Hello {{name}}</h1>` }) export class AppComponent { name = 'World'; } <my-app></my-app>
  49. Hello World with Angular import { BrowserModule } from '@angular/platform-browser';

    import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, FormsModule, HttpModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
  50. Hello World with Angular import { enableProdMode } from '@angular/core';

    import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; if (environment.production) { enableProdMode(); } platformBrowserDynamic().bootstrapModule(AppModule);
  51. None
  52. Angular CLI

  53. Angular CLI

  54. Ionic Framework

  55. ng-book A comprehensive guide to developing with Angular 7 Worth

    all your hard earned $$$ https://www.ng-book.com/2 “Thank you for the awesome book. It's the bible for Angular.” — Vijay Ganta
  56. Authentication with Angular

  57. Hello World with React http://codepen.io/gaearon/pen/ZpvBNJ?editors=0100 <div id="root"></div> <script> ReactDOM.render( <h1>Hello,

    world!</h1>, document.getElementById('root') ); </script>
  58. Learning React https://vimeo.com/213710634

  59. Imperative Code if (count > 99) { if (!hasFire()) {

    addFire(); } } else { if (hasFire()) { removeFire(); } } if (count === 0) { if (hasBadge()) { removeBadge(); } return; } if (!hasBadge()) { addBadge(); } var countText = count > 99 ? "99+" : count.toString(); getBadge().setText(countText);
  60. Declarative Code if (count === 0) { return <div className="bell"/>;

    } else if (count <= 99) { return ( <div className="bell"> <span className="badge">{count}</span> </div> ); } else { return ( <div className="bell onFire"> <span className="badge">99+</span> </div> ); }
  61. None
  62. Create React App

  63. Create React App

  64. Authentication with React

  65. Hello World with Vue.js https://jsfiddle.net/chrisvfritz/50wL7mdz/ <div id="app"> <p>{{ message }}</p>

    </div> <script> new Vue({ el: '#app', data: { message: 'Hello Vue.js!' } }); </script>
  66. Learning Vue.js https://youtu.be/utJGnK9D_UQ

  67. Vue.js Code <script src="https://unpkg.com/vue/dist/vue.js"></script> <div id="app"> <button v-on:click="clickedButton()">Click here!</button> </div>

    <script> new Vue({ el: '#app', methods: { clickedButton: function(event) { console.log(event); alert("You clicked the button!"); } } }); </script>
  68. None
  69. Getting Started

  70. Vue CLI

  71. Vue CLI

  72. Authentication with Vue

  73. Server-Side Support Angular Universal merged into Angular 4 mobile.twitter.com Nuxt.js

  74. Server-Side Java Support

  75. Cascading Style Sheets #app { background: #eee; } .blog-post {

    padding: 20px; } .blog-post > p:first { font-weight: 400; } img + span.caption { font-style: italic; }
  76. Sass: Syntactically Awesome Style Sheets #app { background: #eee; .blog-post

    { padding: 20px; > p:first { font-weight: 400; } img + span.caption { font-style: italic; } } } http://sass-lang.com
  77. CSS Frameworks

  78. Bootstrap 4

  79. Bootstrap 4

  80. CSS Framework Stars on GitHub April 2019 0 35,000 70,000

    105,000 140,000 Bootstrap Foundation Pure Skeleton Material Components
  81. CSS Framework Star History https://github.com/timqian/star-history

  82. Front End Performance Optimization Reduce HTTP Requests Gzip HTML, JavaScript,

    and CSS Far Future Expires Headers Code Minification Optimize Images
  83. HTTP/2 Binary, instead of textual Fully multiplexed, instead of ordered

    and blocking Can use one connection for parallelism Uses header compression to reduce overhead Allows servers to “push” responses proactively into client caches
  84. HTTP/2 Server Push in Java http://bit.ly/dz-server-push-java @WebServlet(value = {"/http2"}) public

    class Http2Servlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) { PushBuilder pushBuilder = req.newPushBuilder(); pushBuilder.path("images/kodedu-logo.png") .addHeader("content-type", "image/png") .push(); try (PrintWriter respWriter = resp.getWriter();) { respWriter.write("<html>" + "<img src='images/kodedu-logo.png'>" + "</html>"); } } }
  85. https://twitter.com/kosamari/status/859958929484337152

  86. https://twitter.com/kosamari/status/859958929484337152

  87. https://twitter.com/kosamari/status/859958929484337152

  88. Chrome Developer Tools Follow Umar Hansa - @umaar Follow Addy

    Osmani - @addyosmani
  89. Framework Tools Angular Augury React Developer Tools vue-devtools

  90. Progressive Web Apps

  91. “We’ve failed on mobile” — Alex Russell https://youtu.be/K1SFnrf4jZo

  92. Mobile Hates You! How to fight back: Implement PRPL Get

    a ~$150-200 unlocked Android (e.g. Moto G4) Use chrome://inspect && chrome://inspect?tracing Lighthouse DevTools Network & CPU Throttling
  93. The PRPL Pattern Push Render Pre-cache Lazy-load

  94. The PRPL Pattern Push critical resources for the initial URL

    route Render initial route Pre-cache remaining routes Lazy-load and create remaining routes on demand
  95. Learn More about PWAs https://developer.okta.com/blog/2017/07/20/the-ultimate-guide-to-progressive-web-applications

  96. “Reusable UI widgets created using open web technology.” - MDN

    Web Components consists of four technologies: Custom Elements HTML Templates Shadow DOM HTML Imports Web Components https://www.polymer-project.org https://stenciljs.com https://www.webcomponents.org
  97. None
  98. Security: OWASP Top 10 1. Injection 2. Broken Auth &

    Session Mgmt 3. Cross-Site Scripting (XSS) 4. Broken Access Control 5. Security Misconfiguration 6. Sensitive Data Exposure 7. Insufficient Attack Protection 8. Cross-Site Request Forgery 9. Components w/ Vulnerabilities 10. Underprotected APIs
  99. @spring_io #springio17 JHipster jhipster.tech JHipster is a development platform to

    generate, develop and deploy Spring Boot + Angular/React Web applications and Spring microservices. and Vue! ✨
  100. Get Started with JHipster 5 Demo https://github.com/mraible/jhipster5-demo | https://youtu.be/-VQ_SVkaXbs

  101. None
  102. JHipster 5 Tutorials and Videos Monolith https://github.com/mraible/jhipster5-demo Microservices https://developer.okta.com/blog/2018/03/01/develop- microservices-jhipster-oauth

  103. The JHipster Mini-Book Written with Asciidoctor Quick and to the

    point, 164 pages Developed a real world app: www.21-points.com Free Download from infoq.com/minibooks/jhipster-mini-book @jhipster_book
  104. What You Learned ES6 and TypeScript Node.js and nvm Angular,

    React, and Vue CSS and Sass Front End Performance Optimization Progressive Web Apps
  105. TRY

  106. Action! Don’t be afraid to try new things Learn JavaScript

    or TypeScript Try one of these frameworks Form your own opinions Or just wait a few months…
  107. None
  108. developer.okta.com/blog

  109. Questions? Keep in touch! raibledesigns.com @mraible Presentations speakerdeck.com/mraible Code github.com/oktadeveloper