1 00:00:02,260 --> 00:00:05,730 So a lot has been optimized in our application already 2 00:00:05,830 --> 00:00:09,790 and as I said before, you might find more potential of course. 3 00:00:09,790 --> 00:00:13,440 Now let's turn our heads towards our terminal output here, 4 00:00:13,570 --> 00:00:18,850 we haven't got many warnings but there is one, that in the checkout.js file in our containers 5 00:00:18,850 --> 00:00:22,820 folder, that there is an import which we never use. 6 00:00:22,900 --> 00:00:24,310 Let's have a look, 7 00:00:24,310 --> 00:00:25,680 checkout container, 8 00:00:25,780 --> 00:00:28,390 there we import actions 9 00:00:28,600 --> 00:00:33,920 and indeed in this file, we never dispatch any actions so we may simply get rid of that. 10 00:00:34,090 --> 00:00:36,880 And that's in general an important thing, 11 00:00:36,880 --> 00:00:40,550 have a look at your console output, it shouldn't show any warnings, 12 00:00:40,570 --> 00:00:45,820 remove unnecessary imports to prevent bloating your final bundle size 13 00:00:45,820 --> 00:00:49,310 and speaking of console output, this one is clean now 14 00:00:49,330 --> 00:00:54,490 but if we have a look at the console of our running application we notice that we have a lot of console 15 00:00:54,490 --> 00:01:00,620 log statements, in the modal, in the burger, in the burger builder, probably somewhere else. 16 00:01:00,700 --> 00:01:06,400 It is also a good idea to clean up your application not because these console log statements would 17 00:01:06,400 --> 00:01:12,590 be that bad but they will be there in production too and they will give insights into your application 18 00:01:12,610 --> 00:01:17,770 and besides that, you don't really need to spam the console with output that doesn't matter to you anymore. 19 00:01:17,980 --> 00:01:21,460 So let's visit these three files here to begin with cleaning up, 20 00:01:21,490 --> 00:01:23,280 I'll have a look at the burger.js 21 00:01:23,440 --> 00:01:29,360 file in the components folder and find the console log statement there, 22 00:01:29,410 --> 00:01:32,140 here where we output props, let's remove that. 23 00:01:32,500 --> 00:01:39,520 Another one can be found if we go to burger builder, in burger builder files in the burger builder 24 00:01:39,520 --> 00:01:47,530 container, lets visit this file too and let's have a look at where we use console log here in 25 00:01:47,530 --> 00:01:47,960 componentDidMount, 26 00:01:47,960 --> 00:01:50,990 let's also remove that and the other one was in the modal 27 00:01:51,010 --> 00:01:57,370 so let's also visit that in the UI folder, in the components folder, there we log in the componentWillUpdate 28 00:01:57,370 --> 00:02:02,770 and I can remove this entire block since we don't do anything else there. We did this in the past 29 00:02:02,770 --> 00:02:04,880 to get some insights when this gets fired, 30 00:02:04,900 --> 00:02:11,260 it's not interesting to us anymore. You see we also do some logging in orderSummary when we add and remove 31 00:02:11,260 --> 00:02:12,320 ingredients, 32 00:02:12,380 --> 00:02:20,230 so let's visit the orderSummary too, we can find that in the burger part of our components, there 33 00:02:20,230 --> 00:02:24,460 we have the order summary component and in there, if we have a look, 34 00:02:24,520 --> 00:02:30,110 we find the console log statement in componentWillUpdate so we can remove this too. 35 00:02:30,580 --> 00:02:37,330 And with that, we could also convert this again into a functional component because all we do is just 36 00:02:37,330 --> 00:02:42,670 render something. Now I'll leave it a class based one here but you could easily convert this to optimize this 37 00:02:42,670 --> 00:02:47,530 even further. With that let's see, where else do we get console log statements, 38 00:02:47,620 --> 00:02:56,160 let's continue and let's quickly sign ourselves in, switch to sign in so we get output here in auth.js, 39 00:02:56,280 --> 00:02:59,100 that is our action creator file. 40 00:02:59,340 --> 00:03:01,740 Let's see if we get some output somewhere else, 41 00:03:01,740 --> 00:03:11,090 if I just entering some arbitrary values here in the order field and I click order, then we also get 42 00:03:11,090 --> 00:03:13,150 one from the order actions file, 43 00:03:13,160 --> 00:03:20,700 so let's visit these files too in in the actions folder, auth.js had a console log statement, 44 00:03:20,720 --> 00:03:26,630 so let's get rid of that and let's get rid of the console log statement in the order file in the same folder, 45 00:03:26,950 --> 00:03:27,360 there 46 00:03:27,380 --> 00:03:28,440 console log, 47 00:03:28,490 --> 00:03:36,370 let's remove that too. Now we might have more console log statements somewhere in our application but I 48 00:03:36,370 --> 00:03:40,280 think I removed most of them, feel free to remove any other. Again, 49 00:03:40,330 --> 00:03:43,160 certainly not that harmful if you leave them in there 50 00:03:43,180 --> 00:03:44,990 but it's better if you get rid of them.