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.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

The Good, The Bad, and The Web Components
JSNation 2023JSNation 2023
29 min
The Good, The Bad, and The Web Components
Top Content
Web Components are a piece of reusable UI enabled by web standards and built into the web platform. They offer the potential for faster component initialization and less library overhead. Web Components can be created from scratch and utilized with existing component libraries. Shadow DOM and Declarative Shadow DOM provide benefits such as scoped CSS and server-rendered components. The tradeoff between not repeating oneself and achieving full server-side rendering support is discussed. User experience is deemed more important than developer experience.
It's Time to De-Fragment the Web
React Day Berlin 2022React Day Berlin 2022
34 min
It's Time to De-Fragment the Web
Top Content
Today's Talk introduces Mitosis, an open source project that solves the problem of building framework agnostic components. It supports JSX and Svelte syntax and outputs human-readable code for various web frameworks. Mitosis is already being used by enterprise customers and can be easily integrated with React, Svelte, and other frameworks. It saves time, allows for easy handling of framework version migrations, and enables efficient unit and integration testing.
Web Components, Lit and Santa 🎅
JSNation Live 2021JSNation Live 2021
28 min
Web Components, Lit and Santa 🎅
Web Components and the Lit library are introduced, highlighting their ability to create custom elements and replicate built-in components with different functionality. The use of semantic HTML and the benefits of web components in development are emphasized. The features of Lit, such as data binding and rendering, are discussed. The Santa Tracker is showcased as an example of web components being used in educational games. The compatibility of web components with other frameworks and their versatility in creating small widgets or large applications are highlighted.
Immutable Web Apps
JSNation 2022JSNation 2022
20 min
Immutable Web Apps
Today's Talk discusses immutable web apps and their benefits, such as faster loading times and easy version tracking. The use of Universal Module Definition (UMD) style bundling allows for flexible dependency management and gradual upgrades. Tools like Webpack and Rollup provide ways to reference UMDs in bundles and automate dependency configuration. Arborist and YAML files help resolve dependency trees and handle conflicts, while the Orchard CLI tool automates dependency ordering. Internal and external dependencies can be initialized and managed effectively for optimal performance.
Web Components are awesome!
JSNation 2022JSNation 2022
10 min
Web Components are awesome!
Web components allow you to create your own HTML elements that can do anything you want, and they are supported by all modern browsers. Many companies, including YouTube and GitHub, use web components to enhance their websites. There are extensive tooling and libraries available for web component development. The Model Viewer Web Component enables the display of 3D models in Virtual and Augmented Reality without needing to know underlying technologies. Web components can be used with various frameworks and libraries, and there are resources available to help with compatibility.
Let's talk about Web Components
React Advanced Conference 2021React Advanced Conference 2021
32 min
Let's talk about Web Components
Web Components are a suite of technologies that allow you to create reusable HTML elements, combining the fun of React with regular HTML. Custom elements and the shadow DOM are key features of Web Components, allowing you to define new elements, encapsulate functionality and styles, and interact with a separate DOM. HTML templates serve as placeholders for content to be rendered later in custom components. Custom elements and HTML templates are cross-framework compatible and can be used in React, Angular, Vue, or any other framework.

Workshops on related topic

Web Components in Action
JSNation Live 2021JSNation Live 2021
184 min
Web Components in Action
Workshop
Joren Broekema
Alex Korzhikov
2 authors
The workshop extends JavaScript programming language knowledge, overviews general software design patterns. It is focused on Web Components standards and technologies built on top of them, like Lit-HTML and Lit-Element. We also practice writing Web Components both with native JavaScript and using Lit-Element. In the end we overview key tooling to develop an application - open-wc.