Logo
    Search

    Potluck - Web components × Gear × Docker × Web Dev Frameworks × Golden Handcuffs × Browser Testing × SSR React × Code Prediction × More!

    enJune 23, 2021

    Podcast Summary

    • Tools and Custom SolutionsScott and Wes discussed creating custom tools for their projects and the importance of understanding fluid dynamics for installing in-ground sprinklers. They also mentioned potential solutions for exporting React components as web components using libraries like React Pure and React Transform.

      Both Scott and Wes shared their current projects and experiences, and during the discussion, they touched upon the topic of creating and using custom tools. Scott spoke about developing a course on SvelteKit and creating tools like a video uploader for his business. Wes talked about his project of installing in-ground sprinklers and the deep dive into fluid dynamics. They also mentioned the importance of understanding and creating tools to make the development process more efficient. Regarding the question from Stella, they discussed the possibility of exporting React components as web components, but they didn't have a definitive answer. They suggested looking into libraries like React Pure and React Transform for potential solutions. In the podcast, they also highlighted the importance of asking questions and encouraged listeners to submit their queries on the Syntax website. They also mentioned their sponsors, Sanity, LogRocket, and Linode, and shared their positive experiences with these companies. Overall, the episode emphasized the importance of building tools to improve the development process, learning new things, and the value of asking questions.

    • Creating reusable web components for project to projectWeb components enable creating reusable elements, but tools to convert React components may require shipping the original framework

      Web components offer a way to create reusable elements that can be taken from project to project, potentially building up a library of components. Tools like StencilJS and react-to-web-components enable converting existing React components into web components, but they may require shipping the original framework with the project. Web components were once seen as the future of web development, but their popularity hasn't fully materialized yet, leaving some wondering about their true potential and the role of frameworks like Stencil in this space.

    • React vs Web Components: Debating the FutureReact and Lit HTML offer similar capabilities but React has more API and community support, while Lit HTML could be the 'React of web components' with custom elements, scope styles, and reactive properties.

      React has gained popularity over web components due to its better API and additional capabilities. However, there's ongoing debate about whether web components, like Lit HTML, are just replacing one library with another. Lit HTML, which offers custom elements, scope styles, and reactive properties, could potentially be the "React of web components." Despite being built on top of the web component standard, it's possible to compile Lit code to web components if desired. The web development industry often involves using standards and then building frameworks or helpers on top of them, and this isn't necessarily a bad thing. Some people may find the cost of professional gear and setups prohibitive when starting out in web development, but professionals and businesses often invest in high-quality equipment for productivity and business returns.

    • A laptop from the last 10 years with 8GB RAM and a Core i5 processor is sufficient for beginners in web development.A laptop from the last decade with 8GB RAM and a Core i5 processor is adequate for web development beginners, but slower computers can hinder productivity.

      For beginners in web development, a laptop from the last 10 years with a minimum of 8GB RAM and a Core i5 processor or equivalent will suffice, as most basic tools can run on these specifications. However, a slower computer can lead to frustrating feedback cycles and slower processing times, which might hinder productivity. For those who prefer Mac OS for web development, a MacBook Air or iMac could be suitable options, although they may come with a higher price tag. Keep in mind that new and more powerful computers with m1 chips are continuously being released, which could offer improved performance.

    • Investing in a good computer setup for creators and developersA decent computer setup with a good laptop and large monitor can boost productivity and work experience, recommend an Intel Mac or M1 Mac with at least 8GB RAM and Core i5 processor, consider forming an entity to write off as a business expense, upgrade over time, and avoid unnecessary gear to maintain focus.

      Investing in a decent computer setup, including a good laptop and a large monitor, can significantly improve productivity and work experience for creators and developers. While it may be tempting to opt for the cheapest option, the potential benefits of a faster and more powerful machine can outweigh the initial cost. An Intel Mac or an M1 Mac, with at least 8GB of RAM and a Core i5 processor, is recommended. If possible, forming an entity to write off the computer as a business expense can make the investment more financially viable. Upgrading over time is also a viable option, as the initial purchase does not have to be the final one. Additionally, avoiding the temptation to buy unnecessary gear or equipment upfront can help maintain motivation and focus on creating content or developing projects. Sanity, a sponsor mentioned in the discussion, can also help save time by automating various tasks and workflows.

    • Experience of using Sanity CMS for back-end developmentSanity CMS offers ease of use and customizability, making it a versatile choice for back-end development. Python is powerful but choosing it depends on project requirements or proficiency.

      Sanity is a versatile and user-friendly Content Management System (CMS) that offers easy setup and customization. The speaker shared his experience of evaluating various back-end frameworks, including Python Flask and Django, and found that Sanity strikes the right balance between ease of use and customizability. Python itself is a powerful language, but the speaker personally prefers to focus on one language to maximize productivity. He recommends choosing Python for back-end development if it aligns with your project requirements or if you're already proficient in it.

    • Development environments and dependencies: sources of frustrationMaintaining different software versions and dealing with dependencies can be inefficient. Docker containers offer consistent environments, but may not be necessary for small projects.

      Development environments and dependencies can be a major source of frustration and inefficiency for developers, especially when dealing with different versions of software or using tools like Docker. The speaker shared his personal experiences with these issues in JavaScript and Python communities, and the challenges of maintaining different versions of Node.js and dealing with NPM installations. He also mentioned the potential benefits of using Docker containers to create consistent development environments, but shared his own negative experiences with the tool due to slow downloads and installation issues. Ultimately, the decision to use Docker or not depends on the size and scope of the project, and the number of people working on it. For small projects, it may be considered over-engineering, but for larger projects with more team members, it can be a valuable tool for ensuring consistent environments and streamlined development processes.

    • Managing Multiple Technologies: Coping with the ChallengesFeeling overwhelmed by managing multiple technologies? Seek support, improve time management, and consider using tools like Docker and error services for streamlined debugging.

      Having multiple technologies to manage in a single role can be challenging and may lead to feeling overwhelmed, especially when juggling different programming languages and tools in the same day. The speaker shared his experience of working with various languages like React, Ruby, and dot net, and feeling the strain of constantly switching between them while also dealing with meetings. He mentioned the concept of "golden handcuffs," where a well-paying job can be difficult to leave despite the mental toll it takes. The speaker suggested that better time management could help, but acknowledged that it might be a natural progression for developers as they advance in their careers. He also highlighted the importance of seeking support, such as counseling, during challenging times. Additionally, the discussion touched on the use of Docker for managing different applications and the potential benefits of using error and exception services like LogRocket to streamline debugging. Overall, the conversation emphasized the importance of finding balance and effective strategies for managing the demands of a complex technical role.

    • Managing stress in the workplace: External vs InternalRecognize the sources of stress, have open conversations with managers about workload, and reevaluate personal goals for internal stress. Chromium and WebKit are significant browser rendering engines, and understanding their differences can optimize testing.

      It's essential to recognize and address the sources of stress in your work environment. Modern tools and heavy workloads can contribute to stress, especially during challenging times like a global pandemic. It's crucial to distinguish between external pressures from managers and internal pressures from personal expectations. If the stress comes from external sources, having an open conversation with your managers about your workload could be beneficial. If it's self-imposed, it might be necessary to reevaluate personal goals and priorities. Additionally, browser rendering engines have evolved significantly, with Chromium (Blink) and WebKit being the major players. Chromium is the browser base, while Blink is the JavaScript engine. Understanding these differences can help in optimizing desktop browser testing. Remember, giving yourself some slack and acknowledging the unique challenges we face in today's world can go a long way in managing stress and maintaining productivity.

    • Exploring Different Browsers and Server-Side Rendering FrameworksBrowsers have unique features and inconsistencies, but server-side rendering frameworks like Ruby on Rails, Laravel, Python, and React offer solutions. Server-side rendering in React can be challenging due to hydration, but Netflix uses it without. Companies' tech stacks change, but the abundance of choices is a charm.

      There are various browsers, each with their unique features and inconsistencies, but the industry has come a long way in addressing these issues. IE 11 runs on Chrome, Safari uses WebKit, and Firefox stands alone. For those new to the industry, learning server-side rendered apps, there are numerous options like Ruby on Rails, Laravel, Python, and even React. Server-side rendering in React is relatively easy, but hydration can be a challenge. Netflix is known to use server-side rendered React with no hydration. Companies' tech stacks can change, causing confusion, but the abundance of choices is part of the industry's charm. If you're interested in learning more about traditional server-side rendered apps, consider checking out my learn no.com course, which focuses on this approach.

    • Server Rendering vs Client-Side Rendering and Code Prediction PluginsExplore server rendering with Express and Jade, client-side rendering with React, and code prediction plugins like Kite and Tap 9. Choose based on individual preferences and project requirements. TypeScript's static typing and strong type checking offer similar benefits to prop types.

      Server rendered apps are still popular in web development despite the trend towards client-side rendering. Developers are using tools like Express and Jade for server rendered HTML, and some are even going back to entirely server rendered apps. Regarding code prediction plugins, there are popular options like Kite and Tap 9 that analyze your code to suggest completions. Both have their strengths and weaknesses. For instance, Kite is known for its AI-powered suggestions, but some users have reported issues with uninstalling the extension. Versus Code's built-in IntelliSense is another option that many developers find satisfactory, especially when using TypeScript. The order of suggestions and the availability of JSDoc TypeScript documentation in libraries can significantly improve the user experience. However, there's no need to use additional plugins like Kite all the time, as the built-in TypeScript checking in Versus Code often provides sufficient autocompletion. As for the use of prop types in TypeScript in a React project, the consensus is that it's not necessary. While prop types can help catch errors during development, TypeScript's static typing and strong type checking provide similar benefits. Overall, the choice between server rendered apps, code prediction plugins, and prop types in TypeScript depends on individual preferences and project requirements. It's essential to explore different options and fine-tune settings to optimize your development experience.

    • Using a CDN for managing and delivering small audio filesCDNs like DigitalOcean and AWS offer efficient bandwidth usage, caching, and cost savings for managing and delivering small audio files. Backblaze can be used in conjunction with a CDN for storage.

      For managing and delivering small audio files for an app, using a Content Delivery Network (CDN) is recommended. This approach allows for efficient bandwidth usage, caching, and cost savings. The speaker suggests considering DigitalOcean or AWS, both of which offer CDN services, and warns against the potential complexity and costs associated with AWS. He also mentions that Backblaze, while not a CDN itself, can be used in conjunction with a CDN for storage. The speaker emphasizes that this approach is simpler than it seems and doesn't require significant server processing or generation of files on the fly. He also mentions that AWS is likely to be the most cost-effective option due to its proximity to the metal and lack of additional features. The speaker shares his personal experience with using Backblaze for hosting code downloads and receiving complaints about slow download speeds, and mentions that Transistor, a podcast platform, also hosts their MP3 files on Backblaze.

    • Linode's Affordable Object Storage and New Podcast RecommendationLinode offers predictable pricing, free transfers, and Amazon S3 API compatibility for affordable and convenient large file hosting. Try Linode with a $100 credit using linode.com/forward/syntax. New podcast 'A Death in Crypto Land' explores data security and shady business dealings in the crypto world.

      Linode, a cloud hosting and Linux hosting company, offers object storage with predictable pricing, free transfers, and an API compatible with Amazon S3. This makes it an affordable and convenient option for hosting and transferring large files, such as audio files. Linode also provides a $100 credit for new users who sign up using the link linode.com/forward/syntax. Additionally, Wes Bos recommended a new podcast called "A Death in Crypto Land" from the BBC, which investigates the mysterious death of the CEO of Canada's largest cryptocurrency exchange and the implications for the people whose money he controlled. The podcast is only two episodes in but has already proven to be fascinating, with themes of data security and shady business dealings. Finally, Wes shared his appreciation for Adobe Illustrator for creating sticker designs, despite its complexity.

    • Affinity Designer and Affinity Photo: Affordable Alternatives to Adobe's Creative CloudSpeaker shares their experience of using Affinity Designer for vector editing and Affinity Photo for raster editing, both offering powerful capabilities at a lower cost than Adobe's Creative Cloud and superior performance in Affinity Photo.

      Affinity Designer and Affinity Photo offer powerful design and editing capabilities, respectively, at a fraction of the cost of Adobe's Creative Cloud subscription. The speaker shared their personal experience of being overwhelmed by Illustrator and Sketch for certain tasks, such as working with grunge textures and large numbers of paths. They found Affinity Designer to be an excellent alternative, combining the strengths of both Illustrator (vector editing) and Photoshop (raster editing). Affinity Photo, on the other hand, was described as a Photoshop-like application with superior performance and no subscription fees. The speaker emphasized the ease of use and affordability of these applications, making them valuable additions to their creative toolkit. They also mentioned their personal experience with creating content for Affinity products and recommended checking out Level Up Tutorials for learning these tools.

    • Wes Bos releases free JavaScript reference guideWes Bos' comprehensive JavaScript textbook covers essential topics, serves as a quick lookup resource, and is now free on his website.

      Wes Bos, a well-known web developer and educator, has recently released a free JavaScript reference guide consisting of 85 interconnected pages. This comprehensive textbook covers all the essential topics of JavaScript, including functions, objects, scope, hoisting, closures, case switch, looping, and if statements. It serves as an excellent resource for developers who want to quickly look up specific JavaScript concepts. The project, which took over a year to develop, is now available for free on Wes Bos' website, wesbos.com/forward/javascript. This resource is an invaluable addition to the JavaScript community, providing a convenient and accessible way to learn and review JavaScript concepts. If you're a JavaScript developer or just starting your journey, this reference guide is definitely worth checking out.

    Recent Episodes from Syntax - Tasty Web Development Treats

    790: State of JS 2023 Reactions

    790: State of JS 2023 Reactions

    Scott and Wes dive into the 2023 State of JavaScript survey, breaking down the latest trends and pain points in front-end frameworks, build tools, and JavaScript runtimes. Tune in for their hot takes and insights on what’s shaping the JavaScript landscape this year!

    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

    789: Do More With AI - LLMs With Big Token Counts

    789: Do More With AI - LLMs With Big Token Counts

    Join Scott and CJ as they dive into the fascinating world of AI, exploring topics from LLM token sizes and context windows to understanding input length. They discuss practical use cases and share insights on how web developers can leverage larger token counts to maximize the potential of AI and LLMs.

    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

    CJ: X Instagram YouTube TwitchTV

    Randy: X Instagram YouTube Threads

    788: Supabase: Open Source Firebase for Fullstack JS Apps

    788: Supabase: Open Source Firebase for Fullstack JS Apps

    Scott and CJ chat with Paul Copplestone, CEO and co-founder of Supabase, about the journey of building an open source alternative to Firebase. Learn about the tech stack, the story behind their excellent documentation, and how Supabase balances business goals with open-source values.

    Show Notes

    • 00:00 Welcome to Syntax!
    • 00:30 Who is Paul Copplestone?
    • 01:17 Why ‘Supa’ and not ‘Super’?
    • 02:26 How did Supabase start?
    • 08:42 Simplicity in design.
    • 10:32 How do you take Supabase one step beyond the competition?
    • 12:35 How do you decide which libraries are officially supported vs community maintained?
      • 15:17 You don’t need a client library!
    • 16:48 Edge functions for server-side functionality.
    • 18:51 The genesis of pgvector.
    • 20:59 The product strategy.
    • 22:25 What’s the story behind Supabase’s awesome docs?
    • 25:26 The tech behind Supabase.
    • 35:46 How do you balance business goals with open source?
    • 42:01 What’s next for Supabase?
    • 44:15 Supabase’s GA + new features.
    • 48:24 Who runs the X account?
    • 50:39 Sick Picks + Shameless Plugs.

    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

    CJ: X Instagram YouTube TwitchTV

    Randy: X Instagram YouTube Threads

    787: You Should Try Vue.js

    787: You Should Try Vue.js

    Scott and CJ dive deep into the world of Vue.js, exploring what makes this frontend framework unique and why it stands out from React and Svelte. CJ gives a comprehensive tour, covering everything from getting started to advanced features like state management and Vue’s built-in styles.

    Show Notes

    Vue.js: The Documentary.

    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

    786: What Open Source license should you use?

    786: What Open Source license should you use?

    Scott and CJ dive into the world of open source, breaking down its meaning, benefits, and the various types of licenses you’ll encounter. From permissive licenses like MIT and Apache 2.0 to copy-left licenses such as GNU GPLv3, they’ll help you choose and apply the right license for your project.

    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

    785: What’s Next for NextJS with Tim Neutkens

    785: What’s Next for NextJS with Tim Neutkens

    Scott and Wes dive into the world of Next.js with special guest Tim Neutkens from Vercel. They explore the latest updates, including the React Compiler and React Server Components, discussing their impact on developer workflows and the future of Next.js development.

    Show Notes

    • 00:00 Welcome to Syntax!
    • 00:30 What does the React Compiler do?
    • 05:04 Will React Compiler help with managing Context?
    • 06:39 What happens if you’re not using a React Compiler?
    • 09:30 Will this work on any NextJS version?
    • 12:18 What are React Server Components?
    • 16:28 Shipping all the data inside an encapsulated component.
    • 20:17 Clearing up the frustrations around retrofitting server components.
    • 23:13 Handing migration.
    • 28:30 Is this just a fetch request with props?
    • 36:41 How closely are the NextJS and React teams working?
    • 41:53 Will we ever get Async Client Components?
    • 43:52 Async Local Storage API.
    • 45:31 Turbopack.
    • 57:51 Sick Picks & Shameless Plugs.

    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

    784: Logging × Blogging × Testing × Freelancing

    784: Logging × Blogging × Testing × Freelancing

    In this Potluck episode, Scott and Wes tackle listener questions on modern blogging, website environmental impact, and using LangChain with LLMs. They also cover CSS hyphens, unit vs. integration testing, and balancing web development with new parenthood.

    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

    783: How We Built a Netflix Style “Save for Offline” Feature Into Syntax

    783: How We Built a Netflix Style “Save for Offline” Feature Into Syntax

    Scott and Wes dive into the world of browser caching for audio files, exploring the File System API and the Cache API. They discuss size restrictions across different browsers, how tools like Riverside.fm leverage IndexedDB, and walk through code examples for creating, retrieving, and managing cached audio data.

    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

    782: The Developer’s Guide To Fonts with Stephen Nixon

    782: The Developer’s Guide To Fonts with Stephen Nixon

    Scott and CJ are joined by Stephen Nixon of ArrowType to delve into the world of fonts and type for developers. They explore the intricacies of font creation, the utility of variable fonts, and offer tips for making visually appealing typography on the web.

    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

    781: Potluck - The Value of TypeScript × Vue vs Svelte × Leetcode

    781: Potluck - The Value of TypeScript × Vue vs Svelte × Leetcode

    In this potluck episode of Syntax, Scott and CJ serve up a variety of community questions, from the nuances of beginner vs. advanced TypeScript to the pros and cons of SvelteKit. They also discuss falling out of love with React, shipping private packages via NPM, and the eternal struggle of always starting but never finishing projects.

    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

    Related Episodes

    Potluck - JS × Web Components × Security × They took our jobs!

    Potluck - JS × Web Components × Security × They took our jobs!

    It’s another potluck episode in which Wes and Scott answer your questions! This month - all things JS, go-to dev stacks, website security and the ever-changing nature of development.

    Mlab - Sponsor

    mLab is the leading Database-as-a-Service for MongoDB, powering over half a million deployments worldwide. Wes and Scott use mLab to host their own databases as well as take care of backups, security, scaling and performance. Try out a sandbox database on your next mongoDB project → https://mlab.com.

    Sanity.io - Sponsor

    Sanity.io is a real-time headless CMS with a fully customizable Content Studio built in React. Get up and running by typing npm i -g @sanity/cli && sanity init in your command line. Get an awesome supercharged free developer plan on sanity.io/syntax.

    Show Notes

    3:33 - Would you ever consider doing a live Syntax show?

    4:31 - What are your thoughts on Flutter? Does React Native have some solid competition now?

    9:43 - What are your website security essentials for static and dynamic sites? What’s the deal with forms? Is it bad to put a form on my site with no server-side validation?

    14:55 - Do you have a ‘go-to’ stack when building new web apps? If so, what is it and how would you go about choosing the right stack for the project?

    • Scott - Gatsby for sites / Meteor Apollo, React, MongoDB for db needing accounts sites
    • Wes - Next.js, Express Backend + either MongoDB, DiskDB or Prisma (or hasura)

    21:51 - What are your thoughts on 100 Days of Code Challenge?

    25:05 - I really have been learning a lot of React recently and have been wondering what is the difference between Next.js, Gatsby.js and vanilla React?

    • Dynamic vs static. What are your needs, how often does the content change.

    • Next.js

      • Use for dynamic needs
      • It can do static exports too
      • Convert to markdown
      • Nothing special other than Routing and SSR (Server request getInitialProps)
    • Gatsby.js

      • Use for static needs
      • Gatsby has lots of adapters

    30:38 - What are websockets and when should they be used?

    • A request that is always open - it responds to events instead of pinging, pushing or pulling data

    35:15 - I would love to hear your take on PWAs. Do either of you have any experience with building or using them?

    40:16 - I’m a nervous newbie who’s concerned about doing a web app that accepts payments or sensitive information. How can I know I’ve done everything to create a secure website and also protect myself from being sued by the client if their website gets hacked? I’m trying to be a jam stack developer so I’m looking at things like Snipcart and Stripe

    • Don’t save sensitive info in plain text. Use services that make it tough to do that until you are confident.
    • Look up PIPEDIA

    43:23 - What is a JavaScript generator? I heard that async/await creates a “generator” under the hood.

    • Pausable function that can return multiple values - call .next() on it

    46:54 - Are web components worth it in 2018?

    49:52 - How soon the designers replace React Developers with the invent of tools like Framer X?

    56:52 - Have you, or anyone you know ever thought of quitting the industry because of difficulties you have run into?

    ××× SIIIIICK ××× PIIIICKS ×××

    Shameless Plugs

    Tweet us your tasty treats!

    12: Flux Application Architecture & React

    12: Flux Application Architecture & React

    Flux is the application architecture that Facebook uses for building client-side web applications. It complements React's composable view components by utilizing a unidirectional data flow. It's more of a pattern rather than a formal framework, and you can start using Flux immediately without a lot of new code.” - Facebook’s Flux Architecture Home Page -

     

    Bill Fisher (@fisherwebdev), Facebook Software Engineer & Lead Developer of the Flux Documentation, joins The Web Platform Podcast for ‘Episode 12:  Flux Application Architecture & ReactJS.’

     

    Bill talks with hosts Nick Niemeir (@nickniemeir) & Erik Isaksen (@eisaksen) about Flux, an application architecture similar in ideas to CQRS & Data Flow Programming. It was created to alleviate the performance & scalability problems that Facebook encountered in building Facebook Messenger (Watch Hacker Way: Rethinking Web App Development at Facebook’ - a presentation by Jing Chen, Software Engineer at Facebook, for further information). Flux promotes a unidirectional data flow model through an application. In contrast to MVC, Flux mainly consists of Stores, a central Dispatcher, and Controller-Views.

    Facebook has React.js as its view layer and and Flux is quickly becoming the architectural design of choice for many of its other web applications. The support, power, and marketing behind the Angular.js and Ember.js frameworks is undeniable and when Facebook released React.js many developers misunderstood its Virtual DOM approach because it was not like the frameworks developers are used too. Despite that, Facebook has proved itself a ‘contender’ in the eyes of many in the development community and many developers and engineering teams are switching their ‘framework of choice’ to React.js.

     

    Flux combined with React.js offers many appealing possibilities but it is not limited to use with just React.js. Flux is an application architecture and it can be used as a pattern in almost any technology stack for web application development.

     

    Flux & React Resources

     

    Flux Projects In Progress

     

    Flux Implementations

     

    React Channels

     

    Potluck × Twitter Following × TypeScript × Playwright

    Potluck × Twitter Following × TypeScript × Playwright

    In this potluck episode of Syntax, Wes and Scott answer your questions about strategies to find good Twitter follows, should we use TypeScript for a company blog, what’s Playwright, and more!

    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.

    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

    ××× SIIIIICK ××× PIIIICKS ×××

    Shameless Plugs

    Tweet us your tasty treats

    React + TypeScript

    React + TypeScript

    In this episode of Syntax, Scott and Wes talk about using React with Typescript — how to set it up, components, state, props, passing data, custom hooks, and more!

    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.

    Sentry - Sponsor

    If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up.

    Linode - Sponsor

    Whether you’re working on a personal project or managing enterprise infrastructure, you deserve simple, affordable, and accessible cloud computing solutions that allow you to take your project to the next level. Simplify your cloud infrastructure with Linode’s Linux virtual machines and develop, deploy, and scale your modern applications faster and easier. Get started on Linode today with a $100 in free credit for listeners of Syntax. You can find all the details at linode.com/syntax. Linode has 11 global data centers and provides 24/7/365 human support with no tiers or hand-offs regardless of your plan size. In addition to shared and dedicated compute instances, you can use your $100 in credit on S3-compatible object storage, Managed Kubernetes, and more. Visit linode.com/syntax and click on the “Create Free Account” button to get started.

    Show Notes

    04:55 - Components

    • Strategies
    • Example:
     type Props = {    value: string; }  const App = (props: Props) => <div />  
    • Return type? JSX.Element
    • FC or FunctionComponent
    • It’s discouraged for this reason: It means that all components accept children, even if they're not supposed to
    • It could be useful for a return type

    12:13 - Props

    • Default props:
     const defaultJoke: JokeProps = {   joke: 'LOL JOE',   id: 'YEAH',   status: 200, };  function JokeItem({ joke = defaultJoke }: JokeProps): JSX.Element {   return (     
  1. {joke.joke} = {joke.id}
  2. ); }
    • Because props are always destructured, you often have to make a new type for your props. You can’t just type each argument by itself.

    18:38 - State

    • Just like Generics, State can be inferred
    • If your type is simple and you’re using useState, it just works:
      const [user, setUser] = useState(null);

    22:27 - useEffect

    • Nothing special required
    • Good use of void: If you want to use a Promise function but not worry about await or .then(), you can pop a void in front of it:
     useEffect(() => { console.log('Mounted'); // getJoke().then(console.log).catch(console.error); void getJoke(); }, [getJoke]);  

    26:09 - Refs

    • Very similar to state however some interesting things with null:
      const ref1 = useRef(null!);
    • “Instantiating the ref with a current value of null but lying to TypeScript that it’s not null.”

    29:33 - Custom Hooks

    • This is a great use case for Tuples

    31:00 - Context

    • This is probably the most complex thing in this list
    • First define the types
    • Use generic to pass in types OR null
    • This can also be non-null if you have default values in createContext:
      const AppCtx = React.createContext(null);

    35:21 - Events

    • The React events system is better than Vanilla JS
    • Can handle them inline and have it inferred: onClick={e ⇒ yeah(e.target)}
     const onSetType = (e: React.ChangeEvent) =>     setType(e.target.value)  
    • React has a bunch of events built in — many of them take a Generic argument so you can specify the type of element that triggered it. Handy for native API methods like play and pause.

    39:27 - ForwardRef

    • Again use of <> to pass in forwarded ref type as param 1, Props types as param 2:
     type Props = { children: React.ReactNode; type: "submit" | "button" }; export type Ref = HTMLButtonElement; export const FancyButton = React.forwardRef((props, ref) => (    ));  

    41:30 - ESLint

    • Typescript-react is good
    • Extend your own
    • Most JS rules apply to TS

    46:20 - React as Global React 17

    • Also add JSX: True to eslint globals for typing things like JSX.Element
    • global.d.ts
     import * as react from "react" import * as react_dom from "react-dom"  declare global {     type React = typeof react     type ReactDOM = typeof react_dom }  

    48:08 - TSConfig

    • jsx: "react"
    • React emit .js files with JSX changed
    • Preserve .jsx file output
    • React-native → .js files with jsx not changed

    53:05 - Frameworks?

    Links

    ××× SIIIIICK ××× PIIIICKS ×××

    Shameless Plugs

    Tweet us your tasty treats!

    9: Web Accessibility for JavaScript Components and Custom Elements

    9: Web Accessibility for JavaScript Components and Custom Elements

    In Episode 9, ‘Web Accessibility for JavaScript Components and Custom Elements’. Steve Faulkner (@stevefaulkner) from The Paciello Group and Marcy Sutton (@marcysutton) from Substantial discuss the lack of focus in product development today in building accessible applications & services. Many times web accessibility becomes an afterthought in creating a software product, having little prioritization from the business side until it is a problem. Retrofitting such an important part of our development can make web accessibility seem more like a chore with low ROI for the the time taken to implement it. It can be easy if developers know how to do it and hardly any work when it is successfully incorporated into a development process and it’s valued at the business level.

     

    With recent advances in the past few years in JavaScript MV* frameworks like Angular, React, & Ember we are seeing the need for web accessibility more and more. Heavy JavaScript applications tend to provide little or wrong functionality for things we take for granted like keyboard access. Examples on modifying these to better attend to user experience traditionally meant lots of overhead in development by forking the framework and updating it constantly. Based on the resources developers typically find in online searches & Roles the lack of good developer examples, WAI ARIA & even simple accessibility is easy to misunderstand.

     

    Many newer client side frameworks focus on componentization of HTML elements. Angular Directives, Ember Components, React Classes and Web Components. Componentization gives developers a chance to build much faster and easier Web Accessibility using various tools like WAI ARIA roles at a much more focused & reusable level. What is the future of Web Accessibility with these technologies? Why are we so concerned about Web Accessibility?

     

    References:

    https://github.com/marcysutton/accessibility-of-mvcs

    http://www.w3.org/TR/wai-aria/appendices#a_schemata

    https://www.youtube.com/watch?v=BgvDZZ8Ms8c

    https://www.youtube.com/watch?v=ZPsb-RR8SC0

    http://w3c.github.io/aria-in-html/

    https://www.youtube.com/watch?v=_IBiXfxhF-A

    http://www.polymer-project.org/articles/accessible-web-components.html

    http://marcysutton.com/target-corporate-website/

    http://www.w3.org/TR/2013/WD-components-intro-20130606/#decorator-section

    http://www.paciellogroup.com/blog/

    http://www.paciellogroup.com/resources/wat/

    http://www.w3.org/WAI/intro/aria

    http://webaim.org/

    https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA