DjangoCon 2022 | From React to htmx on a real-world SaaS product: we did it, and it's awesome!

DjangoCon Europe
15 Oct 202226:45

Summary

TLDRDavid Guillo from France shares his experience replacing React with HTMX in a SaaS product at Context. He highlights the benefits of using HTMX for creating rich, responsive UIs without the need for complex JavaScript frameworks like React. Through a demo, he illustrates how HTMX simplifies state management and UI component creation within Django, leading to faster performance, reduced code complexity, and improved team agility. David emphasizes that HTMX offers a viable alternative for teams seeking a more streamlined approach to frontend development while maintaining product agility.

Takeaways

  • 🌐 David Guillo, a French web industry veteran, shares his experience with replacing React in a SaaS product with htmx.
  • 🚀 htmx is a JavaScript library that enhances web interfaces by listening to events, making AJAX calls, and updating the DOM without full page reloads.
  • 🛠️ Guillo challenges the common belief that a rich user experience on the web requires a JavaScript framework like React, suggesting htmx as a viable alternative.
  • 🔍 He demonstrates that web components can be achieved on the server side, using a library within Django templating, to create isolated, reusable UI elements.
  • 🎨 The speaker showcases a sophisticated UI in their product, emphasizing the importance of smooth animations, quick rendering, and user interaction without page reloads.
  • 📈 Guillo presents a case study where htmx improved performance, reduced memory usage, and increased team agility compared to their previous React implementation.
  • 📝 The switch to htmx resulted in a cleaner, lighter DOM structure, allowing for better performance and more efficient handling of large datasets.
  • 👨‍💻 The team at Context transitioned from a back-end focused approach to full-stack development, improving collaboration and feature development speed.
  • 📉 The transition also led to a significant reduction in codebase size, with 15,000 lines of code deleted, streamlining the development process.
  • 🤔 Guillo encourages developers to consider their team's needs and the nature of front-end development when choosing between htmx and other JavaScript frameworks.
  • 🌟 Context is hiring, and the presentation concludes with an invitation to connect for potential job opportunities.

Q & A

  • Who is the speaker, and what is their background?

    -The speaker is David Guillo, from France. He has been in the web industry for 15 years and has been a Django developer for 5 years. He works at a company called Context.

  • What is the main topic of the presentation?

    -The main topic is an experiment conducted by the speaker's company to replace React with HTMX in a SaaS product that was already in production.

  • What are the key goals of the presentation?

    -The goals are to break some common misbeliefs about front-end development, showcase the UI built with HTMX, share code examples, tell the story of the experiment, and provide thoughts and learnings from the experience.

  • What is HTMX, and how does it work?

    -HTMX is a JavaScript library that listens to events and triggers Ajax calls to fetch HTML fragments and insert them into the DOM. It allows developers to react to application state changes without reloading the entire page.

  • How does HTMX compare to using a JavaScript framework like React for rich UI development?

    -HTMX provides a simpler alternative by allowing server-side management of application state, avoiding the need for client-side state duplication, and enabling rich UI elements without heavy JavaScript frameworks like React.

  • Can you explain how Django components are used in this project?

    -Django components are used to create isolated, reusable web components that bring together HTML templates, CSS, and JavaScript. These components can be customized and reused throughout the application, providing a way to build rich UI elements on the server side.

  • What were some key challenges faced with the React-based approach?

    -The React-based approach led to slow UI performance, deep DOM trees, low team velocity, and poor code quality on the front-end side. The complexity of maintaining a single-page application (SPA) also contributed to these issues.

  • What were the outcomes of replacing React with HTMX?

    -Replacing React with HTMX resulted in improved performance, faster time to interactive, lower memory usage on the client side, and enhanced product agility. The team was able to ship features faster and with better code quality.

  • What are the potential trade-offs when using HTMX instead of React?

    -While HTMX simplifies front-end development and improves product agility, it may not be the best fit for teams that prefer a heavy separation of concerns between back-end and front-end. HTMX integrates the front-end and back-end more closely.

  • What advice does the speaker give to teams considering HTMX?

    -The speaker advises teams to consider their needs for product agility, front-end development preferences, and team structure. If product agility and a simpler, more integrated front-end are important, HTMX could be a good choice.

