Logo
    Search

    logrocket

    Explore "logrocket" with insightful episodes like "Browser CSS Page Transitions API aka Shared Element Transitions", "I can has() new CSS Selector?!", "Hasty Treat - Seven Interesting JavaScript Proposals - Async Do, JSON Modules, Immutable Array Methods, and More!", "Hasty Treat - Stylin the Unstylables" and "Hasty Treat - Future Tech We’re Excited About" from podcasts like ""Syntax - Tasty Web Development Treats", "Syntax - Tasty Web Development Treats", "Syntax - Tasty Web Development Treats", "Syntax - Tasty Web Development Treats" and "Syntax - Tasty Web Development Treats"" and more!

    Episodes (8)

    Browser CSS Page Transitions API aka Shared Element Transitions

    Browser CSS Page Transitions API aka Shared Element Transitions

    In this Hasty Treat, Scott and Wes talk about the new Browser CSS Page Transitions API proposal and what features it opens up for developers on the web.

    Prismic - Sponsor

    Prismic is a Headless CMS that makes it easy to build website pages as a set of components. Break pages into sections of components using React, Vue, or whatever you like. Make corresponding Slices in Prismic. Start building pages dynamically in minutes. Get started at prismic.io/syntax.

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Show Notes

     async function doTransition() {   let transition = document.createDocumentTransition();      // Specify offered elements. The tag below is used to refer   // to the generated pseudo elemends in script/CSS.   document.querySelector(".old-message").style.pageTransitionTag = "message";      // The start() call triggers an async operation to capture   // snapshots for the offered elements,   await transition.start(async () => {     // This callback is invoked by the browser when the capture     // finishes and the DOM can be switched to the new state.     // No frames are rendered until this callback returns.          // Asynchronously load the new page.     await coolFramework.changeTheDOMToPageB();          // Clear the old message if that element is still in the page     document.querySelector(".old-message").style.pageTransitionTag = "";     // Set new message as the shared element 'message'     document.querySelector(".new-message").style.pageTransitionTag = "message";          // Set up animations using WA-API on the next frame.     requestAnimationFrame(() => {       document.documentElement.animate(keyframes, {       ...animationOptions,       pseudoElement: "::page-transition-container(message)",       });     });          // Note that when this callback finishes, the animations will start with the tagged elements.   }); }  

    Tweet us your tasty treats

    I can has() new CSS Selector?!

    I can has() new CSS Selector?!

    In this Hasty Treat, Scott and Wes talk about new CSS selectors :has, :where, and :is.

    MagicBell - Sponsor

    MagicBell is the the notification inbox for your product. Add a MagicBell to your product for announcements, billing, workflow, and other notifications. The free plan supports up to 100 Monthly Active Users - use the coupon code SYNTAXFM for 10% off the first 12 months.

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Show Notes

     // Finds all p tags that have an anchor tag as a child p:has(a) {} // Can find children of parent as well // Finds the button of a paragraph that contains an a tag  p:has(a) button {} // Finds all p tags that don't have an anchor tag as a child p:not(:has(a)) {} // Finds all p tags where a is a direct sibling p:has(> a) {} // would find 

    Hi

    // would not find

    hi

    In the past we would write

     header p:hover, main p:hover, footer p:hover {   color: red;   cursor: pointer; }  

    :where is essentially a short had for making this easier considering the 2nd half of these selectors is the same. Will make your css dryer

     :where(header, main, footer) p:hover {}  

    Also super handy in avoiding css blocks being ignored for unsupported features.

     // Doesn't work div:has(p), div:some_new_selector(p)  // Will still work for :has if has is supported :where(div:has(p), div:some_new_selector(p))  

    Tweet us your tasty treats

    Hasty Treat - Seven Interesting JavaScript Proposals - Async Do, JSON Modules, Immutable Array Methods, and More!

    Hasty Treat - Seven Interesting JavaScript Proposals - Async Do, JSON Modules, Immutable Array Methods, and More!

    In this Hasty Treat, Scott and Wes talk about seven new JavaScript proposals — what they do, where they’re at, and how you might use them.

    Deque - Sponsor

    Deque’s axe DevTools makes accessibility testing easy and doesn’t require special expertise. Find and fix issues while you code. Get started with a free trial of axe DevTools Pro at deque.com/syntax. No credit card needed.

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Show Notes

    03:32 - Seven new JavaScript proposals

    06:25 - JSON Modules

    09:55 - Array Find From Last

    11:40 - Async Do

    • https://github.com/tc39/proposal-async-do-expressions
    • Async do will allow you to group together a block of code and mark it as async.
    • No need for an iife
    • Downside to this is that it’s a code block, so if you need to return any values, you’ll need to jump that up a scope level.
     Promise.all([   async do {     let result = await fetch('thing A');     await result.json();   },   async do {     let result = await fetch('thing B');     await result.json();   }, ]).then(([a, b]) => console.log([a, b]));  

    14:33 - Change Array By Copy

    17:48 - Temporal

    18:35 - As Patterns

    20:47 - Pattern Matching

        {props => match (props) {     when ({ loading }) { ; }     when ({ error }) { ; }     when ({ data }) { ; }   }}   

    Tweet us your tasty treats!

    Hasty Treat - Stylin the Unstylables

    Hasty Treat - Stylin the Unstylables

    In this Hasty Treat, Scott and Wes talk about the different kinds of things that are difficult to style, how you can style them, and some future tech to look out for!

    Sanity - Sponsor

    Sanity.io is a real-time headless CMS with a fully customizable Content Studio built in React. Get a Sanity powered site up and running in minutes at sanity.io/create. Get an awesome supercharged free developer plan on sanity.io/syntax.

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Show Notes

    Can it be styled? Solutions

    04:28 - Just style the defaults

    • Most elements can be styled, though some elements are really just multiple elements grouped together into the shadow dom and are hard to style.
    • This leads to us having to re-create the visual UI, and often is a point of making inaccessible UIs.
    • Select
    • Input - number, date, etc.
      • Very hard to style
      • Often need appearance: none; for mobile
    • Checkbox / Radio
    • Generally speaking, these CSS Properties can be applied to all inputs:
      • font-size
      • color
      • padding
      • margin
      • background / images
      • outline (remember focus)
      • border

    08:20 - Overlap with more dom elements, set background images

    • Checkbox / Radio / Toggle buttons
      • Often used :before and :after along with labels — e.g. label + input:checked
    • Select can have element overlap

    14:13 - Re-implement the UI with JavaScript

    • Video / Audio
      • HUGE rabbit hole of things to code
    • Very important to maintain accessibility

    15:46 - Use a UI Library

    17:20 - Open UI

    Tweet us your tasty treats!

    Hasty Treat - Future Tech We’re Excited About

    Hasty Treat - Future Tech We’re Excited About

    In this Hasty Treat, Scott and Wes talk about future tech — some things you may not have heard about yet, and why we’re excited about them!

    Freshbooks - Sponsor

    Get a 30 day free trial of Freshbooks at freshbooks.com/syntax and put SYNTAX in the “How did you hear about us?” section.

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Show Notes

    05:20 - Astro

    • What it is:
    • Why we’re excited about it:
      • Server Side JS frameworks, combine Svelte, React, Vue as needed in one component that is an SFC using markdown style meta data.
      • Scoped CSS by default (a la Svelte). Sass out of the box.
      • Collections import for .md files
     // pages/blog.astro --- import PostPreview from '../components/PostPreview.astro';  const blogPosts = import.meta.collections('./post/*.md'); ---  <main>   <h1>Blog Postsh1>   {blogPosts.map((post) => (     <PostPreview post={post} />   )} main>  

    12:06 - ViteKit

    • What it is:
      • Framework-agnostic
      • API routes
      • Pages (frontend, optional hydration)
      • Adapter for Node, static, Vercel, cf worker, etc. Inspired by SvelteKit.

    15:58 - Svelte Kit

    19:07 - Remix.run

    • What it is:
    • Why we’re excited about it:
      • Made by Michael Jackson, Ryan Florence
      • License-based
      • React-based
      • Caching-focused, uses “the platform”
      • Centralized data loading, works without client JS if needed
      • Better nested routing

    Links

    Tweet us your tasty treats!

    Hasty Treat - Records and Tuples in JavaScript

    Hasty Treat - Records and Tuples in JavaScript

    In this Hasty Treat, Scott and Wes talk about records and tuples in javascript — what they are, why you might want to use them, and more!

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Show Notes

    ??? -

    02:42 - Immutability

    05:08 - Records

    • Immutable object
    • Syntax #{x: 1, y: 2}

    05:56 - Tuples

    • Immutable array
    • Syntax #[1,2,3,4]

    07:18 - For both

    • Referred to as a compound primitive

    • Can contain only primitives, not objects

    • They are compared deeply by their contents rather than their identity

       assert(#{ a: 1 } === #{ a: 1 }); assert(#[1, 2] === #[1, 2]); assert(#{ a: 1, b: 2 } === #{ b: 2, a: 1 });  
    • Potential for optimizations

      • Optimizations for making deep equality checks fast
      • Optimizations for manipulating data structures
    • Works well with type systems

    • Better integration with the debugger

    • Accessed through normal record.scott object like syntax

    13:39 - Stage 2

    Links

    Tweet us your tasty treats!

    Hasty Treat - The Domain Name Game

    Hasty Treat - The Domain Name Game

    In this Hasty Treat it’s another edition of the Top Level Domain Game!

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Show Notes

    02:25 - How it works

    We pick a TLD from a list, and the other person needs to guess:

    1. Is it for a country or business? +5 points
    2. What country, business, or type of business is it for? +5 points
    3. How much per year does it cost to register? You may also say “unregisterable” +/- off by $$ https://www.101domain.com/
    4. Is scott._ and wes._ available? -10 points for each

    04:00 - .sd

    • Scott: 5 + -5 + -126 + -10 + 10 = -126

    05:46 - .ong

    • Wes: 5 + -5 + -30 + 20 = -10

    07:53 - .koeln

    • Scott: 5 + -5 + -20 + 20 = -126

    09:23 - .co.ke

    • Wes: 10 + -15 + 0 = -15

    11:00 - .tr

    • Scott: 5 + -5 + 0 + 0 = -126

    12:25 - .ist

    • Wes: -5 + 5 + -10 + 0 = -25

    13:57 - .xn—45q11c

    • Scott: 5 + 5 + -295 + 10 = 20 = -401

    16:40 - .reit

    • Wes: 10 + -1460 + 10 = -1465

    Tweet us your tasty treats!

    Hasty Treat - The TLD Game

    Hasty Treat - The TLD Game

    In this Hasty Treat, Scott and Wes are playing a game! It’s called the TLD game, where Scott and Wes try to stump each other with questions about top level domains.

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Show Notes

    1:55 - The rules of the game

    We pick a TLD from a list, and the other person needs to guess:

    1. Is it for a country or business? -5 points
    2. What country, business, or type of business is it for? -5 points
    3. How much per year does it cost to register? You may also say “unregisterable” +/- off by $$
    4. is scott.___ and wes.___ available? -10 for each

    5:40 - .BO

    7:51 - .BZH

    9:50 - .BANANAREPUBLIC

    11:15 - .BABY

    14:04 - .KR

    16:09 - .MOTO

    17:25 - .AW

    19:16 - .IM

    Links

    Tweet us your tasty treats!