Preheat your oven to 350°F (175°C). Grease a 9×13-inch baking pan with butter or nonstick spray, then line it with parchment paper, leaving some overhang on the long sides for easy lifting. Lightly grease the parchment as well.
In a large bowl, whisk together the all-purpose flour, 1 cup granulated sugar, baking powder, and fine sea salt until evenly combined.
2 cups all-purpose flour, 1 cup granulated sugar, 1/2 teaspoon baking powder, 1/4 teaspoon fine sea salt
Add the cold, cubed unsalted butter to the dry ingredients. Using a pastry cutter, two knives, or your fingertips, cut the butter into the flour mixture until it resembles coarse crumbs with some pea-sized pieces.
1 cup unsalted butter
In a small bowl, lightly beat the egg with the vanilla extract. Drizzle this over the crumb mixture and toss with a fork until the crumbs are moistened and clumpy. The mixture should still be crumbly but hold together when pressed.
1 large egg, 1 teaspoon pure vanilla extract
Measure out about 1 1/2 cups of the crumb mixture and transfer it to a separate bowl. This will be the topping. Add the rolled oats, brown sugar, and ground cinnamon (if using) to this bowl and stir gently to combine.
1/2 cup old-fashioned rolled oats, 2 tablespoons brown sugar, 1/4 teaspoon ground cinnamon
Pour the remaining larger portion of crumb mixture into the prepared baking pan. Using your hands or the bottom of a measuring cup, press it firmly and evenly into the bottom of the pan, making sure to reach the corners so the blueberry filling won’t seep underneath.
In a medium bowl, gently combine the blueberries, 1/2 cup granulated sugar, cornstarch, lemon juice, and lemon zest (if using) until the berries are evenly coated and glossy. If using frozen blueberries, work quickly and do not thaw them first.
3 cups blueberries, 1/2 cup granulated sugar, 2 tablespoons cornstarch, 1 tablespoon lemon juice, 1 teaspoon lemon zest
Scatter the blueberry filling evenly over the pressed crust, spreading the berries out so each bar will have a generous blueberry layer.
Sprinkle the oat-enriched crumb topping evenly over the blueberries. Leave it loose and crumbly rather than pressing it down; a mix of larger clumps and smaller crumbs gives the best texture.
Bake on the middle rack for 40–45 minutes, or until the top is light golden brown and the blueberry filling is bubbling around the edges and in a few spots toward the center. If the topping is browning too quickly, tent the pan loosely with foil.
Place the pan on a wire rack and let the bars cool completely for at least 2–3 hours so the filling can set. Once fully cooled, use the parchment overhang to lift the slab from the pan and cut into 16–20 bars. For extra neat slices, chill the cooled bars in the refrigerator for 1–2 hours before cutting.