Outlines

00:00

🖥️ Introduction to David Guillo's Background and Experiment

David Guillo, a seasoned web developer from France with 15 years of experience, introduces himself and his work at Context, a French company. He shares his intention to discuss an experiment conducted at his workplace involving the replacement of React with HTMX in a production-level SaaS product. The talk is structured to dispel common misconceptions about frontend development, showcase the UI and code, narrate the journey, and conclude with reflections and learnings. David challenges the conventional belief that a rich user experience (UX) requires a React-based single-page application (SPA), suggesting that a rich UX is about creating a seamless user interface where interactions feel native without reloading the entire page.

05:00

📊 Demonstrating the UI and HTMX Implementation

David introduces a key UI screen from their product in production, which features a sophisticated navigation timeline and an article text column. He explains how the interface, despite its complexity, functions smoothly with HTMX rather than relying on traditional client-side state management. For instance, a list of over 1,000 items can be filtered and searched without lag, demonstrating the power of HTMX in handling heavy data with minimal JavaScript. He emphasizes that actions like marking articles as favorites are achieved without client-side state management, showcasing the simplicity and efficiency of HTMX.

10:01

🛠️ Simplifying Application State Management with HTMX

David delves deeper into the technical details, explaining how application state management is handled seamlessly with HTMX. He illustrates this by showing how an article's favorite status is updated in the UI without any client-side JavaScript. Instead, HTMX handles the interaction through simple Django views and templates, using minimal HTML and HTMX attributes. This approach allows for sophisticated state management while keeping the codebase clean and avoiding the complexities of traditional JavaScript frameworks.

15:05

🔧 Achieving Rich UI Elements with Server-Side Components

David highlights how rich UI elements, such as custom dropdowns and internal search features, are implemented using server-side components in Django, with a combination of HTML templates, CSS, and minimal JavaScript. He describes the flexibility and reusability of these components, which are managed entirely on the server side, making them easy to test, upgrade, and customize. This method ensures that the UI remains rich and interactive while maintaining a clean and manageable codebase.

20:05

🚀 Transitioning from React to HTMX for Enhanced Performance

David recounts the initial challenges his team faced when using React for their SaaS product. Despite following industry recommendations to use React for client-side state management and web components, the resulting UI was slow and difficult to maintain. This led David to experiment with server-side rendering using Django and HTMX, which resulted in a significant improvement in performance, code quality, and team efficiency. He emphasizes that the switch to HTMX allowed for a faster, more agile development process without sacrificing the rich UX that their product required.

25:06

📉 Simplifying Codebase and Enhancing Developer Collaboration

David discusses the positive impact of transitioning to HTMX on his team and codebase. The team was able to significantly reduce the amount of code, deleting 15,000 lines, and shift from a specialized front-end/back-end division to a more integrated full-stack approach. This transition allowed developers to collaborate more closely with designers and take ownership of features from start to finish. David also shares the improved project management practices that emerged from this change, highlighting the benefits of a simplified, less segmented codebase.

🤔 Key Takeaways and Final Thoughts on HTMX

In his concluding remarks, David offers insights into the decision-making process for adopting HTMX. He stresses the importance of aligning the choice of technology with the team's needs and business goals. While HTMX may not be the best fit for teams accustomed to a strict separation of frontend and backend concerns, it offers significant advantages in terms of product agility and simplicity. David asserts that HTMX allows for a more holistic approach to frontend development, enabling teams to build rich, interactive UIs without the complexity of traditional JavaScript frameworks. He closes by encouraging others to consider HTMX for their projects and expresses gratitude to his colleagues for their support.

Mindmap

Keywords

💡HTMX

