Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Stefan Judis "Did we(b development) lose the right direction?"

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Wird geladen in …3
×

Hier ansehen

1 von 150 Anzeige

Stefan Judis "Did we(b development) lose the right direction?"

Herunterladen, um offline zu lesen

Keeping up with the state of web technology is one of the biggest challenges for us developers today. We invent new tools; we define new best practices, everything’s new, always... And we do all that for good user experience! We do all that to build the best possible web – it’s all about our users.

But is it, really? Or do developers like to play with technology secretly loving the new and shiny? Or do we only pretend that it’s about users, and behind closed doors, it’s developer experience that matters to us? Did we lose direction? Is it time for a critical look at the state of the web and the role JavaScript plays in it?

Keeping up with the state of web technology is one of the biggest challenges for us developers today. We invent new tools; we define new best practices, everything’s new, always... And we do all that for good user experience! We do all that to build the best possible web – it’s all about our users.

But is it, really? Or do developers like to play with technology secretly loving the new and shiny? Or do we only pretend that it’s about users, and behind closed doors, it’s developer experience that matters to us? Did we lose direction? Is it time for a critical look at the state of the web and the role JavaScript plays in it?

Anzeige
Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Ähnlich wie Stefan Judis "Did we(b development) lose the right direction?" (20)

Anzeige

Weitere von Fwdays (20)

Aktuellste (20)

Anzeige

