Potluck - Subscriptions ES Modules in Node Chicken Thigh Being a Good Dad Refactoring More!

Published: Aug. 19, 2020, 1 p.m.

It\u2019s another potluck! In this episode, Scott and Wes answer your questions about React subscriptions, ES Modules in Node, how to cook a chicken thigh, being a good dad and more!

Sentry - Sponsor

If you want to know what\u2019s happening with your errors, track them with\xa0Sentry. 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\xa0Sentry.io\xa0and using the coupon code \u201ctastytreat\u201d.

Stackbit - Sponsor

Stackbit offers developers tools that enable things like inline content editing, live previewing of content changes, and collaboration features on your Jamstack site, without code changes. That\u2019s why
Stackbit is the best way to Jamstack.\xa0stackbit.com.

Show Notes

02:11 - What are \u201csubscriptions\u201d in React, or in programming in general? The React docs mention that setting up a subscription is an example of a side effect, but what exactly is a subscription, and how do you set one up?

05:43 - Using the latest node esm imports, is it possible to use aliases? Using the old require() syntax I used the npm package module-alias (https://www.npmjs.com/package/module-alias), but I cannot seem to find a solution for node v14 imports. In a deeply nested file, I find the import \u2018\u2026/\u2026/\u2026/some/folder\u2019 syntax to be awful compared to require(\u2019@/some/folder\u2019).

09:20 - I\u2019ve been a full-time developer for over 10 years and my company has a fairly flat hierarchy. I want to take on more responsibility (and salary) but my company doesn\u2019t have anything like a \u201clead developer\u201d position. Any ideas for how to move up without switching companies? I know my boss would be receptive if I came to him with a pitch, but we work full stack so it feels like I\u2019m already doing it all.

12:59 - In Wes\u2019 website episode, he mentioned using Gatsby Parallels for images. Why not git LFS?

17:25 - For Wes: Any Big Green Egg tips for beginners? I just ordered a kamado style grill and I\u2019d appreciate any tasty tips you\u2019ve got.

22:45 - Inline code is considered harmful because of potential XSS attacks. Lighthouse recommends inlining critical CSS to improve page speed. What do you think about this tradeoff?

26:30 - What advice would both of you have for being a first-time father, and how can I best prepare? My wife is pregnant, and we are both very excited! I want to do the best I can at being a good father. Our baby is due in January. As both of you are fathers (multiple times), I would love to hear your thoughts.

32:58 - Are present web developers merely crud bastards for corporate culture? If not, What entrepreneurial opportunities are open with Javascript and hooking up React with backend Node/Laravel and reading the Google Map docs? Of course the list isn\u2019t exhaustive but you get my point right? Note: I\u2019m not interested in selling courses and creating frameworks.

37:08 - Do you have any use for ES6 Generators and\xa0yield? It seems that they are a mechanism for async-await \u201cunder the hood,\u201d so using \u2018async-await\u2019 is probably sufficient.

39:10 - With a legacy project that has old build dependencies how do you decide when to retool and fix all the npm audit issues?

46:10 - In what instances do you prefer to use rem vs em vs pixels for font size? I usually think about it like so: if I\u2019m okay with an element\u2019s font size being sized based on the parent, then I\u2019ll use em. If not, then I\u2019ll use rem. I almost never use pixels anymore except sometimes on the html element. But even then, I usually use a percentage. In practice, I\u2019ve found it a bit hard to gauge what to expect with ems because of nesting issues. So, I\u2019ve mostly been leaning towards rem. Though I also understand that using rems can be less modular. How do you guys make the decision?

52:49 - Hello chaps. Thank you so much for the show, I\u2019ve learned an awful lot through listening. I\u2019ve been dabbling in development for some time now and have taken on a project for an Express site which aside from a few static pages will include a shop with a small number of items (<5), customer dashboard (order tracking and submitting supplementary order info), and an image centric journal/blog section. I\u2019ve listened and re-listened to your CMS roundup which is great, but having worked through Wes\u2019 Node course I\u2019m kinda thinking why would I spend the time integrating a CMS when I can just build an \u2018Add Post\u2019 page for admin users, save the posts in Mongo, upload images to my server, and use Cloudflare\u2019s free tier CDN. Please explain why this is (or isn\u2019t\U0001f937\u200d\u2642\ufe0f) a bad idea, and more generally share your wisdom on when a CMS is or isn\u2019t actually necessary. PEAACE!

Links \xd7\xd7\xd7 SIIIIICK \xd7\xd7\xd7 PIIIICKS \xd7\xd7\xd7 Shameless Plugs Tweet us your tasty treats!