Transcript
Hello friends, great news. Vin Cs version four has been released, and in this episode they're going to upgrade Tel CSS from Vision three to Vision four in Ribbon Rails application. Specifically, they're going to do it for super rails.com. Now, there is this official upgrade guide on the Tel CSS Docs website. They can run this x upgrade next command on nt. And actually this upgrade guide features some really great, uh, overview of what has changed from Vision three to Vision four, what has been de deprecated, what is the new best approach to ride these specific classes. And, uh, there are examples of like, uh, how, uh, the spacing has changed for some elements. For example, like previously the default ring was ring three pixels, I think, and now to have ring three pixels and to have ring three. So a bunch of classes have been updated. Now, if you are using Rails, starting version seven, whenever you type, uh, rails new with the tail vin, you'll have the gem tail Vin CSS, uh, rails installed. And this is basically the easiest way to have tail Vin CSS working Ruben Rails application. So here has the gem, and the gem has just been upgraded so that the, you can use it with a Vin SS version four. And there's also a wonderful upgrade guide on how to upgrade from version three to version four. Now, before we upgrade, let's have a look at how VIN S is installed in this application. So I've got Rails eight running. I've got, uh, prop shaft, and uh, I've got input maps and Vin S rails, the Gem. Now, uh, if I type, uh, Delvin, uh, in the search I have this Devin config file. Uh, most of the stuff is the default. So there are the plugins that, uh, what is not default is that I added, um, the app slash components folder that needs to be also watched by Delvin, so that, uh, if I, uh, add any TNT classes in the view components, these are also updated. Then I, um, rebuild, uh, NT and I also added some custom colors. So, uh, I cope with some of the colors from GitHub in the super. You see, I've got the Nev bar, the body that, uh, are the same as, uh, in GitHub. So I added these colors and now I can define background, uh, GitHub, uh, nev Bar for example. Here I'm using it. So this is, uh, custom. And I've also got this tele application, tele CSS file where we import the tailwind, uh, uh, base components and utilities. And I defined also a few of my custom styles. And, uh, if I look for tailwind, so I got Tailwind also defined in the head of my application layout. So import tailwind and uh, I have it in the profile. So profile dev, uh, whenever I make any changes in tnt, uh, TNT is rebuilt and specifically it is rebuilt in app assets builds NT css. So this is where the NT is actually present. Okay, so, uh, let's follow the upgrade guide. Uh, now at the moment I have NT fixed on version uh, three. So whenever I type, uh, bundle or bundle update, it's not going to make a major version bump. So to allow Vision four, I'm going to set vision four here, run bundle. Okay, you see I have upgraded to Vision four, and now I will need to run the upgrade guide. So, um, it is been Rail telling s upgrade. Let's run this command. Okay, I get this error because cannot find med module relevant CSS forms. And, uh, let's see what has actually been done. So we started the upgrade, but it got interrupted. So we removed this CSS file, we added a new, uh, CS file and, uh, some changes were attempted in the tele config file. I'm going to undo all of this and I'm going to completely remove this plugins. I will run the Command V scan. Okay, this time it looks like it was successful. So what has changed? NT config has been removed. Application VIN CSS has been removed and everyone has been merged into the application to CSS file. So, uh, uh, the NT config and relevant clause can all be present in just one CSS file. It's much better than having the tele link config in a GS file. And you see the colors have moved into the theme. Now, instead of having three imports, we have just, uh, one input CSS. We've got this other element that has been added by default. So when you have like an asset picker, like select the file there is going to be a brown, uh, uh, a gray border on the bottom. So it is not transparent. And all my other custom classes have been pushed here. Okay, looks good. Let's try running the application bin dev. Okay, I've got this error. So inter font is not found. Let's go to her head and uh, I can just try removing into font. Okay, the app seems to be running. So here is production and here is local. You see the spacing is slightly different. The, uh, app mostly looks the same, but the spacing is slightly different. And, uh, if locally I open some pages, you see, uh, the aspect ratio is not, uh, working, then uh, dialogs are not spaced, uh, in the right way. Like here the dial is spaced in the center, so somethings need to be updated. Now, uh, before we do this, uh, let's have a look how VIN is installed in a new rails, uh, eight application, because that's always a great way to ensure that you're doing everything the right way is create a new application for the default config and see how it's installed there. So here I've just created a new, uh, res application with the tail end, and if I go to the G file lock, I have VIN version four installed. So, um, let's search for vin. You see, we just have application vin, CS s, and it has only one input, nothing else, very clean. And, uh, if you go to application layout, you see, uh, here has just one style sheet tag to app. In my version we have, uh, a few style sheets like VIN application and uh, another import. So I can maybe replace, uh, everything I've got here with the style sheet link tag app. I think it works for input maps and uh oh for prop shaft. So let's refresh. Yeah, works as before. So I don't need to define all these imports, however, just to double check, let's, let's just, uh, comment out VIN and see if loading application works. Oh yeah, I'm in the wrong window. Okay, so here you see I'm not loading VIN file and uh, it looks bad. I'm loading Tailwind, It Works. I will, uh, uh, where was I? I will comment. Uh, NT application and whole out and allow app. Yeah, so it works. Okay. Now, uh, next, uh, you will want to follow the upgrade guide and update all the, uh, elements. You can do it manually, like all, all the changes, uh, like previously had this, uh, naming. Now we need to have this naming. So, uh, to update this, there's also something in the upgrade guide. There's updated CS s plus names for vision form. So it's for the guide. I will open gi, ignore, I will add the note modules. I don't want to comment them obviously. Then, uh, package, do Jason creating this file copy. In this I will remove all the commented out text. Okay, now I need to run NPO Yarn Run Yarn. Okay, uh, this has been installed. Let's have a look at our diff. So there's out of stuff, I need to also put Jan into gi. So Jan and uh, yeah, package. Jason, I don't have to commit all this, uh, stuff. Uh, Jan Lock, pnp, CJs. I want to ensure that these files are not, uh, pushed to production. I need them just to, uh, upgrade that, tell them the classes And uh, this PNP below the GS oh MGS. Okay. Now, uh, next I need to uh, add additional.in the JS file, but we have removed it, so I'm going to undo all the changes I did here, here, and here from the national, uh, update command. So you see now I've, uh, kind of cleaned everything up once scan and removing all the plugins. Then the read says that I need to add an additional.in on the beginning of each of these content lines. Okay? Uh, now I, uh, added the package. Jason, I'll run young once scan, run the, the upgrade command and wonderful. So you see a lot of, uh, the files have been scanned and have been updated. Okay, uh, let's, uh, well now you can like remove all these packages and yarns from your application because the upgrade has been successful. Let's try running the application bin slash dev. Okay, seems to be broken. Uh, let's try changing some colors and see if, uh, the s has been watched correctly from pro profile. So I'll go to like body and change it to background Orange 500 for example. You see, it hasn't been updated. So, uh, the watch command, uh, isn't working from pro profile and uh, it might not be working because if I open Bin Dev, I have uh, just this. But, uh, if I have bin Dev in ndu application bin slash dev, you see it this slightly different. So maybe I would need to go with this bin Dev into my application and let's see if it works. Always good to have a reference to a new Rails app. Okay, uh, this orange color works. Let's try, uh, another color background, uh, slate, uh, or green 500 something that is definitely not used in the application. Okay, it works. Um, so wonderful. I needed to also update the bin dev, uh, for Tel which to work correctly. And now let's have another look at the application. So here, for example, the aspect ratio doesn't work, uh, going to the upgrade guide. Um, somewhere I've seen this layout, things aspect ratio. So, um, at the moment, let's see how aspect ratio is set in the application aspect. You say have aspect width and height. It's the old approach. And now you can just set aspect video that would be also 16 by nine. So everywhere I'm going to, uh, replace aspect 16, aspect nine to aspect video, find and replace refresh. Okay, now it's Firkin. And also for these, uh, models. So, uh, looking at the, uh, tell them the UI examples for models have have fixed inside zero on the models for them to be in the center. Let's, uh, try adding these clause to our models. Uh, I have it search slash form here I have a dialogue. And for the dialogue here, I will set a fixed inset, uh, zero refreshing. Uh, it didn't help. Uh, I might also have to say M Auto. Okay, yes. Now it is in the center, but you see the background is, uh, not see-through. It is because, uh, in the upgrade guides, they also have something about, uh, depreciations in the background, uh, in opacity. So you see previously we had opacity, and now we put the background slash the level of opacity. So here I have back backdrop, background, GitHub, body and Opacity 80. So I will just make it slash 80. Let's, uh, refresh and see it works okay, and it's working so wonderful. Now, uh, you see I followed the upgrade guide, upgraded, everything is working, but there are still a few places that you need to manually click through and, uh, ensure that, uh, they work well with the latest version of tail end. So that's about it. Thanks for watching and see you in the next one.
1