HTMX is a JavaScript library that allows for dynamic updates of web pages without requiring a full reload. It listens for JavaScript events, sends AJAX calls, retrieves HTML fragments, and injects them into the DOM. In the video, HTMX is presented as an alternative to React for creating a rich user interface (UI) on the web, emphasizing that it can manage application state changes and UI components without the need for heavy client-side JavaScript frameworks.

💡React

React is a popular JavaScript library used for building user interfaces, particularly single-page applications (SPAs). The video discusses React as the traditional choice for creating a rich user experience (UX) on the web, requiring developers to manage application state on the client side. The speaker contrasts React with HTMX, highlighting that while React is powerful, it can lead to complexity and performance issues, especially in scenarios where a simpler solution like HTMX might suffice.

💡Single Page Application (SPA)

A Single Page Application (SPA) is a type of web application that loads a single HTML page and dynamically updates the content as the user interacts with the app. SPAs typically rely on JavaScript frameworks like React to manage the application state and UI updates on the client side. In the video, the speaker critiques the complexity of SPAs and suggests that for certain use cases, a server-rendered approach using HTMX might be more efficient.

💡Django

Django is a high-level Python web framework that enables rapid development of secure and maintainable websites. The speaker in the video mentions Django in the context of building web applications with server-side rendering. He introduces a library that allows for the creation of web components within Django templates, demonstrating how Django can be used in conjunction with HTMX to achieve a rich user interface without relying on JavaScript-heavy frameworks like React.

💡Web Components

Web Components are reusable, encapsulated UI elements that can be used across different parts of a web application. They typically consist of HTML, CSS, and JavaScript working together to create complex UI elements. In the video, the speaker explains how Web Components can be implemented on the server side using Django, without the need for a client-side JavaScript framework. This approach allows for the creation of isolated and reusable components, contributing to a clean and maintainable codebase.

💡User Experience (UX)

User Experience (UX) refers to the overall experience a user has when interacting with a website or application, including the ease of use, efficiency, and satisfaction. The speaker emphasizes the importance of a rich UX, where users can interact with the interface seamlessly, without noticing they are using a web browser. He argues that HTMX can achieve this by providing smooth interactions and state changes without requiring a full page reload, challenging the notion that a JavaScript framework like React is necessary for a rich UX.

💡AJAX

AJAX stands for Asynchronous JavaScript and XML, a technique used to update parts of a web page without reloading the entire page. In the video, HTMX leverages AJAX to retrieve HTML fragments from the server and insert them into the DOM. This approach allows for dynamic updates and interactions within a web application, contributing to a more responsive user experience without the overhead of a full client-side application.

💡Server-Side Rendering

Server-Side Rendering (SSR) is the process of rendering web pages on the server rather than in the browser. This approach often results in faster initial page loads and improved SEO. The speaker advocates for SSR using Django in combination with HTMX, as it simplifies the development process by keeping the logic on the server side, reducing the need for complex client-side JavaScript, and improving performance, especially for content-heavy applications.

💡Application State Management

Application State Management refers to how a web application manages and synchronizes the state of various components and data across the interface. Traditional approaches, like using React, involve managing the state on the client side, often resulting in complex code. The speaker in the video demonstrates how HTMX can manage state changes through server-side updates, reducing the need for client-side state management and simplifying the overall architecture.

💡Product Agility

Product Agility refers to the ability of a development team to quickly adapt and make changes to a product based on feedback or new requirements. In the video, the speaker highlights how adopting HTMX and a server-side approach has increased the agility of his team. By reducing the complexity of the codebase and eliminating the need for a dedicated front-end framework like React, the team was able to iterate faster, improve performance, and maintain a higher quality of code.

Highlights

David Guillo discusses his 15 years of experience in the web industry, including five years as a Django developer.

The talk focuses on an experiment where a SaaS product in production replaced React with HTMX.

HTMX allows for modern, rich UI experiences on the web without relying heavily on JavaScript frameworks like React.

Guillo challenges the common belief that a rich UX on the web requires a full client-side application like a single-page app.

HTMX operates by listening to JavaScript events, making AJAX calls, and inserting HTML fragments into the DOM, simplifying the process.

