Combine the rhubarb, sugar, vanilla bean and seeds, lemon zest, salt, and water (if using) in a heavy-bottomed saucepan.
Let sit at room temperature for 15–20 minutes to macerate, if you have the time. (Optional, but it helps the pieces hold their shape.)
Set the pan over medium heat and cook, stirring occasionally, for 8–12 minutes, until the rhubarb is tender and the liquid has reduced to a light syrup.
Remove from the heat, discard the vanilla pod, and stir in the lemon juice (and vanilla extract, if using in place of the bean).
Mash a few pieces with the back of a spoon for a thicker texture, if desired.
Cool completely before transferring to a jar. The compote will continue to thicken as it cools.