Make the Choux Dough: In a medium saucepan, combine the water, butter, salt, and sugar over medium heat. Stir occasionally and allow the butter to fully melt before the mixture begins boiling. If using, add the vanilla extract now.
Incorporate the Flour: Once the liquid starts to bubble gently, remove the pan from heat and add in all the sifted flour at once. Using a sturdy wooden spoon or heat-safe spatula, stir vigorously until the mixture forms a thick dough that pulls away from the sides.
Cook the Dough Further: Return the saucepan to medium heat and cook the dough while stirring constantly for 2–3 minutes. A thin film should develop at the bottom of the pot, indicating the dough has dried out sufficiently. Remove from heat.
Cool the Dough and Add Eggs: Transfer the dough to a mixing bowl and spread it out slightly to release steam. Allow to cool for a few minutes until it's just warm to the touch (under 160°F). In a separate bowl, whisk the eggs. Gradually add the eggs to the dough in 5–6 additions, mixing well after each until the dough is glossy and smooth. You may not need all the egg—test the consistency as you go.
Pipe the Éclairs: Transfer the finished dough into a 16-inch piping bag fitted with a ½-inch French star tip. On a baking tray lined with a Silpat or parchment, pipe out éclairs about 4–5 inches long. The ends should be slightly thicker than the center. Flatten any pointed tips with a damp fingertip.
Bake the Shells: Lightly dust the piped éclairs with confectioners' sugar. Bake in a preheated 375°F (190°C) oven for 25 minutes. Then, quickly pierce one end of each éclair with a toothpick to release steam. Continue baking for another 5–10 minutes until they are a deep golden brown. Cool for 10 minutes on the tray, then transfer to a wire rack.
Prepare the Pastry Cream: Make your vanilla or chocolate pastry cream ahead of time (ideally the day before). Chill it thoroughly before using. Transfer the filling to a pastry bag fitted with a small round tip.
Fill the Éclairs: Use the piping tip to poke three small holes in the base of each cooled éclair shell. Pipe the cream into each hole until the shell feels full and firm. Wipe away any overflow.
Make the Chocolate Glaze: Place the chocolate in a heatproof bowl. In a separate container, heat the cream and salt until simmering. Pour the hot cream over the chocolate. Add butter and corn syrup. Let sit for a minute, then stir until smooth and glossy. If needed, microwave in short bursts to fully melt.
Dip and Finish: Dip the tops of each filled éclair into the warm glaze, letting excess drip off. Set on a wire rack to allow the glaze to set. Serve chilled or at room temperature.