New to JavaScript — ES2022

New to JavaScript — ES2022

In this episode of Syntax, Scott and Wes talk about all the new stuff in ES2022 — what it is, why you might need it, and how to use it. 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. Auth0 - Sponsor Auth0 is the easiest way for developers to add authentication and secure their applications. They provides features like user management, multi-factor authentication, and you can even enable users to login with device biometrics with something like their fingerprint. Not to mention, Auth0 has SDKs for your favorite frameworks like React, Next.js, and Node/Express. Make sure to sign up for a free account and give Auth0 a try with the link below: https://a0.to/syntax. Show Notes 04:50 - Regex indicies New d flag in a regex https://regex101.com/ This will tell you the indexes (indicies) of the regex matches Handy if you need to highlight or replaces matches in a string We can ask for the start and end positions of each matched capture group 07:16 - Class updates Private fields Properties and Methods to be kept private Prefix them with a # =Helpful for internal state and methods which should not be accessed directly or at all by external In React how we have __INTERNTAL_NEVER USE THIS class ColorButton extends HTMLElement { // All fields are public by default color = "red" // Private fields start with a #, can only be changed from inside the class #clicked = false } const button = new ColorButton() // Public fields can be accessed and changed by anyone button.color = "blue" // SyntaxError here console.log(button.#clicked) // Cannot be read from outside button.#clicked = true // Cannot be assigned a value from outside Getters and setters introduced in es5 https://www.w3schools.com/js/js_object_accessors.asp class Person { #hobbies = ['computers'] get #hobbiesGetter() { return this.#hobbies } #getHobbies() { return this.#hobbies } getHobbiesPublic() { return this.#hobbies } } const scott = new Person(); scott.#getHobbies(); // doesn't work scott.getHobbiesPublic(); // works 09:07 - Class fields This may seem super old because we have been polyfilling it forever Right now if you want an instance field on a class, you need to declare it in the constructor Now we can just declare them inside the class 10:36 - Static fields and methods As above can also be static with the static keyboard Works for methods too Explain what a static method is 13:17 - Top level await So handy in modules. Need to pull in some data? Simple. 15:19 - Ergonomic brand checks for private fields Used for checking if a private field on a class exists using the in keyword 16:00 - .at() method Strings and arrays - we can use square brackets to reference items of the array Super handy for grabbing the last item of an array // 🔥 New .at() method on arrays and strings const toppings = ['pepperoni', 'cheese', 'mushrooms']; // The old way to grab the last item toppings[toppings.length - 1]; // mushrooms // using .at() method with a negative index toppings.at(-1); // mushrooms // works with any index toppings.at(0); // pepperoni toppings.at(-2); // cheese // and with strings! 'Meeting Room: B'.at(-1) // B Why not use array[-1]? We used to use slice(-1) What about indexOf? 21:34 - Handy hasOwn method https://github.com/tc39/proposal-accessible-object-hasownproperty 24:51 - Class static block A static block allows you to run code before creating an optional static property during initialization https://github.com/tc39/proposal-class-static-block Links https://github.com/tc39/proposals/blob/master/finished-proposals.md ××× SIIIIICK ××× PIIIICKS ××× Scott: Ultraloq Smart Lock Wes: Magnatiles Shameless Plugs Scott: Web Components Course - Sign up for the year and save 25%! Wes: All Courses - Use the coupon code ‘Syntax’ for $10 off! Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

Episoder(970)

Hasty Treat - How To Refine Your Process

Hasty Treat - How To Refine Your Process

In this Hasty Treat, Scott and Wes talk about refining your processes, how to evaluate them, make them better, and more! Sentry - Sponsor If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”. Show Notes 04:18 - Find slow process Getting through email Cleaning my desk 06:29 - Set clear goals (smart goals) Is my inbox less crazy? Don’t spend too much time Do a 30-day challenge 09:46 - Ask around What are people you know using and why Time-blocking Batching Eat that frog Links Streaks Matt Cutts — Try something new for 30 days 1Writer Notable Dropbox Notion Obsidian Todoist Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

10 Aug 202018min

React State Round Up

React State Round Up