Web components can be achieved on the server side in Django by using a library that integrates HTML, CSS, and JavaScript.

In the demo, Guillo showcases a sophisticated UI in production, illustrating how HTMX handles application state changes efficiently.

The demo includes a screen with a navigation timeline, a text section, and a large list of items, all managed without client-side state management.

The UI supports features like marking articles as favorites and filtering large lists, all handled by HTMX without heavy JavaScript.

Guillo explains that their approach allowed them to remove 15,000 lines of code, significantly simplifying their codebase.

By shifting from React to HTMX, the team improved performance, especially on first load, and reduced client-side memory usage.

The transition also enabled the backend developers to become full-stack, increasing their involvement in front-end development.

The team's product agility improved, allowing for faster shipping and reducing debates over API contracts.

Guillo encourages teams to consider their needs when choosing between HTMX and a JavaScript framework like React.

The presentation concludes with an invitation to consider HTMX for teams seeking faster development and simpler front-end architectures.

Transcripts

play00:00

well hello everyone I hope you can hear

play00:03

me

play00:04

my name is David Guillo I'm from France

play00:07

as you can hear

play00:11

um I've been in the web industry for 15

play00:13

years I've been a jungle developer for

play00:16

five years I work at context yes it's

play00:20

the French word for context

play00:23

and I'm here to talk to you about an

play00:27

experiment we we've been running at my

play00:29

work it's about replacing react with

play00:33

htmx on a SAS product that was already

play00:36

in production

play00:38

and it's a good experience

play00:43

so this talk is about

play00:45

realizing what is possible when it comes

play00:48

to

play00:49

a modern UI Rich UI on the web so I'll

play00:55

start by breaking some misbeliefs about

play00:58

front-end development

play01:00

I will show you our UI I will show you

play01:04

some code

play01:05

then I will tell you our story

play01:08

and finally I will share some thoughts

play01:11

and learning about all this

play01:16

so

play01:17

um

play01:19

this is the the cover of htmx Twitter

play01:23

account

play01:24

um

play01:25

it's creative commands by the way

play01:28

um

play01:29

you've heard for too many years now that

play01:32

uh

play01:33

for a rich ux on the web you need you

play01:37

have to go the react way you have to

play01:40

to build an API and build a single page

play01:43

app and

play01:44

you will have everything you need

play01:46

probably the reality is a bit more open

play01:49

than that

play01:51

because

play01:52

what makes a ux rich

play01:56

probably there is something about making

play01:59

the user forgetting they are looking at

play02:02

a web browser

play02:04

um

play02:06

for example when the user acts on your

play02:10

interface and they changes the the

play02:13

application state

play02:14

you want to react to this change and you

play02:18

don't want to reload the full page

play02:20

because it's so

play02:22

205

play02:26

um

play02:26

another part is you you want to have

play02:29

some beautiful UI elements smooth

play02:32

reliable reusable accessible like the

play02:36

ones you've got on your phone

play02:39

and

play02:42

you've heard that to get all this

play02:45

you need to go the JavaScript

play02:47

application framework way like reactor

play02:51

something else

play02:54

but

play02:56

when it comes to reacting to application

play02:58

State changes

play03:00

you you will hear that

play03:03

you need an application on the client

play03:07

side to to duplicate the application

play03:09

State on the client side to to be able

play03:12

to react very smoothly

play03:15

probably

play03:17

there are other ways and htmx is one of

play03:20

them

play03:21

so htmx what is it basically it's

play03:24

listening to JavaScript events

play03:27

in order to fire some Ajax calls get him

play03:31

getting some HTML fragments and

play03:34

inserting this HTML fragment into the

play03:37

Dom

play03:38

that's it

play03:43

when it comes to

play03:45

web components because that's I was

play03:47

that's what I was talking about when

play03:49

when I said Rich UI elements

play03:53

the the best way the the design pattern

play03:56

to get rich UI elements is to build

play04:00

isolated reusable components that that

play04:04

