Logo
    Search

    Hasty Treat - TypeScript Compilers and Build Tools

    enFebruary 15, 2021

    Podcast Summary

    • Using TypeScript without build toolsTypeScript compiler can handle transpiling and bundling, but build tools like Webpack, Babel, Parcel, and Snowpack offer additional features like code splitting and dev server functionality.

      TypeScript is a powerful and popular programming language for web development that offers static typing and other features. In this episode of Syntax, Wes Bos and Scott Tolinski discuss the role of compilers and build tools in using TypeScript, and whether tools like Webpack, Babel, Parcel, and Snowpack are still necessary. They explain that the TypeScript compiler can handle many tasks previously handled by build tools, such as transpiling and bundling. However, build tools can still be useful for additional features like code splitting and dev server functionality. The hosts also mention their sponsors, Sentry and Sanity, both of which offer valuable tools for error handling and content management, respectively. Sentry provides exceptional error and exception handling, while Sanity offers a structured content CMS with an image pipeline and support for Next.js. Overall, the episode provides a clear explanation of the current landscape of using TypeScript and the role of various tools in the development process.

    • TypeScript: Statically-typed language with type checking during developmentTypeScript catches and prevents type-related errors during development, saving time and resources by ensuring code conforms to expected types and compiles into JavaScript

      TypeScript is a statically-typed programming language that provides type checking during development, which helps prevent bugs from being shipped to the user. The TypeScript compiler analyzes your code and ensures that all functions, variables, and arrays conform to the expected types. It also compiles TypeScript code into JavaScript, which can be output in various formats. The main benefit of using TypeScript's compiler is the ability to catch and prevent type-related errors before the code is run in the browser, saving time and resources in the long run. While JavaScript does not have built-in type checking, these types of bugs can be difficult to catch during development, and they can lead to unexpected errors and poor user experiences. By using TypeScript, developers can have more control over their code and catch potential issues earlier in the development process. Additionally, TypeScript offers features like the "no emit" option, which will not compile code if the types are broken, providing an extra layer of security and ensuring that only high-quality code is deployed.

    • Using Babel with TypeScript for Transpilation and IntrospectionBabel can be used with TypeScript for transpiling TypeScript code into JavaScript and providing TypeScript introspection and documentation in your editor or IDE

      You can use tools like Babel in conjunction with TypeScript to get the benefits of TypeScript, such as introspection and documentation, without having to run the TypeScript compiler for type checking. This can be particularly useful if you're already using Babel in your setup and don't want to modify your build process extensively to add TypeScript. The Babel TypeScript plugin will convert your TypeScript files into JavaScript, but it won't perform any type checking itself. Instead, your text editor or IDE will handle TypeScript evaluation behind the scenes. This can be a good compromise if you're finding it difficult to modify your build process to accommodate both Babel and TypeScript. Another reason to use Babel with TypeScript is if you're working with features that aren't yet supported in either language. For example, the nested conditional checking with the nullish coalescing operator was not supported in TypeScript at the time, but it could be transpiled with Babel. Overall, using Babel and TypeScript together can make the transition to TypeScript easier and more manageable, especially if you're already using Babel and don't want to make significant changes to your build process.

    • Understanding TypeScript Compilation OptionsTypeScript requires transpilation for certain plugins and use cases, and TSC and SWC are popular compilers for this task. Developers can choose the best compiler based on their project needs and performance considerations.

      While TypeScript now includes many desirable features, it still requires transpilation through tools like Babel for certain plugins and use cases. TypeScript's compiler (TSC) can be run separately for type checking, and this is a common setup for projects. A notable alternative compiler is SWC, a Rust-based compiler, which is being considered for use in Deno due to performance reasons. This trend of rewriting compilers in more efficient languages to improve performance is not new; Sass, for example, was initially written in Ruby but was later rewritten in C++ and then Dart for better performance. Overall, understanding the different options and configurations for compiling TypeScript can help developers optimize their workflows and improve productivity.

    • Compilers for various programming languages: Dart Sass, Surcase, ES BuildDifferent compilers like Dart Sass, Surcase, and ES Build cater to specific programming languages and offer unique advantages. Dart Sass is the officially supported one, but the debate continues about performance and potential shift towards Rust-based compilers. Newer compilers like Surcase and ES Build focus on faster compilation and efficiency.

      There are various compilers for different programming languages, such as Node Sass, lib Sass, Ruby Sass, and Dart Sass, each with its unique history and advantages. Dart Sass is the officially supported one now, but there are ongoing debates about the performance and potential shift towards Rust-based compilers. A newer compiler called Surcase, written in TypeScript itself, also emerged, focusing on faster compilation of non-standard language extensions, JSX, TypeScript, and Flow. ES Build, a Go-based compiler, is another alternative that doesn't use Babel. The conversation also touched upon the history of Dart and how it didn't gain widespread adoption when it was first introduced, while TypeScript eventually became the preferred choice. The discussion highlighted the continuous evolution and competition among different compilers, aiming for better performance and efficiency.

    • A new open-source build tool for JavaScript and TypeScript projectsES Build is a fast and easy-to-use build tool for JavaScript and TypeScript projects, offering TypeScript support built-in and real-time watch functionality, despite not currently offering type checking during compilation.

      ES Build is a new open-source build tool for JavaScript and TypeScript projects, written in Go. It functions similarly to tools like Babel, but with TypeScript support built-in, allowing for faster development by eliminating the need for separate TypeScript compilation. ES Build can be installed via NPM and includes a JavaScript interface, making it easy to use. It also offers watch functionality for real-time builds. Despite not currently offering type checking during compilation, its speed and ease of use make it a compelling alternative to TypeScript's compiler for many developers. The fact that it's built in Go doesn't matter much for users, as it integrates seamlessly with a Node.js toolbase. ES Build is a promising new addition to the JavaScript development ecosystem.

    • Using a bundler with TypeScriptA bundler like Webpack, Parcel, or Snowpack offers benefits like tree shaking, smaller bundle files, and ease of handling additional features when used with TypeScript.

      While TypeScript can compile your code into JavaScript and output it directly, using a bundler like Webpack, Parcel, or Snowpack provides additional functionality. A bundler acts as a puppet master, coordinating various tasks like handling non-standard JavaScript features, importing CSS or images, and managing dependencies. It's not strictly necessary to use a bundler with TypeScript, but it offers significant benefits like tree shaking, smaller bundle files, and ease of handling additional features. Writing custom loaders for specific tasks, like loading GraphQL files, can be surprisingly simple and rewarding. While the process of writing a loader might seem daunting, it often involves just a few lines of code. The bundler simplifies the development process by handling these tasks, allowing developers to focus on writing their applications.

    • Manually adding polyfills for new JavaScript features in TypeScriptTo use new JavaScript features in TypeScript with older browsers, developers must manually add polyfills using tools like Babel or Parcel. Native ESM modules will eventually make this process obsolete.

      TypeScript doesn't automatically include polyfills for new JavaScript features when transpiling code to older browsers like Internet Explorer 6. This means that developers still need to manually add polyfills using tools like Babel or Parcel. Once everyone can use native ESM (ES Modules) and remove the common JS step, the JavaScript syntax will become easier and more straightforward. This is an exciting development, and we should explore this topic further in an upcoming episode on how to move away from common JS with Node's native ESM modules. During the discussion, it was mentioned that ES modules is the term for this new way of importing and running JavaScript files, much like how ATM machines work with transactions. This new approach will make JavaScript development feel more seamless and natural, allowing files to run without the need for compilation. However, it's important to note that when targeting older browsers, TypeScript won't add new methods to strings or implement promise.all.settled, which are common requirements for polyfills. This means that developers must still obtain and include their own polyfills manually. As we look forward to a future where native ESM modules become more widespread, the process of writing and running JavaScript code will become more efficient and streamlined. Stay tuned for more insights on this topic in our upcoming episode.

    Recent Episodes from Syntax - Tasty Web Development Treats

    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

    780: Cloud Storage: Bandwidth, Storage and BIG ZIPS

    780: Cloud Storage: Bandwidth, Storage and BIG ZIPS

    Today, Scott and Wes dive into cloud storage solutions—why you might need them, how they use them, and what you need to know about the big players, fees, and more.

    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

    Related Episodes

    745: Modern JS Toolchains (Biome, Oxc + More)

    745: Modern JS Toolchains (Biome, Oxc + More)

    Wes and Scott dive deep into the world of JavaScript toolchains, exploring everything from linters and compilers to transpilers and formatters. Tune in as they shed light on cutting-edge technologies like Biome, UnJS, and Ezno that are shaping the future for developers.

    Show Notes

    • 00:00 Welcome to Syntax!
    • 01:37 Syntax is on YouTube.
    • 02:09 Do we really need tooling?
    • 04:02 Popular tools are predominantly plug and play.
    • 06:15 What can tooling do for us?
    • 07:16 The tools in today’s workflow.
    • 20:26 The new tools in the space.
    • 42:31 Is JavaScript good enough to handle these tools?
    • 43:26 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

    707: What happened in JS, CSS And Web Dev in 2023? 2023 Predictions Results!

    707: What happened in JS, CSS And Web Dev in 2023? 2023 Predictions Results!

    In this episode of Syntax, Wes and Scott review their 2023 predictions and see how they did on ideas like Deno getting hotter, new JS APIs, WASM, Houdini, CSS Container Queries, 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

    Folge 74 - wolkenkit mit Golo Roden

    Folge 74 - wolkenkit mit Golo Roden

    Mit dem Gast in dieser Folge sprachen wir bereits in Folge 57 über die Konzepte von Domain-driven Design (DDD), Event Sourcing und Command-Query-Responsibility-Segregation (CQRS). Vereint werden vor allem Event Sourcing und CQRS in wolkenkit, einem Backend-Framework, das auf Node.js basiert. Es ermöglicht, mit JavaScript oder TypeScript skalierbare und verteilte Web- und Cloud-APIs zu erstellen. Abgerundet wird es durch die einfache Möglichkeit der Integration von DDD zur Modellierung der Projekte.
    Auf der Webseite von wolkenkit gibt es weiterführende Informationen zum Framework. Wenn ihr neugierig geworden seid, könnt ihr euch hier die Doku von V3 ansehen und zum Open Source Projekt beitragen. Auf Slack könnt ihr der wolkenkit-Community beitreten und euch direkt integrieren.

    Picks of the Day 

    • Golo spielt gern alte Retro-Spiele mit seinen Kindern, beispielsweise Monkey Island. Grafisch zwar wenig anspruchsvoll, aber dafür narrativ Gold wert – und genau deswegen empfehlenswert für Kinder. 
    • Dennis geht gern mit der Einkaufslisten-App Bring! in den Supermarkt. Die super smarte App ist synchron mit mehreren Personen nutzbar und ordnet Produkte automatisch der Abteilung im Geschäft zu. 
    • Jojo empfiehlt die Auseinandersetzung mit der Netflix-Doku “Das Dilemma der Sozialen Medien”, in der ehemalige MitarbeiterInnen großer Firmen über die Entwicklung sozialer Medien im Vergleich zur ursprünglichen Intention sprechen.  

    Schreibt uns!
    Schickt uns eure Themenwünsche und euer Feedback.
    podcast@programmier.bar

    Folgt uns!
    Bleibt auf dem Laufenden über zukünftige Folgen und virtuelle Meetups und beteiligt euch an Community-Diskussionen.
    Twitter
    Instagram
    Facebook
    Meetup
    YouTube

    Musik: Hanimo 

    Supper Club × WASM, Fastly Edge, and Polyfill.io with Jake Champion

    Supper Club × WASM, Fastly Edge, and Polyfill.io with Jake Champion

    In this supper club episode of Syntax, Wes and Scott talk with Jake Champion about his work with Fastly and Polyfill, the difference between WASY and WASM, what Winter CG is, and what makes Fastly different.

    Show Notes

    ××× SIIIIICK ××× PIIIICKS ×××

    Shameless Plugs

    Tweet us your tasty treats