WebDevPro #24: Rust memory, Bun hype, Unit Testing, Bard with Google Apps, Ruby Sorbet types.
Advertise with Us | Sign Up to the Newsletter
Hi,
Welcome to the _webdevpro! We start with community discussions on:
In our tutorial, we cover Converting JavaScript code into TypeScript from the book React 18 Design Patterns and Best Practices to help articulate your coding. Don't miss our repository of ChatGPT resources - a weekly module covering trending ChatGPT tools. We also bring you the latest in Web Dev, with releases from Django, PostgreSQL, Svelte and Spring to help you keep up to date!
We have listened to the _webdevpro readership and we think this is something you have been searching for. If you liked this installment in our new series, fill in our survey below and win a free Packt PDF.
Take the Feedback Survey and Get Free Packt PDF!
Thanks,
Apurva Kadam
Editor-in-Chief, Packt
WebDev Community Speak
What is the WebDev industry talking about? Latest Developments? Cool tricks? Tutorials? Cheatsheets? How are Web Developers upskilling? Read about it all here.
How Rust memory management work to beginners - Do you ever thought about what happens to your RAM when you run a program? And how the ways you write code can interfere with many other things in your system? That article will help you to understand more about management memory and how rust works in this area. Learn more.
Bun hype. How we learned nothing from Yarn – In this blogpost you will find The Jared Wilcurt’s rant about Bun. “Here we go again, making the same mistake. I'm constantly reminded that every 5 years the number of programmers in the world doubles, which means at any point, 50% of the industry has less than 5 years’ experience. Which is probably why we keep falling for stuff like Bun.” – an excerpt of what you’re in for!
The 5 principles of Unit Testing - Testing your code is one of the most important aspects of software development, as it ensures quality, scalability, and reliability of your product. But, without any guidelines, it can be difficult to write effective tests. In fact, testing code can become more complex and harder to maintain than the actual production code! Get your software development to the next level with these 5 powerful principles of unit testing!
Bard Can Now Connect to Your Google Apps - Google made some updates to its most capable model — PaLM 2. This means that Bard can now connect to your Gmail, Google Docs, and Drive to get things done quickly without having to copy/paste text every time you use a Google product. In this article, we’ll see how to enable extensions, how to use them, and other cool features that now Bard supports.
Bringing more sweetness to Ruby with Sorbet types - Have you ever wanted to add type-checking to your Ruby code? Going from a rubber duck to a full-armed duck? (pun intended) no? So allow me to introduce you to type checking using the provided gem sorbet created by Stripe.
WebDev Repos
ChatGPT is still trending and the resources and tools to make the most out of this LLM are just getting better with every passing day! So we at WebDevPro highlight ChatGPT resources in a week-on-week series. This week we bring you some ChatGPT integrations:
chatgpt-raycast - Raycast extension.
mpociot/chatgpt-vscode - VSCode extension.
gencay/vscode-chatgpt - VSCode extension.
org-ai - Emacs org-mode.
vim-chatgpt - Vim plugin.
ChatGPT.nvim - Neovim plugin.
ChatGPT Jetbrains - Jetbrains plugin.
DocGPT - Writing assistant for Google Docs.
docGPT - Use ChatGPT in Google Docs.
WordGPT - Use ChatGPT in Microsoft Word.
Add ChatGPT to Microsoft Word - How to integrate ChatGPT with Microsoft Word.
Open Assistant Helper - Improve Open Assistant with ChatGPT.
ChatGPTWizard - Embarcadero RAD Studio (Delphi & C++ Builder) plugin.
Tell us what you think!
Your feedback is invaluable to us. Would you take a few minutes to share your thoughts about the newsletter? Your responses will help us make the newsletter better. Provide feedback through this survey, complete the questionnaire and receive a free PDF!
Interested in Giving Us Feedback?
WebDev DIY Tutorial
In this week's tutorial we bring you React 18 patterns with a focus on TypeScript.
Converting JavaScript code into TypeScript
In this section, we will see how to transform some JavaScript code into TypeScript.
Let’s suppose we have to check whether a word is a palindrome. The JavaScript code for this algorithm will be as follows:
function isPalindrome(word) {
const lowerCaseWord = word.toLowerCase()
const reversedWord = lowerCaseWord.split('').reverse().join('')
return lowerCaseWord === reversedWord
}You can name this file palindrome.ts.
As you can see, we are receiving a string variable (word), and we are returning a boolean value. So, how will this be translated into TypeScript?
function isPalindrome(word: string): boolean {
const lowerCaseWord = word.toLowerCase()
const reversedWord = lowerCaseWord.split('').reverse().join('')
return lowerCaseWord === reversedWord
}You’re probably thinking, “Great, I just specified the string type as word and the boolean type to the function returned value, but now what?”
If you try to run the function with some value that is different from string, you will get a TypeScript error:
console.log(isPalindrome('Level')) // true
console.log(isPalindrome('Anna')) // true
console.log(isPalindrome('Carlos')) // false
console.log(isPalindrome(101)) // TS Error
console.log(isPalindrome(true)) // TS Error
console.log(isPalindrome(false)) // TS ErrorSo, if you try to pass a number to the function, you will get the following error:
Type number is not assignable to parameter of type string
That’s why TypeScript is very useful, because it will force you to be stricter and more explicit with your code ...read more.
Read the free chapter from 'React 18 Design Patterns and Best Practices' now!
WebDev Spotlight
Recommendations to boost your CMS and Java development game!
Microservices with Spring Boot 3 and Spring Cloud
Build cloud-native production-ready microservices and stay ahead of the curve
Understand the challenges of building large-scale microservice architectures
Learn how to get the best out of the latest updates, including Spring Boot 3, Spring Cloud, Kubernetes, and Istio
Modernizing Drupal 10 Theme Development
Explore real-world examples with proven methodologies to gain a deeper insight into the Drupal theme layer
Improve performance and accessibility with a decoupled frontend to consume data exposed by Drupal’s APIs
Learn how to translate a graphic design into a maintainable and robust Drupal theme
What's Happening in Web Dev?
Your dose of the latest releases, news and happenings in the Web Development industry!
Django
Django 5.0 alpha 1 released - Django 5.0 alpha 1 is now available. It represents the first stage in the 5.0 release cycle and is an opportunity for you to try out the changes coming in Django 5.0. Django 5.0 brings a deluge of exciting new features which you can read about in the in-development 5.0 release notes.
PostgreSQL
PostgreSQL 16 Released! - The PostgreSQL Global Development Group announced the release of PostgreSQL 16, the latest version of the world's most advanced open source database. PostgreSQL 16 raises its performance, with notable improvements to query parallelism, bulk data loading, and logical replication.
Spring
Spring Boot 3.1.4 available now - Spring Boot 3.1.4 has been released and is now available from Maven Central. This release includes 50 bug fixes, documentation improvements, and dependency upgrades.
Svelte
Introducing Runes: Rethinking 'rethinking reactivity' - A common piece of feedback was 'I wish I could write all my JavaScript like this'. When you're used to things inside components magically updating, going back to boring old procedural code feels like going from colour to black-and-white. Svelte 5 changes all that with runes, which unlock universal, fine-grained reactivity.
I am taking the next week off for some much needed TLC, the next edition of WebDevPro will be in your inbox in the first week of October. See you then!
Someone Forwarded this Email? Subscribe Here!
We understand that people move on or sometimes need a break away from emails. If you wish to stop receiving _webdevpro emails, simply opt out using the button below.