are PCS of HTML code CSS code and

play04:07

JavaScript code that will work together

play04:09

in order to get

play04:11

some beautiful UI element that you will

play04:13

be able to reuse

play04:15

anywhere in your application and even in

play04:18

other applications

play04:20

and we were told that in order to

play04:23

achieve that

play04:24

we need JavaScript application

play04:27

Frameworks that force you to think

play04:30

component oriented oriented and to get

play04:33

web components

play04:36

now is it possible on the server side in

play04:39

jungle world yes it is

play04:42

this guy

play04:44

implemented some

play04:46

library that that allows you to to get

play04:50

web components

play04:53

within Django templating and I will show

play04:56

you some code about it

play05:00

now it's demo time

play05:02

um I will show you our UI in our product

play05:06

and production

play05:08

um it's quite sophisticated screen that

play05:11

I will show you and when it comes to ux

play05:15

I will present it briefly first and then

play05:19

I will dive into two features I want to

play05:22

show you to illustrate application State

play05:24

changes and UI elements

play05:30

so

play05:32

there it comes

play05:35

so this is a a screen that is quite

play05:41

Central in in our user experience at the

play05:44

top you get

play05:45

a navigation timeline

play05:47

so it's a series of steps when you click

play05:52

on one of them you get a beautiful

play05:53

animation you get some stuff that

play05:55

reloads on the bottom of the page

play05:57

I can close that for now

play06:00

on the right column you get a text

play06:03

it can be a huge text but it's just text

play06:07

the rendering is very quick

play06:10

this text is split into articles the

play06:13

Articles can be seen

play06:16

just when opening the table of contents

play06:19

I can mark an article as favorite

play06:22

When I close my table of contents My

play06:24

article has been marked as my favorite

play06:26

here

play06:27

is it client-side application State

play06:29

Management no it isn't it's htmx

play06:33

it's just

play06:35

a JavaScript event

play06:38

triggering some

play06:40

very very located reload

play06:45

on the left side you've got

play06:48

a list of items that are related to the

play06:50

text

play06:51

this list of items can be quite huge

play06:54

here we have more than 1000 items in

play06:58

this list

play07:01

huge and it works it doesn't lag

play07:05

and this list can be filtered

play07:09

for example by articles there are two 10

play07:13

items related to article 2.

play07:17

easy htmx stuff

play07:22

I can also

play07:24

search something

play07:27

they all match

play07:29

um

play07:30

no no example search on this one

play07:34

and

play07:35

let's reset now let's dive into

play07:39

[Music]

play07:41

one feature that illustrates quite

play07:44

sophisticated

play07:45

application State Management

play07:48

that you you could think it is at least

play07:51

so in this face set filter I have

play07:55

all my articles with counters of results

play08:01

and at the top of the of the filter I

play08:03

have a special bucket here which is all

play08:06

the Articles I'm interested in

play08:09

all the articles I marked as favorite so

play08:12

for now I have only Article 1 and

play08:16

Article 2 as favorites

play08:18

so the counter is

play08:21

127 results because it's 117 Plus 10.

play08:27

what happens if I'm not interested in

play08:30

article

play08:30

first anymore

play08:34

just here the counter has been updated

play08:37

is it some client-side application State

play08:40

Management no is there some JavaScript

play08:42

for achieving this no zero line of

play08:46

JavaScript

play08:47

this is just htmx all the way do you

play08:50

want to see how it works

play08:55

let's Dive In

play08:56

so this is the

play09:00

the jungle View for the watch button I

play09:03

hope this is readable on big screen

play09:06

obviously I have a post method and uh

play09:10

when I build my HTTP response with the

play09:14

star becoming yellow or green according

play09:19

according the post or delete method

play09:24

let's join this

play09:28

HTTP header which is a special HTTP

play09:31

header that htmx understand on the

play09:34

client side

play09:36

now my small

play09:39

counter here actually it's the whole

play09:41

line

play09:43

in my HTML template

play09:45

which is

play09:47

here

play09:48

