Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Final Frontier of Web Development: React Se...

The Final Frontier of Web Development: React Server Components vs Jakarta EE

React Server Components allow you to write web user interfaces that can be rendered and optionally cached on the server. Sounds familiar? It may be time to dust off the well-proven server-side rendering technologies on the Java side now that the JavaScript world seems to be catching up.

In this session, I will go through the benefits of server-side rendering and show how easy it is to do this with existing technologies in Java.

Who knows, maybe I will get my hands dirty and demo some JavaScript as well for comparison.

ivargrimstad

May 28, 2024
Tweet

More Decks by ivargrimstad

Other Decks in Programming

Transcript

  1. The Final Frontier of Web Development React Server Components vs

    Jakarta EE Ivar Grimstad
 Jakarta EE Developer Advocate Eclipse Foundation
  2. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0)
  3. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Why This Talk?
  4. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Server Side Rendering Is HOT Again
  5. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Disclaimer!
  6. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) I don’t know JavaScript…
  7. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) NOTE: No versus
  8. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Server Side Scripting {.js} Client Side Scripting
  9. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Client Side Server Side
  10. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Nothing FINAL
  11. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Web Development
  12. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Client Side vs Server Side
  13. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Client Side Rendering
  14. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Browser Server Click Response Request JS
  15. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Server Side Rendering
  16. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Browser Server Click Response Request HTM HTM
  17. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Advantages of Server Side Rendering
  18. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Performance
  19. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Initial Page Load
  20. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Browser Server Click Response Request JS
  21. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Caching
  22. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Browser Server Click Response Request HTM HTM
  23. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Data Fetching
  24. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Browser Server Response Request
  25. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Security
  26. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Server Side Rendering Client Side Rendering Browser Server - API Keys - Data - Logic Security
  27. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Search Engine Optimisation (SEO)
  28. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Speci fi cation Document API TCK Final Speci fi cation Compatible Implementation(s) Speci fi
  29. Jakarta EE 10 Platform Updated Not Updated New Authorization 2.1

    Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0
  30. RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0

    Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Data 1.0 Authorization 3.0 Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 Jakarta EE 11 Platform Jakarta EE 11 Web Pro fi Updated Not Updated New
  31. Jakarta EE 11 Web Pro fi le RESTful Web Services

    4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Data 1.0 Jakarta EE 11 Core Pro fi Updated Not Updated New
  32. Jakarta EE 11 Core Pro fi le Updated Not Updated

    New RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0
  33. Jakarta EE 11 Platform Updated Not Updated New Authorization 3.0

    Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0
  34. Jakarta EE 11 Platform Updated Not Updated New Authorization 3.0

    Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0
  35. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Pages (JSP) DEMO
  36. <!DOCTYPE html> <html> <head> <title>EJS Demo</title> </head> <body> <h1>EJS Demo</h1>

    <% if(true){ %> <h4>Greetings from GeeCON 2024</h4> <% } %> </body> </html>
  37. <%@ page contentType="text/html;charset=UTF-8" language=“java" %> <html> <head> <title>JSP Demo</title> </head>

    <body> <h1>JSP Demo</h1> <% if(true){ %> <h4>Greetings from GeeCON 2024</h4> <% } %> </body> </html>
  38. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Pages 4.0 https://jakarta.ee/speci fi cations/pages/4.0/
  39. Jakarta EE 11 Platform Updated Not Updated New Authorization 3.0

    Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0
  40. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Servlet DEMO
  41. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Servlet 6.1 https://jakarta.ee/speci fi cations/servlet/6.1/
  42. Jakarta EE 11 Platform Updated Not Updated New Authorization 3.0

    Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0
  43. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Faces (JSF) DEMO
  44. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Faces 4.1 https://jakarta.ee/speci fi cations/faces/4.1/
  45. Jakarta EE 11 Platform Updated Not Updated New Authorization 3.0

    Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0 MVC 3.0
  46. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta MVC DEMO
  47. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) + ?
  48. public class HtmxViewEngine implements ViewEngine { boolean supports(String view) {

    // TODO:implement } void processView(ViewEngineContext ctx) throws ViewEngineException { // TODO:implement } }
  49. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta MVC Standardizes the action-based model-view-controller pattern https://jakarta.ee/speci fi cations/mvc/
  50. COPYRIGHT (C) 2022, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Summary
  51. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Server Side Rendering Is HOT Again
  52. Jakarta EE 10 Platform Updated Not Updated New Authorization 2.1

    Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0
  53. Authorization 3.0 Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1

    Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0 Com ing This July
  54. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) 2022 2024 2020 Java 21 Embrace Records Jakarta Data CDI Centric Removals and Deprecations javax.* -> jakarta.* Jakarta EE Core Pro fi le
  55. Jakarta EE https://jakarta.ee Get Started
 https://start.jakarta.ee Ivar’s Hashtag Jakarta EE

    https://www.agilejava.eu/category/jakarta-ee/ Demo Code https://github.com/ivargrimstad/dukes-server- components