Logo

    799: Hot New and Under-Utilized Browser APIs

    enJuly 24, 2024
    What are some examples of underutilized browser APIs?
    How does the 'starting style' at-rule work in CSS?
    What is the purpose of the Dialogue API?
    How does Sentry assist developers with unsupported APIs?
    What are the benefits of using scroll snapping and view transitions?

    Podcast Summary

    • Browser APIs for enhanced web developmentBrowser APIs like scroll snapping, modal dialogues, and view transitions can enhance web development, but ensure error handling and tracking when using them. The 'starting style' at-rule in CSS allows for the assignment of styles before an element enters the DOM for efficient animation without JavaScript.

      There are several new and underutilized browser APIs that can enhance web development, and some of these APIs involve a combination of CSS, JavaScript, and HTML. These APIs can provide features like scroll snapping, modal dialogues, and view transitions. However, it's important to ensure error handling and tracking when using these APIs, as not all browsers may support them. Sentry is an example of a service that can help developers identify and address errors related to unsupported APIs. One specific API discussed is the "starting style" at-rule in CSS, which allows for the assignment of styles before an element enters the DOM, making it possible to create animations without JavaScript. This and other APIs can lead to more efficient and effective web development. To learn more, check out the talk from Amsterdam and the demos linked in the show notes.

    • CSS animationsNew CSS properties like 'contain-visible: paint', 'transition-property: display, opacity', and 'transition-behavior: discrete' offer improved animation capabilities, enabling smoother transitions and complex animations, and are supported by Safari and Firefox.

      The CSS properties "contain-visible: paint" and "transition-property: display, opacity; transition-timing-function: ease" offer improved animation capabilities, allowing for smoother transitions between display: none and display: block, and opacity: 0 and opacity: 1. These properties are supported by Safari and Firefox, with Firefox requiring a flag. While not yet widely available, they have the potential to reduce the need for JavaScript in animating elements. Additionally, the property "transition-behavior: discrete" enables transitions on previously untransitable properties, such as display: none and overlay. This property, when used in combination with a starting style, can lead to more complex animations. The property "calc(size)" allows for animation between fixed values and intrinsic sizes, like auto or min-content. These new CSS features offer exciting possibilities for animating elements with greater ease and flexibility.

    • CSS TransitionsCSS Calc Size and View Transitions API enable dynamic and animated web design with smooth transitions and automatic adjustments, while Scroll Snap API creates effortless swipers with minimal JavaScript

      CSS Calc Size and View Transitions API offer exciting possibilities for dynamic and animated web design, allowing for smooth transitions and automatic adjustments to element sizes without the need for extensive JavaScript. While Calc Size is not yet fully supported across all browsers, it enables on-the-spot calculations and can be combined with View Transitions API for even more impressive effects. Scroll Snap API, on the other hand, is widely available and can be used to create effortless, Instagram-style swipers with minimal JavaScript, making it a valuable tool for enhancing user experience. Overall, these CSS features provide powerful, flexible, and user-friendly solutions for modern web development.

    • Scroll snap and view transitionsScroll snap and view transitions APIs simplify complex animations and interactions with minimal JavaScript and CSS, offering better performance and simpler code compared to external libraries.

      Scroll snap and view transitions are powerful browser APIs that can simplify complex animations and interactions, making them more efficient and easier to implement with minimal JavaScript and CSS. These APIs can be used in combination with other browser features like the popover API, and they offer better performance and simpler code compared to relying on external libraries. The view transitions API, in particular, allows for smooth animations and transitions between different elements on a page, with keyframes that can be easily defined using simple syntax. By utilizing these browser APIs, developers can create dynamic and engaging user experiences while reducing dependencies on external libraries and optimizing code.

    • View Transitions APIView Transitions API offers default fade transitions for showing/hiding elements without extra CSS/JS, customizable with CSS, and suitable for single-page, multi-page apps, and full HTML file loads.

      The View Transition API in web development provides default fade transitions when showing or hiding elements on a webpage, without requiring any additional CSS or JavaScript beyond wrapping the element change in a start view transition command. This makes it a versatile tool for use in single-page applications, multi-page applications, and even for transitioning between full HTML file loads. The API also allows for custom CSS transitions by setting a view transition name to a CSS variable. Unique identifiers assigned to elements enable seamless transitions between specific elements on a page. While this method requires exact HTML structure and unique identifiers, it offers an alternative to using JavaScript frameworks for app transitions. Chrome currently supports view transitions for multi-page applications, and the technology is expected to expand to other browsers in the future.

    • View Transitions and PopoversView Transitions API enhances user experience with dynamic, animated page transitions while Popover API simplifies creation of interactive pop-ups, both being progressive enhancable and accessible.

      The View Transitions API and Popover API are powerful tools for enhancing web design and user experience. The View Transitions API allows for dynamic, animated page transitions, making for a more engaging user experience. It's also progressive enhancable, meaning that users without support will still receive a functional page, while those with compatible browsers will get the full effect. The Popover API, on the other hand, simplifies the creation of interactive pop-ups. It's accessible, trapping focus and providing an escape key to close, and can be used with just HTML and no JavaScript for a basic implementation. However, for more granular control, JavaScript can be used to target popover actions and toggle the popover on and off. While the popover sits on the top layer, outside of the current document flow, positioning it relative to an element requires the use of the new Anchor API or JavaScript. Overall, these APIs offer significant benefits for web development and can help create more dynamic, user-friendly websites.

    • Popover and Anchor APIsPopover API is a widely accessible and easy-to-implement solution for creating interactive elements with modern HTML, while Anchor API offers more control and specific placement options, and Dialogue API is suitable for modals or overlays with focus capture and backdrop for easy styling.

      The Anchor API and Popover API are useful tools for creating interactive elements on a website. The Popover API is a modern solution for opening and closing elements with just HTML, while the Anchor API, though not yet fully implemented, offers more control and specific placement options. Dialogue, another API, is more suited for modals or overlays, providing a backdrop for easy styling and focus capture, allowing users to interact with the rest of the page while the modal is open. With over 86% browser coverage, the Popover API is widely accessible and easy to implement, while the Dialogue API offers additional features like focus capture and neutralizing the body's focus. Both APIs provide valuable solutions for creating engaging and accessible user experiences.

    • Dialogues and DetailsDialogues are accessible, easier to implement modal elements built directly into HTML, while Details can serve as a simple accordion-like feature without JavaScript

      The Dialogue API is a powerful tool for creating modal and overlay elements on a webpage. Unlike traditional modals, dialogues are built directly into the HTML and can be opened and closed using standard browser functions, making them more accessible and easier to implement. However, there are some limitations and quirks to be aware of, such as the inability to open a dialogue using HTML and the issue with certain third-party libraries that use overlays with high Z-index values. Details, another HTML5 element, can be used as a simple accordion-like feature without the need for JavaScript. While it may not offer the same level of customization as a dialogue or a library, it can be a useful alternative for basic accordion functionality. Overall, dialogues and details are two underutilized but valuable features of modern web development that can enhance user experience and engagement on a website.

    • New UI design featuresExplore new features like details, anchor, and starting styles in Google Chrome for reduced reliance on JavaScript and enhanced user experiences.

      The details element, also known as the accordion element, was added to Google Chrome in version 12, back in 2011. This element, along with other recent additions like anchor and starting styles, offers new ways to approach UI design and can be used in apps today. The speaker encouraged the audience to explore these new features and highlighted the benefits of using them, such as reduced reliance on JavaScript. He also suggested checking out a Twitter account that analyzes native apps to see which tools and resources they're using. The speaker also shared his "sick pick" of the TV show "Hacks," which he discovered after being encouraged to try new streaming services. Overall, the discussion emphasized the importance of staying informed about new developments in web design and taking advantage of the latest features to enhance user experiences.

    • Media Consumption Preferences, Local Data StoragePeople have varying preferences for media consumption, some focusing on character development and background stories, while others prefer intense action. Local data storage offers benefits like owning all data, auto-saving, and faster app performance.

      People have different preferences when it comes to media consumption. Some enjoy getting to know the characters and the background stories, while others prefer to jump right into the action. The speaker mentioned their wife's experience of watching a show with many characters and her struggle to keep track of them, contrasting her experience with the speaker's own preference for shows with intense build-up and tension. Additionally, the speaker shared their excitement for a new YouTube tutorial they released, which focuses on building a local data application that works offline. They highlighted the benefits of local data storage, such as owning all the data, auto-saving, and the absence of network requests, making the application faster and more efficient. If you're interested in building a fully offline local data application, check out the Syntax YouTube account's "Local First from Scratch" tutorial. It's a great resource for learning the fundamentals of local data storage and building an invoice app from scratch in about 41 minutes.

    Recent Episodes from Syntax - Tasty Web Development Treats

    817: You Need These 30 Apps - PART 1

    817: You Need These 30 Apps - PART 1

    Scott and Wes kick off part 1 of a 2-part series, breaking down 30 must-have apps for web developers and productivity enthusiasts. From file management tools to media utilities, they cover everything you need to supercharge your workflow.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    816: Why Your CSS Sucks

    816: Why Your CSS Sucks

    Scott and Wes break down why your CSS might suck—from misusing specificity to not leveraging CSS variables. Tune in as they dive into common pitfalls that are making your stylesheets a hot mess.

    Show Notes

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    815: Deno 2 with Ryan Dahl

    815: Deno 2 with Ryan Dahl

    In this episode of Syntax, Wes and Scott talk with Ryan Dahl about Deno 2.0, its new features and use of web standards, and how it seamlessly integrates with popular frameworks like Next.js. Ryan shares insights on the motivations behind Deno’s creation, its emphasis on simplicity and security, and offers his take on the evolving JavaScript ecosystem.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    814: Fundamentals: HTML

    814: Fundamentals: HTML

    In this episode of Syntax, Wes and Scott talk about HTML fundamentals — from basic structure and semantics to practical tips for better accessibility and SEO. They also discuss the difference between block and inline elements, form functionalities, HTML5 elements like dialog and canvas, and more.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    813: CSS: Scroll Driven Animations

    813: CSS: Scroll Driven Animations

    In this episode of Syntax, Wes and Scott talk about CSS’ new scroll-driven animations, its implementation, uses, and potential pitfalls. They also discuss animation-timeline and animation-range, and how they can be utilized to control animations based on scroll positions.

    Show Notes

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    812: CSS 4, 5, and 6! With Google’s Una and Adam

    812: CSS 4, 5, and 6! With Google’s Una and Adam

    In this episode of Syntax, Wes and Scott talk with Una Kravetz and Adam Argyle from Google Chrome about the evolution of CSS, new features, and the push toward more advanced UI capabilities on the web. They discuss the introduction of CSS versioning, exciting new properties like text-box-trim, state queries, and scroll state functionalities, select, and more!

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    How To Stay Up To Date with Daily.dev’s Francesco Ciulla

    How To Stay Up To Date with Daily.dev’s Francesco Ciulla

    In this episode of Syntax, Scott and Wes talk with Daily.dev’s Francesco Ciulla about the platform's history, community features, and significant growth. They dive into the core ideas behind daily.dev, including its personalized feed for developers, new features like squads, community contributions, and tech stack. Francesco also shares his passion for Rust, and highlights the importance of content creation in the ever-evolving tech landscape.

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads

    808: The Future of JavaScript Frameworks × Building Auth × DB Design Tips, and more!

    808: The Future of JavaScript Frameworks × Building Auth × DB Design Tips, and more!

    In this potluck episode of Syntax, Wes and Scott answer your questions about the future of JavaScript frameworks, building custom authentication systems, limiting API access, using Caddy server proxy for local development, component props in JSX, structuring a relational database, and more!

    Show Notes

    Sick Picks

    Shameless Plugs

    Hit us up on Socials!

    Syntax: X Instagram Tiktok LinkedIn Threads

    Wes: X Instagram Tiktok LinkedIn Threads

    Scott: X Instagram Tiktok LinkedIn Threads

    Randy: X Instagram YouTube Threads