it's just an empty div

play09:52

with a bunch of htmx attributes

play09:55

and this empty div

play09:57

is about to to get its content from the

play10:00

server

play10:01

on page load and also

play10:04

when an article is watched and when an

play10:07

article is unwatched

play10:09

this is quite simple isn't it

play10:13

and then you have application State

play10:15

Management without writing a single line

play10:18

of client-side code

play10:22

the second feature I wanted to show you

play10:23

is about rich UI elements

play10:28

uh actually you've seen them already

play10:30

it's these facet filters we have three

play10:34

of them

play10:36

um

play10:36

it's actually a quite sophisticated UI

play10:39

element because

play10:41

it's a custom drop down you've already

play10:43

did probably search things

play10:47

I can close it when I click anywhere I

play10:51

can close it by hitting Escape there is

play10:54

some internal search

play10:57

oh there is nautical uh not on articles

play11:02

article one an article 9 for example

play11:06

um

play11:07

this is some JavaScript of course

play11:09

because it is client-side pure user

play11:12

interaction

play11:15

but these elements are actually web

play11:18

components made on Jungle side

play11:22

so

play11:24

I have a

play11:28

face it template which is a regular

play11:32

jungle template that will

play11:35

take some input the the bucket the

play11:38

values what the user selected Etc

play11:42

and this face said this HTML

play11:45

template is working with

play11:48

in my static folder components face it I

play11:52

have some CSS code

play11:55

and I also have some JavaScript for

play11:58

example to to handle the internal search

play12:00

stuff

play12:01

we use stimulus on JavaScript but you

play12:06

can use whatever you want

play12:08

and all of this is working together

play12:11

through

play12:16

uh jungle components and jungle

play12:19

components allow you to

play12:21

declare a component here

play12:23

that make that bring together the

play12:26

template the CSS and the JavaScript

play12:29

and that makes you able to

play12:32

to pass some data into it

play12:36

and this is how you achieve a UI web

play12:40

components on server side with jungle

play12:43

components

play12:45

and how do you use it I will open my

play12:49

base template again

play12:52

and here it goes we were there two

play12:55

minutes ago

play12:57

you have your component

play13:00

and so it's really completely reusable I

play13:05

have another one here for another field

play13:08

in my data

play13:10

and I passed the the buckets into it I

play13:14

pass whatever you the user selected in

play13:17

order to

play13:19

to mug them

play13:23

this way

play13:26

and

play13:27

I have slots slots allowing me to to do

play13:32

special stuff to customize for example

play13:35

this filter you've got some

play13:38

color dots uh

play13:42

aside the aside the values aside the

play13:46

bucket names

play13:47

here it goes I have my slot and I have

play13:50

the possibility to to customize some

play13:53

stuff in there

play13:54

so it's reusable it's isolated

play13:58

we can unit test it if we want we can

play14:02

upgrade it add some features

play14:04

independently from its usage in our

play14:06

application and that's the whole point

play14:08

of web components

play14:12

so that's the end of the demo part

play14:15

um

play14:16

I hope at this point you are convinced

play14:18

that yes our UI is quite quite Rich

play14:21

offers a rich user experience and no our

play14:25

code is not spaghettical because we

play14:27

don't have code htmx does everything

play14:30

almost everything for us

play14:35

now about our experience at context and

play14:40

the road wasn't always like this the

play14:43

project this project started in 2017

play14:47

it's a quite complex project especially

play14:51

on the back-end side there are many

play14:54

domain complex domain stuff but on the

play14:59

front-end side

play15:00

in 2017 we were a very very small team

play15:04

it was our first SAS product and we

play15:09

asked around us how do we do that and

play15:12

everybody told us the same thing

play15:14

it's 2017 guys go the react way build an

play15:19

API bindle spa and you will achieve

play15:23

client-side application application

play15:25

State Management you will get a

play15:28

separation of concerns between your

play15:31

backend and your front end you will get

play15:34

web components

play15:36

it's the modern way to go

play15:38

