Solid JS Tutorial #17 - Final Touchs & SolidStart Preview
Skills:
Frontend Performance60%
Key Takeaways
This video tutorial covers the final touches of a Solid JS project, including adding a message and disabling a button when a product is added to the cart, and also provides a preview of SolidStart, a meta framework for Solid JS.
Full Transcript
All right then gang, so we're reaching the end of the project now, but there's one more thing I want to do and that's to add a little message right here when we click on the add to cart button to say, "Yep, we've just added this product to the cart." And also, maybe I want to disable this button for a second or two when we're adding to the cart so we can't spam click this over and over. So, what we'll do is go to the product component and right here we're adding a product, right? So, it's at this point that I want to do those two things. I want to show the message and maybe the button. Now, to do this we're going to use a signal. So, let me create that signal right about here. So, we'll say const and we'll call this adding and also set adding and we set that equal to use signal. Like so and the initial value for that is going to be false. So, the idea being that this is going to be changed to true when we add a product just for about 2 seconds, okay? So, I need to make sure we're importing use signal or not use signal, sorry. It should be create signal, shouldn't it? Create signal, like so. And that comes from solid js create signal, okay? So, now inside add product, what I could do is I could set adding to be true because we're adding a product and then I will use a set timeout to fire a function and that function is going to fire after 2 seconds, so 2,000 milliseconds. And all we're going to do inside this function is set adding to be false again. So, basically every time we add a product, it becomes true for 2 seconds and then it becomes false again. Okay? So, now we can update the UI down here dependent on that value. So, there's two things I wanted to do like I said. So, first of all, I want to make the button disabled while adding is true for those 2 seconds. So, disabled is equal, oops. Make sure you spell this correctly. My spelling is atrocious at the minute. Disabled equals and it's adding like so. And then after the button, I want to conditionally output some kind of message. So, I only want to show this message when adding is true. Now, to do that we can use the show component. So, let me paste this in and we say show when adding. So, when it's true, after we've just clicked on the button for 2 seconds, we show this div right here with these styles. So, we give it margin, padding, border amber, border two, rounded, inline block and we show the title of the product and we say it was added to the cart. So, this is going to show for 2 seconds next to the button when we click the button, but then when adding becomes false again after 2 seconds, it's not going to show anymore. All right? So, let's cross our fingers, hope this works. I'm going to add to cart and we can see this message right here for 2 seconds. And also, if I click on this, it becomes disabled for 2 seconds as well. You can tell because of the icon. You could style the disabled state a little better if you wanted to, but you can tell because the icon's an arrow while it's disabled and not the pointer. All right? All right then gang, so that's the project pretty much complete and that's also the tutorial series complete as well. There are other features you can add to the site if you want to practice using Solid a little bit more. For example, you could add a delete button next to each item to delete those from the cart or you could add a quantity input on the product details page to let users add more than one of a product at a time. So, definitely try adding those features yourself if you want a bit more practice. But also, I want to show you something really quickly called SolidStart as well. And this is something I really want to make a tutorial about in the future. It's still in alpha at the moment, but when we do get a stable release, I definitely will make a course about it. So, SolidStart is essentially to Solid what Next is to React or what Nuxt is to Vue. It's a meta framework built on top of Solid that implements server-side rendering out of the box, static site generation if that's what you want, component-based routing, API routes, etc. So, it looks really exciting and it's definitely something I'm looking forward to working with a little bit more. And like I said, when we get a stable release, I will hopefully be making a new course all about that as well. So, keep your eyes peeled. So then my friends, I really, really hope you enjoyed this series and you learned something along the way. If you did, please, please, please, don't forget to share, subscribe and like. That really means a lot. And if you want to access all of my YouTube courses without adverts, also get access to premium courses and early access courses as well, you can do at netninja.dev. You can sign up for Net Ninja Pro, which is just $9 a month and also half price for the first month with this promo code right here. And for that, like I said, you get access to every course without adverts, without YouTube adverts. You also get access to exclusive courses not found anywhere else. You get access to my premium courses on Udemy and also early access to all of my YouTube courses as well. So, the link to this page to sign up is going to be down below. Again, I really hope you enjoyed this series and I'm going to see you in the very next one. [Music]
Original Description
🚀🥷🏼Get early access to this entire course now on Net Ninja Pro:
https://netninja.dev/p/solid-js-tutorial
📂🥷🏼 Access the course files on GitHub:
https://github.com/iamshaunjp/solid-js-tutorial
💻🥷🏼 Modern JavaScript Tutorial:
On Net Ninja Pro - https://netninja.dev/p/modern-javascript-from-novice-to-ninja
On YouTube - https://www.youtube.com/watch?v=iWOYAxlnaww&list=PL4cUxeGkcC9haFPT7J25Q9GRB_ZkFrQAc
💻🥷🏼 Tailwind CSS Tutorial:
On Net Ninja Pro - https://netninja.dev/p/tailwind-css-tutorial
On YouTube - https://www.youtube.com/watch?v=bxmDnn7lrnk&list=PL4cUxeGkcC9gpXORlEHjc5bgnIi5HEGhw
🔗🥷🏼 Solid Playground - https://playground.solidjs.com/
🔗🥷🏼 Solid JS docs (getting started) - https://www.solidjs.com/guides/getting-started
🔗🥷🏼 Solid Router docs - https://github.com/solidjs/solid-router#getting-started
🔗🥷🏼 VS Code - https://code.visualstudio.com/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Net Ninja · Net Ninja · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Regular Expressions (RegEx) Tutorial #14 - Matching a Username
Net Ninja
Regular Expressions (RegEx) Tutorial #15 - Email RegEx Pattern
Net Ninja
Regular Expressions (RegEx) Tutorial #16 - Finishing Touches
Net Ninja
GraphQL Tutorial #1 - Introduction to GraphQL
Net Ninja
GraphQL Tutorial #2 - A Birdseye View of GraphQL
Net Ninja
GraphQL Tutorial #3 - Project (stack) Overview
Net Ninja
GraphQL Tutorial #4 - Making Queries (front-end preview)
Net Ninja
GraphQL Tutorial #5 - Express App Setup
Net Ninja
GraphQL Tutorial #6 - Setting up GraphQL
Net Ninja
GraphQL Tutorial #7 - GraphQL Schema
Net Ninja
GraphQL Tutorial #8 - Root Query
Net Ninja
GraphQL Tutorial #9 - The Resolve Function
Net Ninja
GraphQL Tutorial #10 - Testing Queries in Graphiql
Net Ninja
GraphQL Tutorial #11 - GraphQL ID Type
Net Ninja
GraphQL Tutorial #12 - Author Type
Net Ninja
GraphQL Tutorial #13 - Type Relations
Net Ninja
GraphQL Tutorial #14 - GraphQL Lists
Net Ninja
GraphQL Tutorial #15 - More on Root Queries
Net Ninja
GraphQL Tutorial #16 - Connecting to mLab
Net Ninja
GraphQL Tutorial #17 - Mongoose Models
Net Ninja
GraphQL Tutorial #18 - Mutations
Net Ninja
GraphQL Tutorial #19 - More on Mutations
Net Ninja
GraphQL Tutorial #20 - Updating the Resolve Functions
Net Ninja
GraphQL Tutorial #21 - GraphQL NonNull
Net Ninja
GraphQL Tutorial #22 - Adding a Front-end
Net Ninja
GraphQL Tutorial #23 - Create React App
Net Ninja
GraphQL Tutorial #24 - Book List Component
Net Ninja
GraphQL Tutorial #25 - Apollo Client Setup
Net Ninja
GraphQL Tutorial #26 - Making Queries from React
Net Ninja
GraphQL Tutorial #27 - Rendering Data in a Component
Net Ninja
GraphQL Tutorial #28 - Add Book Component
Net Ninja
GraphQL Tutorial #29 - External Query File
Net Ninja
GraphQL Tutorial #30 - Updating Component State
Net Ninja
GraphQL Tutorial #31 - Composing Queries
Net Ninja
GraphQL Tutorial #32 - query variables
Net Ninja
GraphQL Tutorial #33 - Re-fetching Queries
Net Ninja
GraphQL Tutorial #34 - Book Details Component
Net Ninja
GraphQL Tutorial #36 - Styling the App
Net Ninja
GraphQL Tutorial #35 - Making a Single Query
Net Ninja
Build Apps with Vue & Firebase - Udemy Course
Net Ninja
Updated Vue & Firebase Course (Udemy)
Net Ninja
Vue & Firebase Real-time Chat (Preview) #1 - Intro
Net Ninja
Vue & Firebase Real-time Chat (Preview) #2 - Project Structure
Net Ninja
Vue & Firebase Real-time Chat (Preview) #3 - Firestore Setup
Net Ninja
Vue & Firebase Real-time Chat (Preview) #4 - Welcome Screen
Net Ninja
Vue & Firebase Real-time Chat (Preview) #5 - Props in Routes
Net Ninja
Vue & Firebase Real-time Chat (Preview) #6 - Route Guards
Net Ninja
Vue & Firebase Real-time Chat (Preview) #7 - Chat Window
Net Ninja
Vue & Firebase Real-time Chat (Preview) #8 - New Message Component
Net Ninja
Object Oriented JavaScript Tutorial #1 - Introduction
Net Ninja
Object Oriented JavaScript Tutorial #2 - Object Literals
Net Ninja
Object Oriented JavaScript Tutorial #3 - Updating Properties
Net Ninja
Object Oriented JavaScript Tutorial #4 - Classes
Net Ninja
Object Oriented JavaScript Tutorial #5 - Class Constructors
Net Ninja
Object Oriented JavaScript Tutorial #6 - Class Methods
Net Ninja
Object Oriented JavaScript Tutorial #7 - Method Chaining
Net Ninja
Object Oriented JavaScript Tutorial #8 - Class Inheritance
Net Ninja
Object Oriented JavaScript Tutorial #9 - Constructors (under the hood)
Net Ninja
Object Oriented JavaScript Tutorial #10 - Prototype
Net Ninja
Object Oriented JavaScript Tutorial #11 - Prototype Inheritance
Net Ninja
More on: Frontend Performance
View skill →Related Reads
📰
📰
📰
📰
Next.js 16.3: SPA Hızı Sonunda Framework’ün İçinde — Instant Navigations
Medium · JavaScript
Creta Frontend Interview Experience | Remote Role
Medium · JavaScript
The Case of the Ghost Tooltip
Medium · JavaScript
How I made a scroll-scrubbed video portfolio fast (Next.js 15 + GSAP + canvas)
Dev.to · Pratham Sharma
🎓
Tutor Explanation
DeepCamp AI