Stefan Judis "Did we(b development) lose the right direction?"

  1. 1. @stefanjudis Did we(b development) lose the right direction?
  2. 2. The state of web development ten years ago...
  3. 3. yslow.org
  4. 4. 4waisenkinder.de
  5. 5. I love technology and I love writing JavaScript!
  6. 6. stefanjudis.com
  7. 7. Chrome – Cable iPhone 6 – 3G
  8. 8. Usually, any score above a 90 gets you in the top ~5% of performant websites. Lighthouse documentation
  9. 9. HTTP/2 Everything's compressed and minified!
  10. 10. github.com/webpack-contrib/webpack-bundle-analyzer Code splitting
  11. 11. www.fmboschetto.it
  12. 12. webpagetest.org/video/
  13. 13. webpagetest.org/video/view.php?id=200302_2df0157ba9ea8586f5d987f7a1c3d52ed5e2a874 Chrome – Cable
  14. 14. Stefan, you just messed it up!
  15. 15. Maybe, but how can it be so easy to mess up?
  16. 16. stefanjudis.comfmboschetto.it 4waisenkinder.de Overall page weight 340KB / 940KB265KB / 284KB 159KB / 300KB index.html 108KB / 340KB8KB / 32KB 6KB / 18KB CSS resources 10 1 Images resources 0*32 (246KB / 254KB) 0* Speed Index (LTE) 1.4s / 0.8s 2.1s / 0.7s 2.3s / 1.5s JS resources 22 (183KB / 512KB) 6 (68KB / 177KB) 2 (2KB / 6KB) *ignoring tracking pixel Lighthouse Perf Score 100 97 92
  17. 17. 3X - first contentful paint 1X - first meaningful paint 2X - first cpu idle 5X - time to interactive 4X - speed index 0X - estimated input latency JavaScript blocks the main-thread!
  18. 18. www.youtube.com/watch?v=Lx1cYJAVnzA
  19. 19. medium.com/dev-channel/a-netflix-web-performance-case-study-c0bcde26a9d9
  20. 20. A 150KB image is not comparable to 150KB of gzipped JavaScript!
  21. 21. Page weight is not equal page weight!
  22. 22. That's a 340KB index file for roughly 400 words, Stefan?
  23. 23. "It's great because it's fast! And it's still lighter than the rest of the internet..."
  24. 24. "It's great because it's still lighter than the rest of the internet..." "I'm really digging the tech-stack!"
  25. 25. That's a 340KB index file for roughly 400 words, Stefan? window.__DATA__=function( e,t,n,o,i,/* ... */ ){ return /* ... */ )
  26. 26. I decided to preload/inline 22 articles ... (at an average session length of 1.17 pages)
  27. 27. ... for "better performance".
  28. 28. Making a very fast website is extremely hard!
  29. 29. Making a very fast website is extremely hard! (But is it really?)
  30. 30. twitter.com/philhawksworth/status/1038440732741259265
  31. 31. www.youtube.com/watch?v=88K8oO_dYbI
  32. 32. www.youtube.com/watch?v=88K8oO_dYbI Today, I 100% disagree with "past me", ...
  33. 33. www.youtube.com/watch?v=88K8oO_dYbI ... because where is the user's benefit from such overhead?
  34. 34. A common "best practice" Universal JavaScript apps for content-sites
  35. 35. <!doctype html> <html lang=""> <head> <meta charset="utf-8"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="manifest" href="site.webmanifest"> <link rel="apple-touch-icon" href="icon.png"> <link rel="stylesheet" href="css/main.css"> <meta name="theme-color" content="#fafafa"> </head> <body> <p>Hello world!</p> <script src="js/plugins.js"></script> <script src="js/main.js"></script> </body> </html>
  36. 36. <!doctype html> <html lang=""> <head> <meta charset="utf-8"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="manifest" href="site.webmanifest"> <link rel="apple-touch-icon" href="icon.png"> <link rel="stylesheet" href="css/main.css"> <meta name="theme-color" content="#fafafa"> </head> <body> <p>Hello world!</p> <script src=“js/app-bundle-hash1.js”></script> <script src=“js/app-bundle-hash2.js”></script> <script src=“js/app-bundle-hash3.js”></script> <script>window.__data__ = { greeting: "Hello world!" }</script> </body> </html>
  37. 37. <!doctype html> <html lang=""> <head> <meta charset="utf-8"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="manifest" href="site.webmanifest"> <link rel="apple-touch-icon" href="icon.png"> <link rel="stylesheet" href="css/main.css"> <meta name="theme-color" content="#fafafa"> </head> <body> <p>Hello world!</p> <script src="js/plugins.js"></script> <script src="js/main.js"></script> <script>window.__data__ = { greeting: "Hello world!" }</script> </body> </html> The same code runs on the server and on the client!
  38. 38. Your content in HTML The same content in JavaScript
  39. 39. Is this really the best way for the user?
  40. 40. "This architecture offers doors to progressive enhancement!"
  41. 41. Base functionality Enhanced experience If the enhancement fails, it still works!
  42. 42. Updated search results Updated URL Submittable form
  43. 43. Buzzfeed twitter.com/philhawksworth/status/990890920672456707
  44. 44. "We don't have any non-JavaScript users" No, all your users are non-JS while they're downloading your JS. Jake Archibald
  45. 45. github.com POST github.com/stefanjudis/test/issue_comments handles a form and AJAX submit Five "old school" HTML links
  46. 46. I’m happy with GitHub's experience. A good site "just works".™
  47. 47. What's the enhancement in the wild, though?
  48. 48. reactjs.org with JavaScript reactjs.org without JavaScript 527KB / 1.7MB 41KB / 121KBInitial weight 547KB / 2.3MB 200KB / 1.0MB Weight after 4 navigations
  49. 49. I'm guilty of that, too!
  50. 50. Does this architecture improve user experience?
  51. 51. You get 6MB for 2Euros but you have only 24h to use them! Right...
  52. 52. httparchive.org/reports/state-of-the-web
  53. 53. httparchive.org/reports/state-of-the-web We ship more data for the same experience...
  54. 54. Maybe app frameworks are for apps after all?
  55. 55. 5.2MB / 17MB 25KB / 40KB
  56. 56. The web is not as cutting-edge as it seems...
  57. 57. ... boring is beautiful! (and fast)
  58. 58. "Benefits" of client-side routing
  59. 59. Developers are "allowed" to re-implement an accessible navigation
  60. 60. twitter.com
  61. 61. www.gatsbyjs.org/blog/2020-02-10-accessible-client-side-routing-improvements/
  62. 62. github.com/sdras/page-transitions-travelapp
  63. 63. There’s a chance I believe client side routing on the web is usually not preferred. Which is ironic. Ryan Florence (co-author React-Router) twitter.com/ryanflorence/status/1186515553285857280
  64. 64. We ship tailored experiences!
  65. 65. We ship tailored experiences! But do we really?
  66. 66. Aka... Could your parents deal with it?
  67. 67. .nav { animation: vibrate 0.3s linear; } @media (prefers-reduced-motion: reduce) { .nav { animation: none; } } window.matchMedia('(prefers-reduced-motion: reduce)')
  68. 68. People with vestibular disorder People on low battery People with limited time
  69. 69. .day { background: #eee; color: black; } .night { background: #333; color: white; } @media (prefers-color-scheme: dark) { .day { /* ... */ } .night { /* ... */ } } window.matchMedia('(prefers-color-scheme: dark)')
  70. 70. People sensible to bright screens People sitting in the dark People with a headache
  71. 71. .image { background-image: url("images/heavy.jpg"); } @media (prefers-reduced-data: reduce) { /* Save-Data: On */ .image { background-image: url("images/light.jpg"); } } navigator.connection.saveData // true save-data: on
  72. 72. twitter.com No consideration of save-data settings.
  73. 73. People with LIFI People tethering with their phone People unable to afford much data
  74. 74. navigator.connection.effectiveType // 'slow-2g', '2g', '3g', or '4g'
  75. 75. You can't know the user's context.
  76. 76. It should be easy for the user to adjust.
  77. 77. https://....
  78. 78. Save data https://.... Prefer reduced motion Prefer a dark interface
  79. 79. www.youtube.com/watch?v=_cMLVqyYCzU
  80. 80. Are we failing to ship a tailored user experience after all? (developers, browsers and operating systems)
  81. 81. A great site just works.™
  82. 82. HTML CSS JavaScript The foundation of the web
  83. 83. A great site doesn't have to be built with React/Vue/Angular/...
  84. 84. I need a new site what should I use? You should use Framework X with SSR, an offline strategy and it has to run "on the edge"! It depends... What's your use case?
  85. 85. A great site can be built with React, Vue, Angular...
  86. 86. A great site is accessible, fast, secure, ...
  87. 87. It's "just" HTML...
  88. 88. HTML defines over 100 elements
  89. 89. HTML defines 22 input types
  90. 90. css-tricks.com/a-complete-guide-to-links-and-buttons/ +4000 words!
  91. 91. <div aria-label="twitter" tabindex="0" role="button"> Twitter </div>
  92. 92. ... it's not "easy".
  93. 93. webaim.org/projects/million/
  94. 94. webaim.org/projects/million/
  95. 95. thenextweb.com/contributors/2018/03/10/protect-website-cryptojacking-attacks/
  96. 96. Content-Security-Policy: default-src 'self'; script-src 'self' just- comments.com www.google-analytics.com production- assets.codepen.io storage.googleapis.com; style-src 'self' 'unsafe- inline'; img-src 'self' data: images.contentful.com images.ctfassets.net www.gravatar.com www.google-analytics.com just-comments.com; font-src 'self' data:; connect-src 'self' cdn.contentful.com images.contentful.com videos.contentful.com images.ctfassets.net videos.ctfassets.net service.just-comments.com www.google- analytics.com; media-src 'self' videos.contentful.com videos.ctfassets.net; object-src 'self'; frame-src codepen.io; frame- ancestors 'self'; worker-src 'self'; block-all-mixed-content; manifest-src 'self' 'self'; disown-opener; prefetch-src 'self'; report-uri https:// stefanjudis.report-uri.com/r/d/csp/reportOnly
  97. 97. USE CSP DON'T USE CSP 94% 6%
  98. 98. httparchive.org/reports/state-of-the-web
  99. 99. The web loses quality...
  100. 100. ... but at least developers get more productive!
  101. 101. exports.sayHello = async (event) => { return 'Hello from Lambda!'; };
  102. 102. exports.sayHello = async (event) => { return { statusCode: 200, body: JSON.stringify({"msg": "Hello from Lambda!"}) }; };
  103. 103. The options are limitless to build a product quickly!
  104. 104. Hello world! 2010 10KB / 50KB Hello world! 2020 40KB / 130KB Complexity
  105. 105. I just added two helpers to tiny-helpers.dev. The site is great, but that I had to download 700MB of Node.js stuff is brutal. :)
  106. 106. A text editor A text editor, Node.js, npm, framework knowledge, …
  107. 107. I’ve been building on the web for 15+ years in some capacity, and it has never been so easy to build complex apps. Josh Comeau 100% agree! How many sites need to be complex apps, though?
  108. 108. Where are we going with this trend?
  109. 109. HTML CSS JavaScript React Vue Angular Svelte webpack Rollup Parcel AWS GCloud Netlify Zeit Heroku * * a very incomplete list
  110. 110. Complexity is king! (but what for?)
  111. 111. twitter.com/_developit/status/1214258470226190350
  112. 112. (function() { const fakeButton = document.querySelector('[data-menu-button]'); const menu = document.querySelector('[data-menu]'); const toggleMenuButton = document.createElement('button'); toggleMenuButton.textContent = fakeButton.textContent; toggleMenuButton.setAttribute('aria-expanded', false); toggleMenuButton.setAttribute('aria-controls', 'menu'); toggleMenuButton.classList.add('nav__toggle'); fakeButton.parentNode.replaceChild(toggleMenuButton, fakeButton); toggleMenuButton.addEventListener('click', function() { let expanded = this.getAttribute('aria-expanded') === 'true' || false; this.setAttribute('aria-expanded', !expanded); menu.hidden = !menu.hidden; }); menu.hidden = true; })() justmarkup.com/articles/2019-12-04-hamburger-menu/ 16 lines of hand-written JavaScript
  113. 113. Maybe we'll have good enough abstractions one day, but today…
  114. 114. … you still have to know web fundamentals to create the best user experience.
  115. 115. You're shaping tomorrow's job market based on the technology choices you make today. Henrik Joreteg
  116. 116. Your job as a web developer is to build beautiful experiences!
  117. 117. Your job as a web developer is to build beautiful experiences! Your job as a developer is to decide, to decide what tools to use, to decide what frameworks to use, to decide what to prioritize, to decide what is the best way to maintain a project. Michael Scharnagl
  118. 118. Chatted with someone who’s been working at a company as a front-end developer for 3 years. Their friend asked them to help build a website, but they had to decline. They didn’t know how. Chris Coyier (css-tricks.com)
  119. 119. HTML CSS JavaScript React Vue Angular Svelte webpack Rollup Parcel AWS GCloud Netlify Zeit Heroku * * a very incomplete list
  120. 120. css-tricks.com/the-great-divide/
  121. 121. css-tricks.com/the-great-divide/
  122. 122. css-tricks.com/the-great-divide/
  123. 123. Your users don't care about your technical implementation.
  124. 124. DX(developer experience) UX(user experience)
  125. 125. I love shiny tools and I love writing JavaScript...
  126. 126. ... but maybe we should take a step back? And consider the right tools for the best user experience?
  127. 127. ... but maybe we should take a step back? And consider the right tools for the best user experience? twitter.com/slightlylate/status/1232147434727280640
  128. 128. Maybe our focus should be more on building sites that just work! (And less on the technology behind these)
  129. 129. @stefanjudis www.stefanjudis.com Thanks.

×