Toss the diced apples with the brown sugar and lemon juice in a bowl and let them sit for 30 minutes at room temperature. The sugar draws liquid out of the apples during this rest, and that liquid is what becomes the filling.
Scrape the apples and all of their accumulated juice into a saucepan. Add the water, butter, cinnamon, salt, nutmeg, and ginger.
Cook uncovered over medium low heat for 6 to 8 minutes, stirring occasionally, until the apples have just begun to soften but still hold their shape and still have some bite. Keep it at a gentle simmer rather than a hard boil, and do not put a lid on it at any point. Apples that are cooked past this point keep releasing liquid and start breaking down, and a hard boil drives off the juice you are trying to keep.
Whisk the cornstarch into the cold water until completely smooth. Bring the apples up to a steady simmer, still short of a rolling boil, then stir in the slurry.
Cook for 3 minutes, stirring, until the mixture is thick and glossy and the starch has lost any raw edge. Do not stop as soon as it thickens, and do not let it boil hard while it finishes.
Remove from the heat and stir in the vanilla. Spread the filling out on a sheet pan to cool quickly, then refrigerate until completely cold and firm. This can be made a full day ahead and it must be cold before it touches the dough.