In this episode of Syntax, Scott and Wes talk about React State libraries, should you use them, pros, cons, and more! 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. Sentry - Sponsor If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”. Show Notes 01:24 - Context Have we used? Scott: Yes Wes: Yes Pros Built into React As simple or complex as you want Cons Takes effort to optimize Takes effort to plan and organize aka can get out of hand quickly 08:49 - Redux Have we used? Scott: Yes Wes: Yes Pros Huge user base Legacy of growth and improvements Modern API Even though it’s hard to learn, it has a clear “how to build with it” path Dev tools Cons Complex Thing that calls a thing that calls a thing that calls a thing Confusion around what additional packages are needed, e.g. ducks, saga, whatever 17:08 - XState Have we used? Scott: Yes Wes: No Pros Enforces solid design patterns Very safe Awesome tooling like UI to see state machines https://xstate.js.org/viz/ Cons Knowledge overhead - having to understand state machines Complex syntax 23:26 - Zustand Have we used? Scott: Yes Wes: No Pros Fast, scalable, easy to use Simpler No context providers Cons Smaller community 2.6k stars on Github Can inform components transiently (without causing render) 27:04 - Apollo Client Have we used? Scott: Yes Wes: Yes Pros Fits in well with your GraphQL API Dev tools Cons Complex, large syntax for simple operations Dev tools SSR story is really complex. It’s hard because they aren’t also the framework. 31:35 - RXJS Have we used? Scott: No Wes: No Observable based 33:02 - React Query Have we used? Scott: No Wes: Pros Fast growing community Awesome dev tools Cons Not sure if this can be used for application state or just data 35:37 - Recoil Have we used? Scott: Yes Wes: No Pros Very good for complex, splintered state needs Cons Overly complex for most use cases 38:34 - MobX Have we used? Scott: No Wes: No Pros Big community Not just React Powerful Observable capabilities Cons Uses decorators, but doesn’t have to? 43:15 - Easy Peasy Have we used? Scott: No Wes: No Pros Simple API (easy peasy) Redux dev tools supported 45:06 - Meteor ReactiveDict / ReactiveVar Have we used? Scott: Yes Wes: No Pros Very simple Get, set Is Reactive Cons Lock-in to Meteor 46:19 - Final Thoughts On State Wes: Go for simpler solutions Scott: I think application state should be separate from application data, but maybe that’s because there isn’t a solution that does both how I want Links Svelte Meteor Syntax 206: State Machines, CSS and Animations with David K Piano Syntax 268: Potluck - Beating Procrastination × Rollup vs Webpack × Leadership × Code Planning × Styled Components × More! Zustand CodeSandbox swr ××× SIIIIICK ××× PIIIICKS ××× Scott: Becoming Bond Wes: IRWIN VISE-GRIP GrooveLock Pliers Set Shameless Plugs Scott: Modern CSS Design Systems - Sign up for the year and save 25%! Wes: All Courses - Use the coupon code ‘Syntax’ for $10 off! Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

5 Aug 202054min

Hasty Treat - Upgrading Next.js Syntax Site

Hasty Treat - Upgrading Next.js Syntax Site

In this Hasty Treat, Scott and Wes talk about their experience upgrading Syntax.fm and some of the site’s big changes. 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:26 - The old Syntax site Next.js Custom server for API - shows, Latest shows, sick picks On-demand page builds Custom routing 06:41 - The new Syntax site Next.js has solved those things now, no need for a custom server. API Routes On-demand page builds: SSG with Next.js. It’s a server, but caches the page builds. Releasing the shows happens with revalidation. It’s statically generated like Gatsby, but you can also choose Custom routing is now done with [pages] Very fast to load Very fast to build Very fast to deploy It’s now a “dynamic static site” Zeit Now 1 to “Vercel” Huge thanks to Tim Neutkens and Luis Alvarez from Vercel for making it happen. 13:23 - Why not: Gatsby Entire site would need to be regenerated exactly at 9am eastern API of the site would need to be done with something else like Netlify Functions - not nearly as nice as Next API routes Sapper Links Next.js Gatsby Sapper Vercel Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

3 Aug 202017min

Meteor's 2nd Life

Meteor's 2nd Life

