Preheat the oven to 350°F. Line a 9 × 13-inch baking pan with parchment paper or coat it lightly with grease to prevent the bars from sticking and to make removal easier.
Place the all-purpose flour, baking soda, salt, cinnamon, ground ginger, and cloves in a medium mixing bowl. Whisk thoroughly so that the spices and leavening agent are distributed evenly throughout the flour.
Freshly ground cinnamon may be used when available for a brighter and more aromatic cinnamon flavor.
Place the melted butter, after it has cooled to room temperature, in the bowl of a stand mixer or a large bowl suitable for a hand mixer. Add the packed light brown sugar and granulated sugar.
Beat the mixture for approximately 2 minutes, or until it appears paler, lighter, and fluffier in texture. Properly beating these ingredients incorporates air and contributes to the tender texture of the finished bars.
With the mixer operating, add the unsulphured molasses, room-temperature egg, and the optional freshly grated ginger.
Continue beating until the mixture is completely uniform. Scrape the sides and bottom of the bowl with a spatula as necessary, since the thick molasses can collect around the edges or remain in small pockets.
The optional fresh ginger supplies a sharper, livelier ginger flavor than ground ginger alone.
Add the previously combined dry ingredients to the wet mixture. Mix on low speed only until the flour and spices have been incorporated and no dry streaks remain.
Avoid excessive mixing at this stage. Working the dough longer than necessary can encourage gluten development and produce firmer, tougher bars rather than a tender texture.
Step 5: Spread and Bake
Transfer the finished dough to the prepared baking pan. Press and spread it into an even layer across the bottom of the pan, using an offset spatula or the back of a measuring cup to smooth the surface if needed.
Bake for 16–18 minutes. The bars are ready when the outer edges are set and feel lightly firm while the center retains a small amount of softness or give.
Remove the pan from the oven. The residual heat will continue cooking the gingerbread slightly as it cools.
Allow the gingerbread layer to cool completely to room temperature before applying the icing. Frosting the bars while warm can cause the cream cheese topping to soften or melt.
In a clean mixing bowl, beat the softened full-fat block cream cheese together with the softened unsalted butter for approximately 1 minute, or until the mixture is smooth and creamy.
Both ingredients should be softened to room temperature so they combine evenly without forming lumps.
Gradually incorporate the sifted powdered sugar along with the vanilla extract. Beat on medium speed for another 1–2 minutes, until the icing becomes light, fluffy, smooth, and easy to spread.
Sifting the powdered sugar beforehand helps prevent unwanted lumps and produces a finer-textured icing.
Spread the prepared cream cheese icing evenly over the completely cooled gingerbread base with an offset spatula or the back of a spoon.
While the icing is still slightly tacky, scatter holiday sprinkles over the surface so they adhere securely.
Slice the frosted gingerbread into squares and serve.