Authoring HTML in a JavaScript World

Rate this content
Bookmark

 In this talk, Tony shows how an authoring and semantic HTML-first approach to JSX template work leads to more readable, maintainable, and accessible UI components. He demonstrates how to think through implementing a UI prototype in a semantic way, authoring HTML before visuals. He shows how accessible markup improves performance, reduces DOM size, minimizes time spent on CSS, and reduces cognitive load not only for developers, but also for all our users, no matter how they consume our sites and applications.

This talk has been presented at React Summit US 2023, check out the latest edition of this React Conference.

Watch video on a separate page

FAQ

Tony Alicia is an instructor who teaches courses on platforms like Udemy, Pluralsight, Teachable, and YouTube. He specializes in web development topics, particularly focusing on integrating HTML with JavaScript frameworks like React.

The Smythe Group is a company that works with development teams to enhance their performance and output. Tony Alicia is associated with this group, contributing to their initiatives to help development teams excel.

The main theme of the talk is to encourage developers to prioritize HTML in the development process, emphasizing the importance of semantic HTML to enhance accessibility, maintainability, and performance of web applications.

Tony Alicia highlights that while JavaScript is crucial, HTML provides the semantic structure necessary for web content. Focusing on HTML first can lead to more accessible, maintainable, and performant applications by ensuring meaningful element use and reducing unnecessary DOM complexity.

Authoring HTML semantically enhances readability and maintainability of the code, improves accessibility for users with disabilities, and boosts performance by reducing the DOM size, which can positively impact the application’s responsiveness and efficiency.

Developers can improve their HTML skills by studying the HTML Specification, particularly section 4, which details the meanings and appropriate uses of different HTML elements. This knowledge aids in writing more semantic and effective HTML.

Tony Alicia suggests starting with elements that don’t have default CSS to replace overused divs and spans. This approach encourages thinking about the content's meaning and structure, leading to better maintainability and readability.

Tony Alicea
Tony Alicea
21 min
15 Nov, 2023

Comments

Sign in or register to post your comment.
  • Timothy Trimble
    Timothy Trimble
    Excellent presentation, Tony. When I went to college to get my Web Application Developer Certificate, the first semester of web development was focused on HTML and the basics of JavaScript. For me, this was easy, and I ended up helping other students get through it. It wasn't until the second semester that he introduced React and Vue. I found it very refreshing to go back to the foundations of web development. We get so focused on the tools and the plugins, that we tend to forget the layer that supports everything else. I'll be sharing this with my team.

Video Summary and Transcription

This Talk by Tony Alicia focuses on authoring HTML in a JavaScript world. The speaker challenges developers to change their approach to building React components by starting with HTML first. By authoring HTML in a semantic way, readability and maintainability can be improved. Well-authored HTML provides better understanding of content and improves accessibility. It also has performance benefits by reducing DOM size. Investing time in HTML can save time and make applications more future-proof.

1. Introduction and Background

Short description:

Hi, I'm Tony Alicia. This is Authoring HTML in a JavaScript World. I teach on Udemy, Pluralsight, Teachable, and YouTube. Connect with me on my website at TonyAlicia.dev or find me on YouTube, Twitter. Learn about The Smythe Group at TheSmytheGroup.com.

Hi, I'm Tony Alicia. This is Authoring HTML in a JavaScript World. First, a little about me. You may find me teaching on Udemy, Pluralsight, Teachable, and YouTube and I work with a company called the Smythe Group. Now, if you'd like to connect, feel free to reach out. You can find me and my courses on my website at TonyAlicia.dev. Shoot me an email, find me on YouTube, Twitter. You can go to TheSmytheGroup.com to find out about how we help dev teams become their best selves and do their best work.

2. Authoring HTML in a JavaScript World

Short description:

But this talk is Authoring HTML in a JavaScript World. I'd like to challenge you to change your way of thinking, to change your approach to how you build your React components. Let's say you get a prototype. What's the first thing that goes through your head? What are the first steps in your mind as you imagine implementing the prototype in React? Let's start thinking about HTML first. What would happen if we thought about our HTML first and then started thinking about how to make the application work and the CSS comes along for the ride as we make it look like the prototype? The entire point of authoring our HTML is to choose our HTML elements according to the information and things that are happening on the page. Now let's talk about the benefits of authoring our HTML in a semantic way and what that really looks like. HTML authoring is a skill. And it's a very learnable skill.

But this talk is Authoring HTML in a JavaScript World. And all of us, all of you that are listening, you all spend your time in JavaScript. Whether we're writing TypeScript, whether we're dealing with databases, whether we're on the server, whether we're writing tests, our life revolves around JavaScript. It's a JavaScript world. And yet there's three legs of the stool when it comes to foundational web technologies, HTML, CSS, and JavaScript.

So in this talk, I'd like to challenge you to change your way of thinking, to change your approach to how you build your React components. What I mean by that is this. Let's say you get a prototype. This is a very simplistic example. But you get a prototype, perhaps from a designer, and now you have to implement it. What's the first thing that goes through your head? What are the first steps in your mind as you imagine implementing the prototype in React? Well, it may be that you start thinking about which will be components, how the component structure will be, what the CSS will be to make the actual website or web app look like a prototype. So really, mentally, we kind of start in the CSS world. How can I make it look like the prototype? And we start in the JS world. How can I make it work? How can I make the actual app do what the prototype says it should do? And then along the way, somewhere along the road, we put in some HTML. It really is a sort of structure, a scaffold, a skeleton on which to hang a JavaScript code and CSS. And if we're writing JSX, you might say, well, I'm not writing HTML. But really, we are, because they're both being converted into the DOM. And so ultimately to the user, it's the same as if we were writing HTML. So choosing our elements is something that happens along the way. I'd like to challenge you to change your mindset and instead think about HTML first. What would happen if we thought about our HTML first and then started thinking about how to make the application work and the CSS comes along for the ride as we make it look like the prototype? Again, if we're just looking at the prototype and we're thinking about the HTML, what we're actually thinking about is what is the meaning of each of these pieces of information that we see in the prototype. If we're thinking about HTML, we're thinking about semantics and the word semantic means having to do with meaning. The entire point of authoring our HTML, and we're going to introduce that phrase when we author our HTML, when we behave as HTML authors, meaning we're choosing our HTML elements according to the information and things that are happening on the page on the screen, then we're dealing with semantics. We're authoring in a semantic way.

Now I'd like to talk about the benefits of authoring our HTML in a semantic way and what that really looks like. For starters, let's talk about learnability. We're all trying to keep up with the latest things happening in the JavaScript world. But HTML is a skill. HTML authoring is a skill. And it's a very learnable skill.