In this episode of Syntax, Scott and Wes talk with Filipe Névola about Meteor and the exciting things happening in the Meteor world! 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. Sentry - Sponsor If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”. Guests Filipe Névola @filipenevola Show Notes 01:20 - What is your background? 03:41 - What exactly is Meteor? 12:00 - What are the biggest misconceptions of modern meteor? 18:20 - What do you say to people who think Meteor is dead? 21:33 - How does data get from your Meteor into your React app? Example of getting data on client side import { useTracker } from 'meteor/react-meteor-data' // Hook, basic use, everything in one component const MyProtectedPage = (pageId) => { const { user, isLoggedIn, page } = useTracker(() => { // The publication must also be secure const subscription = Meteor.subscribe('page', pageId) const page = Pages.findOne({ _id: pageId }) const user = Meteor.user() const userId = Meteor.userId() const isLoggingIn = Meteor.loggingIn() return { page, isLoading: !subscription.ready(), user, userId, isLoggingIn, isLoggedIn: !!userId } }, [pageId]) if (!isLoggedIn) { return Create an Account Log in } return {page.title} {page.content} Log out ({user.username}) } 27:50 - What do you think is the ideal usecase for Meteor? 31:09 - Why did Meteor 1.0 fail to maintain hype? 36:41 - What does Meteor’s future look like? 45:27 - Are there any plans to integrate serverless into Meteor? 46:55 - Any little known features of Meteor that people might be interested in? Links Meteor Tiny Capital Deno Meteor Galaxy Mongoose Parcel Apollo MongoDB Svelte Meteor repo Meteor Up https://howtocreateanapp.dev/ https://www.youtube.com/channel/UC8A0hHUaCBvuBs0eA5g_q3A Cordova Missive Meteor Forums ××× SIIIIICK ××× PIIIICKS ××× Filipe: 1: Galaxy 2: Terere Scott: Amplifi Alien Router Wes: Parcel - Global Package Tracking Shameless Plugs Filipe: @filipenevola Scott: All Courses - Sign up for the year and save 25%! Wes: All Courses - Use the coupon code ‘Syntax’ for $10 off! Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

29 Jul 20201h 4min

Hasty Treat - Target=_blank security issue? What's the deal with noopener and noreferrer?

Hasty Treat - Target=_blank security issue? What's the deal with noopener and noreferrer?

In this Hasty Treat, Scott and Wes talk about noopener and noreferrer and why you should use them with links that have blank targets. Sentry - Sponsor If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”. Show Notes 03:35 - What’s the big deal? If you have a link that is target="_blank" you should add rel=“noopener” and rel=“noreferrer” Retail Me Not uses it Valid use cases: Same domain change the page from a popup Cross domain changing page data Example: https://mathiasbynens.github.io/rel-noopener/ 05:39 - Why doesn’t the browser just fix it? Safari did - You can use rel=“opener” to allow it Firefox did Chrome hasn’t yet https://twitter.com/HugoGiraudel/status/801475801397030912 10:48 - Does this hurt SEO? It breaks analytics of the recipient site, turning a referral visit from your site into direct traffic, unless the link has UTM or similar tracking parameters. If you have a site where passing traffic offsite is part of the business model, links need an affiliate id instead. Links @argyleink Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

27 Jul 202014min

Potluck - Beating Procrastination × Rollup vs Webpack × Leadership × Code Planning × Styled Components × More!

Potluck - Beating Procrastination × Rollup vs Webpack × Leadership × Code Planning × Styled Components × More!

It’s another potluck! In this episode, Scott and Wes answer your questions about transitioning to backend dev, tips for beating procrastination, Rollup vs Webpack, code planning, growing as a leader 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. Sentry - Sponsor If you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”. Show Notes 02:33 - I am a junior dev, coming up on two years at my current agency. I have been primarily on the frontend using Angular and templating with Handlebars and other HTML and CSS. I have been asked if I would be interested in moving more into backend, with a focus on Node.js. Outside of creating APIs, what else should I do to learn “backend”? 06:08 - I work as a web master and would like to be a frontend developer someday. Currently I am working on a MERN stack app on my own to enhance my skills, but have problems focusing and tend to procrastinate a lot. How do you tackle distractions and get things done? I would appreciate some tips. 11:00 - Rollup or Webpack? Webpack 5 still doesn’t seem to support ES6 module output, as described by Philip Walton, so instead of upgrading to Webpack 5, this might be a good time to think about switching to Rollup (or Parcel). 13:46 - I have been learning web development (HTML, CSS and JS) and am at a place where I can build simple websites for small businesses, but I feel like a beginner and am wondering if you have any recommendations on courses to get to a more intermediate/advanced level? 18:01 - Why should you choose Styled Components over other ways of writing CSS? 22:56 - What are your thoughts on companies that make senior developer roles require leadership responsibilities? A great technical person does not always make a great leader or visa versa. 26:36 - I am often not good at planning out code from the start. I find that it’s easier to start coding, write a few lines, run it to see where I’m at, and carry on. This technique doesn’t work when I need to wait for a deploy to finish before I can view the result, as it greatly increases dev time. Do you have any advice for what I can do better? 31:43 - I have a very random question. for context I’m a Mac and Linux user myself. However, recently while building our company application I’ve noticed that Windows does extremely weird things with font sizes. Since we have a pretty decent Windows user base, obviously this is something my partner and I want to solve. However I’m very unsure of the best way to handle it. It seems entirely different from user to user. How in the world do we as developers account for these inconsistencies? We have tried vertical media queries that more or less kick them to tablet mode. Obviously this is less than optimal. 37:50 - Are side projects common among developers? I recently mentioned to my boss that I have a few side projects - nothing serious, just for learning mostly - and he said he would rather I didn’t, and instead focus on my work. He said he hadn’t really heard of developers doing side projects, and that if I want to work on things that aren’t our work he has other things I can do. Links inputmag.com Focus app TSdx Rollup Webapck Parcel Beginner Javascript Typescript Darknet Diaries ××× SIIIIICK ××× PIIIICKS ××× Scott: Malicious Life Podcast Wes: LaCie Rugged USB-C External HDD Shameless Plugs Scott: Modern CSS Design Systems - Sign up for the year and save 25%! Wes: Beginner Javascript - Use the coupon code ‘Syntax’ for $10 off! Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

