Preheat the oven to 350°F (175°C). Lightly grease a 9x13-inch baking pan and line it with parchment paper, leaving an overhang on the long sides for easy lifting. Grease the parchment as well.
In a medium bowl, whisk together the flour, cinnamon, nutmeg, ginger, baking powder, baking soda, and fine sea salt for at least 30 seconds to distribute the spices evenly.
1 3/4 cups all-purpose flour, 1 1/2 teaspoons ground cinnamon, 1/4 teaspoon ground nutmeg, 1/4 teaspoon ground ginger, 1 teaspoon baking powder, 1/2 teaspoon baking soda, 1/2 teaspoon fine sea salt
In a large mixing bowl, stir together the granulated sugar and light brown sugar to break up any lumps. Add the eggs, neutral oil, applesauce or Greek yogurt, and vanilla. Whisk until smooth and slightly thickened, about 1 minute by hand.
3/4 cup granulated sugar, 1/2 cup light brown sugar, 3 large eggs, 1/2 cup neutral oil, 1/4 cup unsweetened applesauce or plain Greek yogurt, 2 teaspoons pure vanilla extract
Stir the finely grated carrots and very well drained crushed pineapple (if using) into the wet mixture until evenly combined. The batter will look somewhat loose at this stage.
2 cups finely grated carrots, 1/2 cup crushed pineapple
Sprinkle the dry ingredient mixture over the wet mixture. Using a spatula, gently fold just until no dry streaks of flour remain, being careful not to overmix. If using walnuts or pecans and/or raisins, fold them in now.
1 3/4 cups all-purpose flour, 1 1/2 teaspoons ground cinnamon, 1/4 teaspoon ground nutmeg, 1/4 teaspoon ground ginger, 1 teaspoon baking powder, 1/2 teaspoon baking soda, 1/2 teaspoon fine sea salt, 1/2 cup chopped walnuts or pecans, 1/2 cup raisins or golden raisins
Pour the batter into the prepared 9x13-inch pan and spread it into an even layer, nudging it into the corners with a spatula or the back of a spoon.
Bake on the center rack for 23–28 minutes, or until the top looks set, the edges are lightly golden, and a toothpick inserted in the center comes out with a few moist crumbs but no wet batter.
Place the pan on a wire rack and let the carrot cake bars cool completely in the pan, about 1 hour. Do not frost while warm or the frosting will melt and slide.
In a medium bowl with a hand mixer or a stand mixer fitted with the paddle attachment, beat the softened cream cheese and softened unsalted butter together on medium speed until smooth and fluffy, about 2 minutes. Gradually add the powdered sugar, about 1/2 cup at a time, mixing on low after each addition. Add the vanilla, a pinch of salt, and 1 tablespoon milk or cream if needed, then beat on medium until creamy and spreadable, adding more milk or powdered sugar as needed to reach desired consistency.
8 oz cream cheese, 1/2 cup unsalted butter, 2 1/2 to 3 cups powdered sugar, 2 teaspoons pure vanilla extract, salt, 1 to 2 tablespoons milk or heavy cream
Once the bars are fully cool, spread the cream cheese frosting evenly over the top of the cake in the pan, creating swirls with a spatula or the back of a spoon if desired.
For the cleanest cuts, chill the frosted bars in the refrigerator for 20–30 minutes. Use the parchment overhang to lift the sheet of bars out of the pan, then slice into 16–24 bars, depending on desired size. Wipe a warm knife between cuts for neat slices.