so we tried it we hired a JavaScript

play15:41

developer we I was in charge of the API

play15:45

among other things and

play15:49

it was quite of a kind of okay

play15:53

we were able to to deploy it to

play15:56

production

play15:58

but

play15:59

the UI was was very very slow

play16:04

because the the API contract was not

play16:08

optimal

play16:09

because the the Dom tree was way too

play16:14

deep and as you as you have seen we have

play16:18

lots of information to to put into the

play16:21

browser

play16:22

[Music]

play16:23

um

play16:24

and uh we had a very very low team

play16:28

velocity and that was a big problem

play16:31

because we were trying to launch a

play16:33

product uh we were trying to to have

play16:37

people buy our product so we needed to

play16:39

to to be agile about it

play16:42

and uh

play16:44

there were no code quality on the

play16:47

front-end side because the JavaScript

play16:49

developer was alone and he was

play16:52

overwhelmed with all the complexity of

play16:54

making an Spa

play16:57

um

play16:58

so when I heard about

play17:02

Phoenix live view in The Elixir world

play17:05

when I heard about hotwired in the Ruby

play17:08

world

play17:09

when I heard about unpoli htmx

play17:14

I had an idea I created a proof of

play17:18

concept I duplicated our UI which was

play17:23

all react I duplicated it with several

play17:26

rendered Django templates and just a bit

play17:30

of htmx

play17:31

in one month of work the code was ugly

play17:35

as hell but the proof was there it was

play17:38

working the performances were good

play17:41

let's refactor it one month later we had

play17:44

web components we had uh code quality we

play17:48

had we even had tests but we didn't have

play17:51

before on the on the react World

play17:56

so

play17:59

consequences on the ux were there some

play18:02

negative consequences on the ux no we we

play18:05

made no trade-offs I can't think of a

play18:09

feature we used to have and we don't

play18:11

have any more

play18:13

and it open it even opens some new

play18:15

possibilities some new opportunities

play18:18

um for example on the the left column

play18:21

you've seen earlier which has many many

play18:23

many items

play18:25

on the react World the the dumb tree was

play18:29

so deep and so heavy

play18:32

that this colon was able to display only

play18:36

50 items at a time and so you had to

play18:39

scroll to display to replace the 50

play18:41

items Etc and

play18:44

it was terrible

play18:46

now that we have a

play18:49

quite clean and as light as possible Dom

play18:53

tree

play18:54

we are able to display thousands of

play18:56

elements and no lags

play19:02

whatever web Turf

play19:04

we measured time to Interactive

play19:08

um

play19:08

[Music]

play19:10

on three scenarios jungle and react

play19:13

jungle API and react on first load then

play19:16

on second load

play19:17

and with htmx htmx is at least as fast

play19:22

as the react second load on first load

play19:26

is way faster

play19:28

and it happens that in our use case

play19:31

users often get to our UI through a deep

play19:36

link that they received by email so the

play19:39

first load is really important to us

play19:42

and react was just not the right fit for

play19:45

it

play19:46

the memory usage on the client side is

play19:49

also very lower much lower so this is

play19:53

good news because we will we will stop

play19:56

hearing our users crying for a new

play19:58

laptop every six months

play20:01

which is good for the planet

play20:05

what happened to the team

play20:07

obviously the JavaScript developer left

play20:10

because we didn't need here anymore but

play20:18

um

play20:20

but the other two we were quite stuck in

play20:24

our back end only role the

play20:29

the most beautiful demonstration I did

play20:32

after each print was an API endpoint

play20:36

with Jason the

play20:39

now we are full stack and we are able to

play20:43

collaborate with designers

play20:46

and also obviously continue working on

play20:49

our complete complex back-end issues but

play20:54

we have a much wider scope and this is

play20:57

much more exciting as a developer at

play21:00

least from my perspective

play21:03

um

play21:04

and this allowed also as to to explore

play21:08

new project management methods because

play21:12

we are now able to to

play21:14

make the developer in charge of a

play21:18

feature from the beginning to the end by

