Preheat the oven to 350℉ and grease then line an 8x8” baking pan with parchment paper with slight overhangs.
In a bowl, whisk together the flour, cinnamon, nutmeg, ginger, cloves, baking powder, and salt and set aside.
1 cup all-purpose flour, 1 ½ teaspoons ground cinnamon, ¼ teaspoon ground nutmeg, ¼ teaspoon ground ginger, ¼ teaspoon ground cloves, ¼ teaspoon baking powder, ½ teaspoon kosher salt
In another bowl, whisk together the melted butter and light brown sugar until combined. Add the egg and vanilla extract and whisk vigorously for one minute.
½ cup unsalted butter, 1 cup light brown sugar, 1 large egg, 2 teaspoons vanilla extract
Add the dry ingredients and mix it together with a rubber spatula. Then, fold in the shredded carrots and coconut, if using, until evenly distributed. Set aside.
1 cup finely shredded carrots, ⅓ cup sweetened shredded coconut
In another bowl, mix together the cream cheese and granulated sugar with a rubber spatula or wooden spoon until smooth. Add the sour cream, egg yolk, and vanilla and mix until combined.
4 oz cream cheese, 2 tablespoons sour cream, ¼ cup granulated sugar, 1 large egg yolk, 1 teaspoon vanilla extract
Add ⅓ of the carrot cake batter to the pan and spread evenly to cover the bottom. Then, use a large cookie scoop to alternate adding scoops of the carrot cake batter and cheesecake batter randomly all over the pan.
Use a butter knife to swirl the batters together, then bake for 20-25 minutes until no longer raw in the center.
Cool for one hour, then transfer to the fridge to chill for at least 2 hours. Slice and serve.