22 Jul 202050min

Hasty Treat - Turbolinks + Server Generated HTML + JS Sprinkles

Hasty Treat - Turbolinks + Server Generated HTML + JS Sprinkles

In this Hasty Treat, Scott and Wes talk about turbolinks — what it is, how to use is, popular apps using is, 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. Show Notes 02:50 - What is turbolinks? Generate HTML on the server Send it over the ajax request Load it in the page 03:55 - Who is using Turbolinks? GitHub Basecamp Hey.com 05:24 - Turbo Links javascript browser bundle Intercepts any link click Fetches the page HTML 09:19 - JS Sprinkles Vanilla JS jQuery Stimulus Alpine JS Links Turbolinks Syntax 254: Headless CMS Break Down & Roundup pjax Svelte Next.js Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

20 Jul 202015min

Video for the Web 2020 and Beyond

Video for the Web 2020 and Beyond

In this episode of Syntax, Scott and Wes talk about the future of video for the web! 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. 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. Show Notes 08:19 - Scott’s Background in video Started editing in middle school Worked professionally as an editor and production assistant for magazine Created specialty flash video players Have been hosting video content since the start of my web career 09:12 - Terminology Transcoding - digital to digital conversion of one format to another Ingest - bringing a video to a new facility (ie uploaded video file or data stream to server) 10:51 - Streaming vs Downloading Streaming is basically chunks of content at a time, while download is waiting for the entire file to be downloaded before playing. 11:16 - Formats MP4 WebM DASH HLS (HTTP Live Streaming) m3u8 21:35 - Players shaka-player - https://github.com/google/shaka-player/ hls.js - https://hls-js.netlify.app/demo/ dash.js - https://github.com/Dash-Industry-Forum/dash.js video.js - https://videojs.com/ jw player - https://www.jwplayer.com/ Bit Movin player - https://bitmovin.com/docs/player Ooyala Brightcove - https://www.brightcove.com/en/ 27:48 - Services Roundup 🐴 YouTube - free Vimeo - $ MUX - $$ Wistia -  Cloudflare - $$ JW Player - $ Cloudinary - $$$ Brightcove - $$$ Azure - $$ Bit Movin - $$ AWS - $$ 46:59 - What Scott did and how/why upchunk Mux Video.js Custom uploader Using polling Links Basecamp Hey Inbox YouTube Wistia Drip ConvertKit Vimeo https://fronteers.nl/congres/2015/sessions/jsmpeg-by-dominic-szablewski https://www.vidbeo.com/blog/hls-vs-dash HLS Can I Use youtube-dl Syntax Ep 254: Headless CMS Break Down & Roundup Cloudflare Mux Framer Motion Cloudinary upchunk ××× SIIIIICK ××× PIIIICKS ××× Scott: Flexibility Focus Podcast Wes: Mustie1 YouTube Channel Shameless Plugs Scott: CSS Variables Course - Sign up for the year and save 25%! Wes: All Courses - Use the coupon code ‘Syntax’ for $10 off! Tweet us your tasty treats! Scott’s Instagram LevelUpTutorials Instagram Wes’ Instagram Wes’ Twitter Wes’ Facebook Scott’s Twitter Make sure to include @SyntaxFM in your tweets

15 Jul 202053min

Populært innen Politikk og nyheter

giver-og-gjengen-vg
aftenpodden
aftenpodden-usa
forklart
popradet
stopp-verden
fotballpodden-2
nokon-ma-ga
dine-penger-pengeradet
det-store-bildet
lydartikler-fra-aftenposten
rss-gukild-johaug
aftenbla-bla
hanna-de-heldige
bt-dokumentar-2
frokostshowet-pa-p5
unitedno
rss-ness
e24-podden
grasoner-den-nye-kalde-krigen