Combine ingredients for the filling in a medium-sized pot: apples, sugar, spices, lemon juice, vanilla extract, and salt.
Cook over medium to low heat for about 15 minutes until the apples have softened; Use a masher or a spoon to break the apples apart and create a jammy and spreadable consistency. Remove from heat and let cool in the fridge while preparing the dough.
Combine flour, powdered sugar, and salt in a food processor and pulse to combine. You can also do this by hand in a separate bowl!
Add cold butter and pulse in the food processor until it looks like sand. If doing this by hand, just break up the cold butter with your fingers and crumble until you get to the sand-like consistency.
Add egg and vanilla extract and pulse until the dough starts to come together. If working by hand, add to your bowl, mix to distribute, and gently press together until your dough forms a ball. Wrap the dough in plastic wrap and refrigerate for at least 30 minutes.
If you would like to add apple slices as a topping (you don't have to but we love the extra apple flavor and texture!), prepare the apples by slicing thinly and then tossing with sugar, lemon juice, and a sprinkle of cinnamon.
Preheat your oven to 375 degrees F (190 C). After refrigerating, take two-thirds of your dough and roll out the dough into one large rectangle. The dough should be about 1/4 inch thick. You may have a little extra from trimming the edges, so make sure to save it for the lattice!
Transfer the rectangle to a parchment lined baking sheet. You can put this in the freezer to keep the dough cool while you prepare the lattice.
Roll out the last third of the dough (plus any scraps) into a rectangle, and cut into strips of equal width. If you want to be precise about the length, you will need 4-6 long strips (the same length as the long side of the rectangle you rolled out in step 7) and 6-8 short strips (the same length as the short side of the step 7 rectangle). Honestly, though, we just cut a bunch of short strips and then perform some pastry surgery to make the long strips. It’s way easier and will still look great when it’s baked!
After you have cut the strips, take out your dough from the freezer or fridge and spread on the cooled apple filling, going all the way to the edge.
Now is also the time to add your apple slices, arranging in whatever pattern you would like!
Make your lattice – this looks way harder than it actually is! Start by laying down all of the short strips on top of the jam layer. Now, fold back the second, fourth, sixth, and eighth short strips, so that they’re all still attached along the left side of the pastry but there’s room to lay down the first long strip. Lay down the long strip (farthest to the left in the picture) so that it goes over, under, over, under, over, under, etc all the short strips. Then, fold the second, fourth, sixth, and eighth strips back to where they were. Fold back the first, third, fifth, and seventh strips. Lay down the next long strip – this time the pattern should be under, over, under, over, etc. Fold the first, third, fifth, and seventh strips back to where they were. Repeat this process with the rest of the long strips, alternating which short strips you fold back. The pattern should alternate as well and this creates the lattice look!
Optionally, you can add extra strips pressed around the edges for a cleaner look. If you don't add this, that is totally fine as well! You may just need to trim the sides after baking to get even squares/slices.
Put in the oven and bake for about 15 minutes until your dough looks golden on the top.
Take it out of the oven, let cool for about 10 minutes, and then slice into whatever size rectangles/squares you prefer! You can serve it with whipped cream or ice cream (or plain, of course) and enjoy!