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

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

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 17, 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) Server Side Scripting {.js} Client Side Scripting
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  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 Rendering
  13. 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
  14. 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
  15. 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
  16. 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
  17. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Performance
  18. 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
  19. 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
  20. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Caching
  21. 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
  22. 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
  23. 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
  24. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Security
  25. 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
  26. 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)
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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
  32. 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
  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. 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
  35. <!DOCTYPE html> <html> <head> <title>EJS Demo</title> </head> <body> <h1>EJS Demo</h1>

    <% if(true){ %> <h4>Greetings from GeeCON 2024</h4> <% } %> </body> </html>
  36. <%@ 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>
  37. 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/
  38. 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
  39. 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
  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 6.1 https://jakarta.ee/speci fi cations/servlet/6.1/
  41. 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
  42. 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
  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 4.1 https://jakarta.ee/speci fi cations/faces/4.1/
  44. 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
  45. 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
  46. COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS

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

    // TODO:implement } void processView(ViewEngineContext ctx) throws ViewEngineException { // TODO:implement } }
  48. 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/
  49. COPYRIGHT (C) 2022, ECLIPSE FOUNDATION, INC. | THIS WORK IS

    LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Summary
  50. 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
  51. 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
  52. 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
  53. 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
  54. 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