So a lot has been optimized in our application already
and as I said before, you might find more potential of course.
Now let's turn our heads towards our terminal output here,
we haven't got many warnings but there is one, that in the checkout.js file in our containers
folder, that there is an import which we never use.
Let's have a look,
checkout container,
there we import actions
and indeed in this file, we never dispatch any actions so we may simply get rid of that.
And that's in general an important thing,
have a look at your console output, it shouldn't show any warnings,
remove unnecessary imports to prevent bloating your final bundle size
and speaking of console output, this one is clean now
but if we have a look at the console of our running application we notice that we have a lot of console
log statements, in the modal, in the burger, in the burger builder, probably somewhere else.
It is also a good idea to clean up your application not because these console log statements would
be that bad but they will be there in production too and they will give insights into your application
and besides that, you don't really need to spam the console with output that doesn't matter to you anymore.
So let's visit these three files here to begin with cleaning up,
I'll have a look at the burger.js
file in the components folder and find the console log statement there,
here where we output props, let's remove that.
Another one can be found if we go to burger builder, in burger builder files in the burger builder
container, lets visit this file too and let's have a look at where we use console log here in
componentDidMount,
let's also remove that and the other one was in the modal
so let's also visit that in the UI folder, in the components folder, there we log in the componentWillUpdate
and I can remove this entire block since we don't do anything else there. We did this in the past
to get some insights when this gets fired,
it's not interesting to us anymore. You see we also do some logging in orderSummary when we add and remove
ingredients,
so let's visit the orderSummary too, we can find that in the burger part of our components, there
we have the order summary component and in there, if we have a look,
we find the console log statement in componentWillUpdate so we can remove this too.
And with that, we could also convert this again into a functional component because all we do is just
render something. Now I'll leave it a class based one here but you could easily convert this to optimize this
even further. With that let's see, where else do we get console log statements,
let's continue and let's quickly sign ourselves in, switch to sign in so we get output here in auth.js,
that is our action creator file.
Let's see if we get some output somewhere else,
if I just entering some arbitrary values here in the order field and I click order, then we also get
one from the order actions file,
so let's visit these files too in in the actions folder, auth.js had a console log statement,
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,
there
console log,
let's remove that too. Now we might have more console log statements somewhere in our application but I
think I removed most of them, feel free to remove any other. Again,
certainly not that harmful if you leave them in there
but it's better if you get rid of them.