Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×

Front End Development for Back End Developers - UberConf 2017

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio

Eche un vistazo a continuación

1 de 109 Anuncio

Front End Development for Back End Developers - UberConf 2017

Descargar para leer sin conexión

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 of the trade for frontend development (npm, yarn, Gulp, Webpack, Yeoman) and learn the basics of HTML, CSS, and JavaScript.

This presentation dives into the intricacies of Bootstrap, Material Design, ES6, and TypeScript. Finally, after getting you up to speed with all this new tech, I'll show how it can all be found and integrated through the fine and dandy JHipster project.

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 of the trade for frontend development (npm, yarn, Gulp, Webpack, Yeoman) and learn the basics of HTML, CSS, and JavaScript.

This presentation dives into the intricacies of Bootstrap, Material Design, ES6, and TypeScript. Finally, after getting you up to speed with all this new tech, I'll show how it can all be found and integrated through the fine and dandy JHipster project.

Anuncio
Anuncio

Más Contenido Relacionado

Presentaciones para usted (20)

Similares a Front End Development for Back End Developers - UberConf 2017 (20)

Anuncio

Más de Matt Raible (20)

Más reciente (20)

Anuncio

Front End Development for Back End Developers - UberConf 2017

  1. 1. Matt Raible | @mraible Front End Development for Back End Developers July 21, 2017 #UberConf17
  2. 2. Blogger on raibledesigns.com Web Developer and Java Champion Father, Skier, Mountain Biker, Whitewater Rafter Open Source Connoisseur Who is Matt Raible? Bus Lover Okta Developer Advocate
  3. 3. Authentication Standards
  4. 4. 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?
  5. 5. My Web Dev Journey
  6. 6. What is modern front end development?
  7. 7. Web Frameworks Over the Years https://github.com/mraible/history-of-web-frameworks-timeline
  8. 8. JSF https://zeroturnaround.com/webframeworksindex ❤
  9. 9. JavaScript Framework Explosion
  10. 10. Let’s do some learning!
  11. 11. ES6, ES7 and TypeScript ES5: es5.github.io ES6: git.io/es6features ES7: bit.ly/es7features TS: www.typescriptlang.org TSES7ES6ES5
  12. 12. 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
  13. 13. bus.ts
  14. 14. TypeScript 2.3
  15. 15. “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 https://github.com/creationix/nvm
  16. 16. Front End Build Tools Old School: Gulp New School: SystemJS Hip: Webpack Web Dependencies: Old School: Bower New School: npm Hip: yarn
  17. 17. Yeoman The web's scaffolding tool for modern webapps Helps you kickstart new projects Promotes the Yeoman workflow yeoman.io
  18. 18. Browsersync browsersync.io
  19. 19. Gulp gulp.task('serve', function() { browserSync.init({ server: './app' }); gulp.watch(['app/**/*.js', 'app/**/*.css', 'app/**/*.html']) .on('change', browserSync.reload); });
  20. 20. Webpack
  21. 21. 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'] } } ] } };
  22. 22. Cool Webpack Features webpack-bundle-analyzer webpack-dashboard
  23. 23. webpack for real tasks Building front-end and adding compilation Decreasing front-end size and improving assets caching Speeding up build and improving the development workflow iamakulov.com/pages/webpack
  24. 24. https://xkcd.com/303/
  25. 25. Leading JavaScript Frameworks in 2017 angular.io facebook.github.io/react vuejs.org
  26. 26. Jobs on Indeed July 21, 2017 0 2,000 4,000 6,000 8,000 Angular Aurelia Backbone Ember Knockout React Vue
  27. 27. Stack Overflow Tags July 21, 2017 0 17,500 35,000 52,500 70,000 Angular Aurelia Backbone Knockout Ember React Vue
  28. 28. Stack Overflow Trends https://stackoverflow.blog/2017/05/09/introducing-stack-overflow-trends
  29. 29. GitHub Stars July 21, 2017 0 20,000 40,000 60,000 80,000 Angular Aurelia Backbone Knockout Ember React Vue
  30. 30. GitHub Star History https://github.com/timqian/star-history
  31. 31. 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> https://angular.io/docs/ts/latest/quickstart.html
  32. 32. 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 { }
  33. 33. 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);
  34. 34. Angular CLI
  35. 35. Angular CLI
  36. 36. Get Started with Angular Angular QuickStart https://angular.io/docs/ts/latest/quickstart.html Angular Seed https://github.com/mgechev/angular-seed Angular Seed Advanced https://github.com/NathanWalker/angular-seed-advanced
  37. 37. Angular and Angular CLI Demos https://github.com/mraible/ng-demo https://youtu.be/Jq3szz2KOOs (Building) https://youtu.be/TksyjxipM4M (Testing)
  38. 38. Authentication with OpenID Connect http://developer.okta.com http://bit.ly/ng-okta youtube.com/watch?v=Kb56GzQ2pSk
  39. 39. ng-book 2 A comprehensive guide to developing with Angular 4 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
  40. 40. 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>
  41. 41. Learning React https://vimeo.com/213710634
  42. 42. Imperative Code if (count > 99) { if (!hasFile()) { 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);
  43. 43. 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> ); }
  44. 44. Create React App
  45. 45. Create React App
  46. 46. Ships with documentation!
  47. 47. 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>
  48. 48. Learning Vue.js https://youtu.be/utJGnK9D_UQ
  49. 49. 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>
  50. 50. Vue CLI
  51. 51. Server-Side Support Angular Universal merged into Angular 4 mobile.twitter.com Nuxt.js
  52. 52. Server-Side Java Support
  53. 53. Cascading Style Sheets #app { background: #eee; } .blog-post { padding: 20px; } .blog-post > p:first { font-weight: 400; } img + span.caption { font-style: italic; }
  54. 54. 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
  55. 55. CSS Frameworks
  56. 56. Bootstrap 4
  57. 57. Bootstrap 4
  58. 58. CSS Framework Stars on GitHub July 21, 2017 0 30,000 60,000 90,000 120,000 Bootstrap Foundation Pure Skeleton
  59. 59. CSS Framework Star History https://github.com/timqian/star-history
  60. 60. Front End Performance Optimization Reduce HTTP Requests Gzip HTML, JavaScript, and CSS Far Future Expires Headers Code Minification Optimize Images
  61. 61. 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
  62. 62. HTTP/2 in JHipster /* * Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288 * HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1. * See the JHipsterProperties class and your application-*.yml configuration files * for more information. */ if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0)) { if (container instanceof UndertowEmbeddedServletContainerFactory) { ((UndertowEmbeddedServletContainerFactory) container) .addBuilderCustomizers((builder) -> { builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true); }); } }
  63. 63. 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>"); } } }
  64. 64. https://twitter.com/kosamari/status/859958929484337152
  65. 65. Chrome Developer Tools Follow Umar Hansa - @umaar Follow Addy Osmani - @addyosmani
  66. 66. Framework Tools Angular Augury React Developer Tools vue-devtools
  67. 67. Progressive Web Apps
  68. 68. “We’ve failed on mobile” — Alex Russell https://youtu.be/K1SFnrf4jZo
  69. 69. 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
  70. 70. The PRPL Pattern Push Render Pre-cache Lazy-load
  71. 71. 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
  72. 72. 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
  73. 73. JHipster jhipster.github.io
  74. 74. Get Started with JHipster 4 Demo
  75. 75. JHipster 4 Tutorials and Videos Monolith https://github.com/mraible/jhipster4-demo Microservices https://developer.okta.com/blog/2017/06/20/develop- microservices-with-jhipster
  76. 76. The JHipster Mini-Book 2.0 Release on Dec 5, 2016 jhipster-book.com 21-points.com @jhipster_book Write your own InfoQ mini-book! github.com/mraible/infoq-mini-book
  77. 77. What You Learned ES6 and TypeScript Node.js and nvm Angular, React, and Vue.js CSS and Sass Front End Performance Optimization Progressive Web Apps
  78. 78. Try
  79. 79. #Devoxx4Kids
  80. 80. Quality “A person who knows how to fix motorcycles—with Quality—is less likely to run short of friends than one who doesn't. And they aren't going to see him as some kind of object either. Quality destroys objectivity every time.” — Zen and the Art of Motorcycle Maintenance
  81. 81. Software Testing With motorcycles, you drive to test them. With software, you can test it without driving it. Or rather, you can automate the driving. If you don’t automate tests, you’re still testing!
  82. 82. Unit Test Example
  83. 83. bus.spec.ts
  84. 84. Jest facebook.github.io/jest
  85. 85. 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…
  86. 86. developer.okta.com/blog/
  87. 87. Questions? Keep in touch! raibledesigns.com @mraible Presentations speakerdeck.com/mraible Code github.com/oktadeveloper

×