play21:21

exploring data by exploring a user

play21:25

scenario working with the developers it

play21:28

is great

play21:32

I don't even need to comment this slide

play21:35

I let you enjoy it

play21:38

that this is these are lines of code

play21:42

in our code base

play21:44

we deleted 15

play21:47

000 lines of code

play21:58

now

play21:59

[Music]

play21:59

um

play22:00

when it comes to you

play22:03

because I'm a bit here to convince you

play22:07

but I'm here to to to give you all the

play22:11

kids all the kids

play22:13

I think you need to make your own

play22:15

decision

play22:17

you need to ask yourself what do we need

play22:19

more as a team as a business

play22:22

um because

play22:24

in the beginning of this presentation I

play22:26

told you that people who recommended

play22:29

react to me uh talked about reacting to

play22:33

application State Management okay this

play22:35

is over

play22:36

uh talk they talk to me about web

play22:39

components okay this is handled

play22:42

they talked to me about separation of

play22:44

concerns and

play22:46

from that perspective with htmx we have

play22:51

um less separated code base and

play22:57

to me it's a good thing because I like

play22:59

to be a full stack developer but

play23:03

if your team is used to separation a

play23:06

heavy separation of concerns between

play23:08

back-end and front end Maybe

play23:13

htmx is not the best way for you

play23:17

but what htmx gave us is product agility

play23:21

we are now able to ship much faster much

play23:25

much faster

play23:27

we we have no more endless debates about

play23:31

API contracts Etc

play23:35

uh so if product agility is

play23:40

a big thing for you maybe you should

play23:43

consider htmx

play23:46

another question is what is front-end

play23:48

development

play23:51

um

play23:52

if some of you hate CSS Maybe

play23:57

maybe you should consider

play24:00

um

play24:00

an architecture that allows you to focus

play24:03

on the back end and let other people

play24:06

work on the front end but that doesn't

play24:08

necessarily mean reactor

play24:12

JavaScript application framework

play24:14

but if you think that front-end

play24:17

development is about taking some data

play24:19

from the database and exposing exposing

play24:22

the data to the user in a beautiful way

play24:24

making make the users interact with your

play24:26

data and so store the data into the

play24:29

database

play24:31

maybe htmx is the way to go

play24:36

I'm I think I'm done

play24:38

almost

play24:40

um here are the key takeaways form for

play24:43

you

play24:44

uh the first one is is if you had some

play24:47

doubts about htmx does it work on a real

play24:51

project a real product

play24:53

yes it works people are paying for the

play24:56

UI that you've seen earlier so it works

play25:01

um for a small team like us

play25:03

on a B2B SAS product

play25:06

it makes us very happy so if you're in

play25:08

the same position or in if you're in a

play25:11

similar position maybe it would make you

play25:14

happy so

play25:16

and the most important thing is that

play25:21

with htmx with jungle components as well

play25:25

now you're able to to make your own

play25:28

choice about

play25:30

what architecture will we Implement for

play25:33

our front end

play25:37

this time I'm really done

play25:41

I would like to give a special thanks to

play25:44

my colleagues at context

play25:46

I'd like to

play25:48

to tell you that this awesome company

play25:51

gave me to the opportunity to work on

play25:53

this presentation in my working time my

play25:55

working time so this is great

play25:58

and people you see here gave me feedback

play26:02

about the presentation they helped me

play26:05

rewrite it three times but it was great

play26:09

and the girls of the tech team took care

play26:13

of

play26:14

our Tech stuff while I was working on

play26:16

this presentation so this is good

play26:21

and thank you for your attention uh you

play26:25

can you can't find me anywhere else than

play26:27

on GitHub I have no social network

play26:31

um and I have one more thing

play26:33

if there if there are some friendships

play26:36

here we are hiring so let's meet later

Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
htmxReact alternativesDjangoSaaS developmentWeb componentsServer-side renderingFull-stack developmentWeb performanceUI/UXAgile development
Benötigen Sie eine Zusammenfassung auf Englisch?